Commit 3ed96da
authored
🩹 [Patch]: Framework-generated code coverage no longer penalizes module authors (#310)
Framework-generated boilerplate — type accelerator registration and
`OnRemove` cleanup — is now tested and covered by updated action
versions referenced in this workflow. The obsolete `$IsWindows` PS 5.1
shim is no longer injected into built modules. Coverage from the
framework test step and the module test step is already aggregated by
Get-CodeCoverage, so module authors' coverage percentages now reflect
only the code they wrote.
- Fixes #309
## Changed: Build-PSModule updated to v4.0.14
Built modules no longer include the `$IsWindows = $true` Desktop edition
shim or its PSScriptAnalyzer suppression attributes. PSModule targets
PowerShell LTS (7.6+), where `$IsWindows` is a built-in automatic
variable.
See
[PSModule/Build-PSModule#132](PSModule/Build-PSModule#132)
for details.
## Changed: Test-PSModule updated to v3.0.10
The framework module tests now validate that every public class and enum
is registered as a type accelerator after import, and that the
`OnRemove` hook cleans them up when the module is removed. These tests
produce coverage artifacts that are aggregated with module author test
coverage, so framework-generated boilerplate no longer counts against
the module author's coverage target.
See
[PSModule/Test-PSModule#113](PSModule/Test-PSModule#113)
for details.
## Changed: README documents the framework testing design
The README now explains:
- Why framework-generated code is tested by the framework itself
- How coverage from both the framework test step and the module test
step is aggregated
- That module authors do not need to test framework-generated code
themselves
## Technical Details
- `.github/workflows/Build-Module.yml`: Updated Build-PSModule from
v4.0.13 to v4.0.14 (`345728124d201f371a8b0f1aacb98f89000a06dc`)
- `.github/workflows/Test-Module.yml`: Updated Test-PSModule from v3.0.8
to v3.0.10 (`8c3337136dc7cf320da39eeb50e776d04bc9ac73`)
- `.github/workflows/Test-SourceCode.yml`: Updated Test-PSModule from
v3.0.8 to v3.0.10
- `README.md`: Added "Code coverage for framework-generated code"
paragraph under the Framework test section; added coverage aggregation
details under the Get code coverage section; removed reference to the
`$IsWindows` shim
- No workflow structure changes — code coverage was already enabled in
Test-Module.yml and Get-PesterCodeCoverage already aggregates all
`*-CodeCoverage` artifacts1 parent 205d193 commit 3ed96da
File tree
4 files changed
+14
-3
lines changed- .github/workflows
4 files changed
+14
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
166 | 174 | | |
167 | 175 | | |
168 | 176 | | |
| |||
299 | 307 | | |
300 | 308 | | |
301 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
302 | 313 | | |
303 | 314 | | |
304 | 315 | | |
| |||
0 commit comments