Comments (3)
Summary is rendered as markdown on the overview page. As a work around I create a markdown document with a table listing all tests and set this as a summary.
It's hacky as the markdown is multiline but output variables must be single line (therefore the conversions below).
- name: Create Test Report Summary
id: test_summary
run: |
# generate a markdown document called results.md
export SUMMARY="$(cat results.md)"
# we need to do some conversions in order to get a one-liner:
SUMMARY="${SUMMARY//'%'/'%25'}"
SUMMARY="${SUMMARY//$'\n'/'%0A'}"
SUMMARY="${SUMMARY//$'\r'/'%0D'}"
# save document in output variable which can be used in action-junit-report
echo "::set-output name=summary::$(echo "$SUMMARY")"
- name: Publish Test Report
uses: mikepenz/action-junit-report@v2
if: always() # always run even if the previous step fails
with:
report_paths: 'results.xml'
check_name: Test Report
fail_on_failure: true
require_tests: true
summary: ${{ steps.test_summary.outputs.summary }}
This is how it looks like:
I left out the generation of the markdown as my original report is from cargo test -- --format=json > results.json
... but just in case somebody has this same setup (this kind of makes it even more hackish, sorry :D )
# cargo output has some nasty combination of escape characters which confuse bash
sed -i.bak -e 's/\\"//g' results.json
echo "| |test |duration|" > results.md
echo "|--|------|--------|" >> results.md
while read line
do
echo "${line}"|jq -r 'if .event != "started" and .type != "suite" and .event == "ok" then ["|","✅|", .name,"|",(.exec_time|tostring),"s","|"]|add else empty end'
echo "${line}"|jq -r 'if .event != "started" and .type != "suite" and .event == "failed" then ["|","❌|", .name,"|",(.exec_time|tostring),"s","|"]|add else empty end'
echo "${line}"|jq -r 'if .event != "started" and .type != "suite" and .event == "ignored" then ["|","🙈|", .name,"|",(.exec_time|tostring),"s","|"]|add else empty end'
echo "${line}"|jq -r 'if .event != "started" and .type != "suite" and .event == "timeout" then ["|","⌛️|", .name,"|",(.exec_time|tostring),"s","|"]|add else empty end'
echo "${line}"|jq -r 'if .event != "started" and .type != "suite" and .event == "allowed_failure" then ["|","🤷|", .name,"|",(.exec_time|tostring),"s","|"]|add else empty end'
done < results.json >> results.md
from action-junit-report.
I wonder how good that is gonna scale. as there are rate limits to keep in mind. and let's say you have 1000 tests, updating github with all of them will most likely fail due to the rate limit.
from action-junit-report.
Hmm still having it as option to test if configured everything correctly might be considered useful. Now it is kinda black box 😁
from action-junit-report.
Related Issues (20)
- Doesn't include errors HOT 3
- Annotation truncates failure output/callstack HOT 6
- Skipping all Annotations HOT 14
- Support ESLint or Jest junit reports HOT 6
- Different line number representation (xunit) HOT 3
- Weird behavior with multiple `report_paths` and failures not being processed HOT 4
- Test report stopped working without change HOT 8
- require_tests flag is not working HOT 5
- Editor points out that github_token is required HOT 1
- Skipped tests are show as passed when included_passed set to true HOT 3
- Test failures not correctly recognized HOT 8
- action using deprecate 'set-output' command HOT 2
- Documentation for Maven Surefire HOT 2
- Out of memory error on large project HOT 14
- Failed tests are not shown in Annotations HOT 9
- Check Run Not Created when update_check: true HOT 2
- act error: Error: The runs.using key in action.yml must be one of: [composite docker node12 node16], got node20 HOT 4
- Invalid character entity when using with dastardly HOT 6
- Error: Converting circular structure to JSON HOT 9
- Option to explicitly fail check run HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from action-junit-report.