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

Action seems to ignore the content of the trx file #344

Closed
grofit opened this issue Aug 15, 2022 · 12 comments
Closed

Action seems to ignore the content of the trx file #344

grofit opened this issue Aug 15, 2022 · 12 comments

Comments

@grofit
Copy link

grofit commented Aug 15, 2022

I am getting blank test results even though the tests results exist and the action seems to find them, so am I doing something wrong?

- name: Publish Test Results
  uses: EnricoMi/publish-unit-test-result-action@v2
  with:
    xunit_files: "dist/*.trx"

The test output section has run the tests and output the trx file to the dist folder:

https://github.com/strem-app/strem/runs/7840354498?check_suite_focus=true#step:6:809

Results File: /home/runner/work/strem/strem/dist/Strem.UnitTests.Test.Results.trx
Passed! - Failed: 0, Passed: 44, Skipped: 0, Total: 44, Duration: 146 ms - /home/runner/work/strem/strem/src/Strem.UnitTests/bin/Debug/net6.0/Strem.UnitTests.dll (net6.0)

However when the unit test publish action is run it finds the file from what I can tell but generates an empty output:
https://github.com/strem-app/strem/runs/7840354498?check_suite_focus=true#step:7:23

2022-08-15 15:00:13 +0000 - publish - INFO - Reading dist/*.trx (1 file, 65.0 KiB)
2022-08-15 15:00:13 +0000 - publish - INFO - Finished reading 1 files in 0.00 seconds

image

Any help would be great as I don't really know how to debug further as file is there, its found the file, it says its processing it, so a bit baffled.

@EnricoMi
Copy link
Owner

Can you please provide the TRX file so I can debug why the action cannot process it properly?

@grofit
Copy link
Author

grofit commented Aug 15, 2022

Strem.UnitTests.Test.Results.zip

I have generated this locally but this should be what the end build uses, thanks for the quick response.

@EnricoMi
Copy link
Owner

That file works fine, are you sure the file is identical to the one on GitHub actions?

@grofit
Copy link
Author

grofit commented Aug 15, 2022

It should be, it uses a cake build script so uses exactly the same logic to run the build on both local system and git hub actions, is there an easy way to get the file out of github action or do I need to publish it as an artifact?

@EnricoMi
Copy link
Owner

Yes, the file needs to be uploaded as an artifact.

@grofit
Copy link
Author

grofit commented Aug 15, 2022

app.zip
There you go, that contains all the outputs from that build section, the trx, html and a code coverage bit

@EnricoMi
Copy link
Owner

That is puzzling, the file works just fine, it adds 44 passing tests: #345 (comment)

@grofit
Copy link
Author

grofit commented Aug 15, 2022

Yeah, I use the same approach on another project on Azure Devops and that processes them fine, but for some reason it doesnt work here.

Here is the build I got that artifact from (I removed the app part manually as its 40mb):

https://github.com/strem-app/strem/runs/7845897268?check_suite_focus=true

As you can see its saying nothing has passed etc.

@EnricoMi
Copy link
Owner

@EnricoMi
Copy link
Owner

I have found the issue, it is in:

with:
  xunit_files: "dist/*.trx"

It should read:

with:
  trx_files: "dist/*.trx"

https://github.com/EnricoMi/strem/actions/runs/2866802522/attempts/1#summary-7854780069

I have improved the logging so it is easier to spot this kind of issue:

2022-08-16 09:22:55 +0000 - publish -  INFO - Reading XUnit files dist/*.trx (1 file, 65.0 KiB)

@grofit
Copy link
Author

grofit commented Aug 16, 2022

It was a bit confusing because currently the front page shows these unique file name props like "trx_files" etc but the rest of the docs just says "files" so I wasnt entirely sure it was right in the first place.

Thanks for looking into it for me though!

@EnricoMi
Copy link
Owner

Thanks for reporting.

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

No branches or pull requests

2 participants