Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub test summary not working #18

Open
1stthomas opened this issue Dec 8, 2024 · 4 comments
Open

GitHub test summary not working #18

1stthomas opened this issue Dec 8, 2024 · 4 comments
Assignees
Labels
question Further information is requested
Milestone

Comments

@1stthomas
Copy link
Owner

1stthomas commented Dec 8, 2024

test-summary/action@v2 should work with junit report but the summary only shows " No tests were run".

A generated test report looks something like following:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
  <testsuite name="/home/runner/work/ht7-test/ht7-test/phpunit.xml" tests="13" assertions="34" errors="0" failures="0" skipped="0" time="0.011475">
    <testsuite name="Unit" tests="13" assertions="34" errors="0" failures="0" skipped="0" time="0.011[47](https://github.com/1stthomas/ht7-test/actions/runs/12322540753/job/34396335648#step:8:48)5">
      <testsuite name="Ht7\Test\Tests\Mocks\DefaultMockTest" file="/home/runner/work/ht7-test/ht7-test/tests/Unit/Mocks/DefaultMockTest.php" tests="3" assertions="6" errors="0" failures="0" skipped="0" time="0.006662">
        <testcase name="createWithConstruct" file="/home/runner/work/ht7-test/ht7-test/tests/Unit/Mocks/DefaultMockTest.php" line="29" class="Ht7\Test\Tests\Mocks\DefaultMockTest" classname="Ht7.Test.Tests.Mocks.DefaultMockTest" assertions="2" time="0.0056[49](https://github.com/1stthomas/ht7-test/actions/runs/12322540753/job/34396335648#step:8:50)"/>
        ...
        </testsuite>
        <testcase name="constructor" file="/home/runner/work/ht7-test/ht7-test/tests/Unit/Reflection/ReflectionHelperTest.php" line="31" class="Ht7\Test\Tests\Reflection\ReflectionHelperTest" classname="Ht7.Test.Tests.Reflection.ReflectionHelperTest" assertions="1" time="0.000237"/>
      </testsuite>
    </testsuite>
  </testsuite>
</testsuites>

But the parser expects the testcases after the first testcases element, see:

https://github.com/test-summary/action/blob/4cdf6876dc9538fb18432a56757830acd56c492e/src/test_parser.ts#L202-L224

@1stthomas 1stthomas added the bug Something isn't working label Dec 8, 2024
@1stthomas
Copy link
Owner Author

Seems not really to be a bug because https://github.com/ctrf-io/github-test-reporter works as expected.

@1stthomas
Copy link
Owner Author

1stthomas commented Dec 18, 2024

Should we add an issue on the underlying action for this problem (https://github.com/test-summary/action)?

@1stthomas 1stthomas self-assigned this Dec 18, 2024
@1stthomas 1stthomas added question Further information is requested and removed bug Something isn't working labels Dec 18, 2024
@1stthomas
Copy link
Owner Author

the first </testsuite> element is because indeed with PHPUnit we have a 4th level of <testsuite> and I forgot to select that too.

@1stthomas 1stthomas added this to the 1.0.0 milestone Dec 18, 2024
@1stthomas
Copy link
Owner Author

Issue at: test-summary/action#57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant