zyborg / pester-tests-report

GitHub Action to run Pester tests and generate report attached to Workflow Run
MIT License
40 stars 13 forks source link

Pester Configuration #17

Closed codaamok closed 2 years ago

codaamok commented 2 years ago

Hey, do you know if it's possible to use Pester Configuration options with the Action? https://pester-docs.netlify.app/docs/usage/configuration

ebekker commented 2 years ago

It is possible to use a Pester Configuration, but not directly with this Action. That is, there is a general "catch all" approach to customize the way Pester tests are invoked -- instead of having the Action invoke your tests, you can invoke them directly any way you want and simply produce a test results output file before calling this Action, and then feed that into the Action as input.

Specifically, the test_results_path input allows you specify the results output file of a Pester test run. When this input is specified, this Action will not invoke the Pester tests for you. So all you need to do is invoke your Pester tests and make sure you generate results file in results file using NUnit 2.5 format.

For example, in the PesterConfiguration object you should provide a value of NUnit2.5 for the TestResult.OutputFormat option and provide some path to generate test results for the TestResult.OutputPath option. Then when you invoke this Action, simply provide the same path for the test_results_path input.

codaamok commented 2 years ago

Ah, awesome, so I still get the beautiful report this Action provides. Great, thank you!