zyborg / dotnet-tests-report

GitHub Action to run .NET Core tests and generate report attached to Workflow Run
MIT License
112 stars 36 forks source link

test_results_path as a directory #1

Closed NasAmin closed 3 years ago

NasAmin commented 3 years ago

First of all thanks a lot for this awesome action! We are using multi-stage docker builds so our tests run inside docker. I was trying to use the test_restults_path variable to point to a directory because we are writing all the tests to a directory.

It seems like test_results_path is expected to be an absolute path to a single file. Is there a possibility to point to a directory and then generate a test report for all the trx files present in the directory?

If I do provide an absolute path, I am getting this error

Export-Clixml: /home/runner/work/_actions/zyborg/dotnet-tests-report/v1.0.0/action.ps1:279
Line |
 279 |      Export-Clixml -InputObject $testResult -Path $result_clixml_path
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Could not find a part of the path
     | '/home/runner/work/auditlogas/auditlogas/_TMP/dotnet-test-result.clixml'.

The above error seems to be happening because the _TMP directory doesn't exist. If I create $PWD/_TMP prior to running this action then it works as expected.

I would really appreciate some guidance

Thanks!

NasAmin commented 3 years ago

@ebekker I have opened a PR to allow failing the check if there is a failing test.

NasAmin commented 3 years ago

Closing this issue as I have created a new action to get the desired output. https://github.com/marketplace/actions/trx-parser