Commit 16419d0
Upgrade Process-PSModule to Pester 6.1 (#519)
## Implemented in Process-PSModule
- Enforce the Pester `[6.1.0,7.0.0)` range in reusable framework test
runs.
- Align module-local workflow inputs with the current Invoke-Pester
contract: `Version`/`Prerelease` select Pester, while
`GitHubVersion`/`GitHubPrerelease` select the GitHub module. Pester
prerelease remains at the action default.
- Keep the six Test-PSModule container/test files inside the action
implementation at `.github/actions/Test-PSModule/src/tests`, because
they are context-dependent framework suites executed against the
compiled module or source tree. Discovery remains
`$PSScriptRoot/tests/$settings`.
- Add a framework CI contract test that validates Pester 6.1
configuration properties:
- `Run.Shuffle`
- `Run.ShuffleSeed`
- `Run.Parallel`
- `Run.ParallelThrottleLimit`
- `Debug.ShowStartMarkers`
- Align coverage input documentation with Pester 6.1: supported formats
are JaCoCo and Cobertura, and profiler-based tracing is documented
correctly.
- Update Pester 6.1 authoring and coverage-report guidance.
## Pester 6.1 runtime audit
A local Pester 6.1 probe generated a passing test result and coverage
report, and the Get-PesterCodeCoverage action processed that JSON
successfully. The coverage result shape remains compatible:
`CoveragePercent`, `CoveragePercentTarget`, `CommandsMissed`,
`CommandsExecuted`, `FilesAnalyzed`, and all count properties are
present and consumed correctly.
The Pester result still exposes `Containers`; each container retains
`Data`, `Blocks`, and aggregate result/count properties. The existing
container files therefore remain compatible with the
compiled-module/source-tree execution model.
## Contract findings and required upstream follow-up
The current `PSModule/Invoke-Pester` v5.1.0 action does not expose these
Pester configuration properties as action inputs, so this repository
deliberately does not add incompatible passthrough mappings:
- `Run_Shuffle`
- `Run_ShuffleSeed`
- `Run_Parallel`
- `Run_ParallelThrottleLimit`
- `Debug_ShowStartMarkers`
The coordinated `PSModule/Invoke-Pester` follow-up must add each input
to `action.yml`, forward each `PSMODULE_INVOKE_PESTER_INPUT_*`
environment variable, map them into the generated `PesterConfiguration`,
and publish a version/tag that Process-PSModule can pin.
Process-PSModule can then expose the corresponding reusable-action
inputs and pass them through.
## Test and fixture boundaries confirmed
- Module-local tests assume the built module is already loaded:
`Test-ModuleLocal.yml` imports the artifact in its prescript before
invoking Pester.
- Framework module tests import the module explicitly in their own test
scopes; no implicit preload was introduced.
- PSD1 files in the repository test fixture (`src/data/Config.psd1` and
`src/data/Settings.psd1`) are not implicitly loaded and are currently
unused. Any future PSD1 dataset test must call
`Import-PowerShellDataFile` explicitly or load it from supported setup.
- `Expose-TestData` passes only explicit caller-provided fixtures as
environment variables to setup, teardown, and tests.
- Module linting remains a separate `Invoke-ScriptAnalyzer` job and
artifact path; it is not folded into Pester execution.
## Validation
- Pester 6.1 configuration contract validated locally.
- Pester 6.1 result/container and coverage shapes inspected locally.
- Get-PesterCodeCoverage executed against a generated Pester 6.1
coverage JSON fixture and passed.
- Restored Test-PSModule scripts parsed successfully.
- Test-PSModule path resolution validated from a consumer repository
root.
- Changed PowerShell parsed successfully.
- `git diff --check` passed.
Commits: `337533c`, `ad2961e`, `8c3366f`, `0423d6a`
---------
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>1 parent 7c8bc79 commit 16419d0
7 files changed
Lines changed: 48 additions & 13 deletions
File tree
- .github
- actions
- Get-PesterCodeCoverage
- Test-PSModule
- src/tests/Module/PSModule
- workflows
- docs/content
- guides
- reference
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
| 81 | + | |
81 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
| 291 | + | |
291 | 292 | | |
292 | 293 | | |
293 | 294 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
44 | 64 | | |
45 | 65 | | |
46 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | 75 | | |
77 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
23 | 32 | | |
24 | 33 | | |
25 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
322 | | - | |
| 322 | + | |
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
| |||
0 commit comments