Comments (1)
After some research, I found that JUnit XML test report files can contain:
- A root
<testsuites>
tag with multiple child<testsuite>
tags (what I've seen the most during my browsing) - A single root
<testsuite>
tag (maybe not so common but yet valid)
The current implementation is based on report files like this one:
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="Tests" time="9.891" tests="62" failures="0">
<testsuite name="mdtodoc" timestamp="2024-04-18T19:12:28" tests="1" file="[...]" time="0.285" failures="0">
<testcase name="CLI mdtodoc should fail without argument" time="0.284" classname="should fail without argument"></testcase>
</testsuite>
<testsuite name="mdtodoc -h/--help" timestamp="2024-04-18T19:12:28" tests="2" file="[...]" time="0.556" failures="0">
<testcase name="CLI mdtodoc -h/--help should display help (-h)" time="0.285" classname="should display help (-h)"></testcase>
<testcase name="CLI mdtodoc -h/--help should display help (--help)" time="0.271" classname="should display help (--help)"></testcase>
</testsuite>
[...]
</testsuites>
But having the sum of tests and failures in the root <testsuites>
tag doesn't seem to be the most common and standard (e.g. the jest-junit
package generates a file with testsuites
>testsuite
>testcase
tags hierarchy but doesn't output tests/failures sum in the root <testsuites>
tag).
It may be more reliable to sum tests
, failures
and errors
from each <testsuite>
tag (whether there is only one at the root or multiple inside a root <testsuites>
tag). That would make this loader more standard, thus supporting more report files, including yours (without breaking with mines).
Does it sound good to you?
P.S. Only the first valid report file (starting from the closest to the project root) is actually used to generate the badge. So make sure your test runner generates a single aggregated report file.
from ci-badges-action.
Related Issues (2)
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 ci-badges-action.