gaelgirodon / ci-badges-action Goto Github PK
View Code? Open in Web Editor NEWBadges for test results and code coverage
License: GNU General Public License v3.0
Badges for test results and code coverage
License: GNU General Public License v3.0
Hello, I tried to use this project in my CI and get the following logs:
Load JUnit report '/home/runner/work/CI-test/CI-test/build/test-results/test/TEST-MyTest.xml'
Report is not a valid JUnit report
Load JUnit report '/home/runner/work/CI-test/CI-test/build/test-results/test/TEST-MyTest2.xml'
Report is not a valid JUnit report
Loaded 0 JUnit report(s)
TEST-MyTest2.xml is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="MyTest2" tests="1" skipped="0" failures="0" errors="0" timestamp="2024-04-18T02:45:37" hostname="PouryaMBP" time="0.001">
<properties/>
<testcase name="X()" classname="MyTest2" time="0.001"/>
<system-out><![CDATA[]]></system-out>
<system-err><![CDATA[]]></system-err>
</testsuite>
I have checked the source code and it seems like the regex is trying to find testsuites but the junit test results has the keyword testsuite (s is missing at the end).
const report = await fs.readFile(r, { encoding: 'utf8' });
const testsMatches = report
.match(/(?<=<testsuites[^>]+tests=")[0-9]+(?=")/);
const failedMatches = report
.match(/(?<=<testsuites[^>]+failures=")[0-9]+(?=")/);
if (testsMatches?.length !== 1 || failedMatches?.length !== 1) {
core.info('Report is not a valid JUnit report');
continue; // Invalid report file, trying the next one
}
My project has multiple test reports
https://github.com/tsantalis/RefactoringMiner/actions/runs/9143815119/job/25141202337
I added your action in the project's workflow
and it loads only the first one
Load JUnit report '/home/runner/work/RefactoringMiner/RefactoringMiner/build/test-results/test/TEST-org.kohsuke.github.GHRepositoryWrapperTest.xml'
Loaded 1 JUnit report(s)
Is it possible to load all test reports, and save in the json, the total number of passed/failed/skipped tests?
Thank you,
Nikos
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.