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

Add support for extra parameters and for failing build if tests fail #14

Closed rocklan closed 3 years ago

rocklan commented 3 years ago

This PR adds support for being able to supply extra parameters to Dotnet test like --filter category=fast or --no-build, this addresses #10. It also adds support for being able to fail the build if the tests fail, which is helpful because currently if any tests fail there's no way to tell from the pull request.

Two new parameters have been introduced:

fail_build_on_failed_tests - boolean, set to true to fail the build if any tests fail. The report is still generated

extra_test_parameters - string, useful for adding extra parameters to dotnet test. Eg, --collect:"XPlat Code Coverage"

These can be used like so:

 - name: Test
    uses: zyborg/dotnet-tests-report@master
    with:
      project_path: myproject.csproj
      ...
      fail_build_on_failed_tests: true
      extra_test_parameters: '--no-build --filter "category=unit"'

These changes are backwards compatible, if the parameters aren't supplied things should (ha) continue to work as before.

I am by means a powershell/github actions guru so please double check my changes! They seemed to work ok for me :)

rocklan commented 3 years ago

Thanks :) I'm confused though, it says you approved the changes but then requested more changes an hour later, but I can't seem to find the requested changes.

saliehendricks commented 3 years ago

This PR looks to fix some issues I have experienced. Looking forward to it being merged.

Tx for the contribution @rocklan cc: @Patreos98 @elsleepymena137

rocklan commented 3 years ago

This PR looks to fix some issues I have experienced. Looking forward to it being merged.

Not sure why it hasn't been, but in the short term you can link to my commit and use the new features that I added.

MirzaMerdovic commented 3 years ago

@rocklan thanks for adding these 🍺
I can say that your branch works for my scenario here

ebekker commented 3 years ago

Great additions, thank you!