test-summary / action

Show a helpful summary of test results in GitHub Actions CI/CD workflow runs
MIT License
395 stars 32 forks source link

Fix Empty Test Suites #20

Closed RehanSaeed closed 1 year ago

RehanSaeed commented 1 year ago

Fixes https://github.com/test-summary/action/issues/19

RehanSaeed commented 1 year ago

@ethomson How does this look?

ethomson commented 1 year ago

Thanks for the fix and the useful tests. There were some conflicts, so I merged this manually.

lukestoward commented 1 year ago

I've just tried out the new v2.1 release that includes this fix, but I think there is another case not catered for here.

For Go based projects we use go-junit-report to transform the testing output into JUnit. If a project doesn't have any tests, the output ends up as the following:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites></testsuites>

I suspect this is because Go doesn't support self closing XML tags. Regardless, the above output still triggers the error unknown test file type for 'results.xml'. @RehanSaeed would it be possible to also cater for this case?