Giter VIP home page Giter VIP logo

ci-badges-action's People

Contributors

gaelgirodon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ci-badges-action's Issues

Report is not a valid JUnit report

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
    }

Load all JUnit test reports, not just the first one

@GaelGirodon

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.