Skip to content

Commit 11e54fa

Browse files
State Pester test-result behavior with direct actors
1 parent 64ffb1d commit 11e54fa

1 file changed

Lines changed: 21 additions & 19 deletions

File tree

  • .github/actions/Get-PesterTestResults
Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,42 @@
11
# Get-PesterTestResults
22

3-
A GitHub Action that gathers Pester test results for the PSModule process by analyzing test artifacts from the workflow run.
4-
It validates test execution and results, providing a summary and failing if any tests are unsuccessful.
3+
This GitHub Action collects Pester test results from workflow artifacts for the PSModule process.
4+
The action examines test execution and results. It writes a summary and fails if tests do not pass.
55

6-
This GitHub Action is a part of the [PSModule framework](https://github.com/PSModule). It is recommended to use the
7-
[Process-PSModule workflow](https://github.com/PSModule/Process-PSModule) to automate the whole process of managing the PowerShell module.
6+
The [PSModule framework](https://github.com/PSModule) includes this action.
7+
For the recommended setup, use the [Process-PSModule workflow](https://github.com/PSModule/Process-PSModule) to automate PowerShell module management.
88

99
## Usage
1010

11-
This action retrieves test artifacts named `*-TestResults`, processes the contained JSON files, and checks for test failures, unexecuted tests,
12-
or missing results. It supports three categories of test suites: Source Code, PSModule, and Module tests.
11+
The action gets artifacts named `*-TestResults` and reads their JSON files.
12+
It finds test failures, tests that did not run, and missing results.
13+
The action supports Source Code, PSModule, and Module test suites.
1314

1415
### Inputs
1516

1617
| Input | Description | Required | Default |
1718
|-------------------------|-------------------------------------------------------------------------------------------------------------------------------|----------|-----------|
18-
| `SourceCodeTestSuites` | JSON array specifying OS names for Source Code test suites. Example: `[{"OSName": "Windows"}]` | Yes | |
19-
| `PSModuleTestSuites` | JSON array specifying OS names for PSModule test suites. Example: `[{"OSName": "Linux"}]` | Yes | |
20-
| `ModuleTestSuites` | JSON array specifying TestName and OSName for Module test suites. Example: `[{"TestName": "Integration", "OSName": "MacOS"}]` | Yes | |
19+
| `SourceCodeTestSuites` | JSON array that specifies OS names for Source Code test suites. Example: `[{"OSName": "Windows"}]` | Yes | |
20+
| `PSModuleTestSuites` | JSON array that specifies OS names for PSModule test suites. Example: `[{"OSName": "Linux"}]` | Yes | |
21+
| `ModuleTestSuites` | JSON array that specifies TestName and OSName for Module test suites. Example: `[{"TestName": "Integration", "OSName": "MacOS"}]` | Yes | |
2122
| `BeforeAllModuleLocalResult` | Workflow result for the `BeforeAll-ModuleLocal` job (`success`, `failure`, `skipped`). | No | `skipped` |
2223
| `Debug` | Enable debug output (`true`/`false`). | No | `false` |
2324
| `Verbose` | Enable verbose output (`true`/`false`). | No | `false` |
24-
| `Version` | Exact version of the GitHub module to install (e.g., `1.0.0`). | No | Latest |
25-
| `Prerelease` | Allow installing prerelease module versions (`true`/`false`). | No | `false` |
25+
| `Version` | Exact version of the GitHub module to install (for example, `1.0.0`). | No | Latest |
26+
| `Prerelease` | Allow prerelease module versions (`true`/`false`). | No | `false` |
2627
| `WorkingDirectory` | Working directory for the script. | No | `.` |
2728

2829
### Secrets
2930

30-
No secrets are required if the action runs in the same repository. The action uses the default `GITHUB_TOKEN` provided by GitHub Actions to access workflow artifacts.
31+
For runs in the same repository, the action needs no additional secrets.
32+
The action uses the default `GITHUB_TOKEN` from GitHub Actions to access workflow artifacts.
3133

3234
### Outputs
3335

34-
This action does not define explicit outputs. Instead:
36+
The action defines no explicit outputs.
3537

36-
- If any tests fail or errors occur, the action exits with a non-zero code, marking the workflow step as failed.
37-
- Detailed results are logged in the workflow run's output.
38+
- If tests fail or errors occur, the action exits with a nonzero code. GitHub Actions marks the workflow step as failed.
39+
- The action writes detailed results to the workflow run log.
3840

3941
### Example
4042

@@ -48,9 +50,9 @@ This action does not define explicit outputs. Instead:
4850
```
4951
5052
### Notes
51-
- **Test Suite Inputs**: Must be valid JSON arrays.
53+
- **Test suite inputs**: The test suite inputs must be valid JSON arrays.
5254
- `SourceCodeTestSuites` and `PSModuleTestSuites` require `OSName`.
5355
- `ModuleTestSuites` requires both `TestName` and `OSName`.
54-
- **BeforeAll module-local failures**: When `BeforeAllModuleLocalResult` is `failure`, the action exits immediately and reports the setup failure as the root cause.
55-
- **Artifact Names**: The action expects artifacts named `*-TestResults` containing Pester JSON reports.
56-
- **Failure Conditions**: The action fails if tests are unexecuted, explicitly failed, or if result files are missing.
56+
- **BeforeAll module-local failures**: If `BeforeAllModuleLocalResult` is `failure`, the action exits immediately and reports the setup failure as the root cause.
57+
- **Artifact names**: The action expects artifacts named `*-TestResults` with Pester JSON reports.
58+
- **Failure conditions**: The action fails if tests do not run, tests fail, or result files are missing.

0 commit comments

Comments
 (0)