roblox-actionscache/pester-tests-report
Executes PowerShell Pester tests within a GitHub Workflow and produces a Tests Report.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stalelast commit Jun 7, 2021
- License
- MIT
- Runtime
- Deprecated runtime
Pinned Snippet
uses: roblox-actionscache/zyborg-pester-tests-report@bb711b31e93f78f7423086d57f81928325829765 # v1.5.0tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| test_results_path | Path to the test results file which will be used to generate a report. If this path is provided, it will override the execution of all Pester tests, so the **`include_paths`** input and all other inputs that drive the test invocation behavior will be ignored. Instead a report will be generated based on the results stored in the file pointed to by this path. At this time, the only test results format supported is the NUnit 2.5 Tests results XML schema. | no | — |
| full_names_filters | Comma-separated list of test full names, or with `-like` wildcards, to restrict which tests are resolved. The default is to include every test discovered matching the other input parameters. | no | — |
| include_paths | Comma-separated list of one or more test files or directories that contain test files, relative to the root of the project. This path is optional and defaults to the project root, in which case all tests script across the entire project tree will be discovered. A test script is identified by the filename pattern `*.Tests.ps1`. This parameter is _ignored_ if the **`test_results_path`** parameter is also provided. | no | — |
| exclude_paths | Comma-separated list of one or more test files or directories that contain test files, relative to the root of the project, that will be excluded from the list fo auto-discovered tests. This parameter is _ignored_ if the **`test_results_path`** parameter is also provided. | no | — |
| include_tags | Comma-separated list of tags to include for testing. This parameter is _ignored_ if the **`test_results_path`** parameter is also provided. | no | — |
| exclude_tags | Comma-separated list of tags to exclude for testing. This parameter is _ignored_ if the **`test_results_path`** parameter is also provided. | no | — |
| output_level | Optionally specify the level of output detail for the test results. May be one of: `none`, `Minimal`, `normal`, `detailed`, `diagnostic` The default is `normal`. | no | — |
| report_name | The name of the report object that will be attached to the Workflow Run. Defaults to the name `TEST_RESULTS_<datetime>` where `<datetime>` is in the form `yyyyMMdd_hhmmss`. | — | — |
| report_title | The title of the report that will be embedded in the report itself, which defaults to the same as the `report_name` input. | — | — |
| github_token | GITHUB_TOKEN to authenticate against API calls to attach report to Workflow Run. | — | — |
| skip_check_run | If true, will skip attaching the Tests Result report to the Workflow Run using a Check Run. Useful if you just want to produce a Gist-based report via the `gist_name` and `gist_token` input parameters. | — | — |
| gist_name | If this value is specifed, the Test Results Report will be attached as a version of a Gist under the name of this input. The `gist_token` input is also required to use this feature. | — | — |
| gist_badge_label | If specified, the Test Report Gist will also include an adjacent badge rendered with the status of the associated Test Report and and label content of this input. In addition to any static text you can provide _escape tokens_ of the form `%name%` where name can be the name of any field returned from a Pester Result, such as `ExecutedAt` or `Result`. If you want a literal percent, just specify an empty name as in `%%`. | — | — |
| gist_badge_message | If Gist badge generation is enabled by providing a value for the `gist_badge_label` input, this input allows you to override the default message on the badge, which is equivalent to the the Pester Result `Status` such as `Failed` or `Passed`. As with the label input, you can specify escape tokens in addition to literal text. See the label input description for more details. | — | — |
| gist_token | GitHub OAuth/PAT token to be used for accessing Gist to store test results report. The integrated GITHUB_TOKEN that is normally accessible during a Workflow does not include read/write permissions to associated Gists, therefore a separate token is needed. You can control which account is used to actually store the state by generating a token associated with the target account. | — | — |
| coverage_paths | Comma-separated list of one or more directories to scan for code coverage, relative to the root of the project. Will include all .ps1 and .psm1 files under these directories recursively. | no | — |
| coverage_report_name | The name of the code coverage report object that will be attached to the Workflow Run. Defaults to the name `COVERAGE_RESULTS_<datetime>` where `<datetime>` is in the form `yyyyMMdd_hhmmss`. | no | — |
| coverage_report_title | The title of the code coverage report that will be embedded in the report itself, which defaults to the same as the `code_coverage_report_name` input. | no | — |
| coverage_gist | If true, will attach the coverage results to the gist specified in `gist_name`. | no | — |
| coverage_gist_badge_label | If specified, the Test Report Gist will also include an adjacent badge rendered with the percentage of the associated Coverage Report and label content of this input. | no | — |
| tests_fail_step | If true, will cause the step to fail if one or more tests fails. | no | — |
Outputs
| name | description |
|---|---|
| test_results_path | Path to the test results file. If the same-named input was provided to this action, this value will be the same. Otherwise, this will be the path to where the test results file was generated from running the resolved Pester tests. |
| error_message | The summary message of the error returned by Pester, or empty if no error was produced. |
| error_clixml_path | If Pester produced an error during invocation, this will be the path to an export of the full error record in the CLIXML form. A subsequent PowerShell step can recover this object using the `Import-Clixml` cmdlet. |
| result_clixml_path | If Pester produced an invocation result, this will be the path to an export of the full result record in the CLIXML form. A subsequent PowerShell step can recover this object using the `Import-Clixml` cmdlet. |
| result_value | A single string indicating the final result such as `Failed` or `Passed`. |
| total_count | Total number of tests discovered. |
| passed_count | Total number of tests passed. |
| failed_count | Total number of tests failed. |
| coverage_results_path | Path to the code coverage results file in JaCoCo XML format. |