Commit d4020f3
authored
🪲 [Fix]: Test data reaches module tests in every consumer repository (#377)
Module test workflows now receive the caller-provided test data (secrets
and variables) in every repository that consumes Process-PSModule, and
version resolution once again honors the bump label on pull requests.
Previously the BeforeAll, Test, and AfterAll module jobs failed at the
"Expose caller-provided test data" step because they ran a script that
shipped only inside Process-PSModule's own repository, so no consumer
could actually use the `TestData` secret introduced in v6.0.0.
- Fixes #378
## Fixed: Test data now reaches module tests in consumer repositories
The `TestData` secret (a single-line JSON object of `secrets` and
`variables`) is now exposed to the BeforeAll, Test, and AfterAll module
test jobs in any repository that consumes Process-PSModule. Each job
installs the shared helpers and runs the `Import-TestData` command,
which reads the payload, masks the secrets, and publishes every entry as
an environment variable for the tests.
The consumer interface is unchanged — callers already pass `TestData` to
`workflow.yml` (added in v6.0.0), so no migration is required:
```yaml
secrets:
TestData: >-
{ "secrets": { "TEST_SECRET": "${{ secrets.TEST_SECRET }}" },
"variables": { "TEST_VARIABLE": ${{ toJSON(vars.TEST_VARIABLE) }} } }
```
Secrets arrive masked in the logs; variables arrive verbatim.
## Fixed: Bump labels are honored during version resolution on pull
requests
Version resolution now always evaluates the Major/Minor/Patch bump
label, so a pull request labeled `Minor` previews the correct next minor
version instead of defaulting to a patch prerelease. This is picked up
by adopting `Resolve-PSModuleVersion` v1.1.4.
## Technical Details
- Removed `.github/scripts/Expose-TestData.ps1` (138 lines); the
exposure logic moved into the shared `PSModule/Install-PSModuleHelpers`
module as the `Import-TestData` command, so it no longer has to be
checked out from the caller's repository.
- `BeforeAll-ModuleLocal.yml`, `Test-ModuleLocal.yml`, and
`AfterAll-ModuleLocal.yml` each now install
`PSModule/Install-PSModuleHelpers@v1.0.9` and run `Import-TestData` (env
`PSMODULE_TEST_DATA: ${{ secrets.TestData }}`) in place of the deleted
script.
- `Plan.yml`: `PSModule/Resolve-PSModuleVersion` pinned to v1.1.4, which
contains the always-evaluate-labels fix.
- `Build-Site.yml`: `Install-PSModuleHelpers` bumped v1.0.8 → v1.0.9 so
the action resolves to a single version across the repo.
- `README.md` documents that test data is exposed through
`Install-PSModuleHelpers` / `Import-TestData`.
- All action references are pinned to release commit SHAs (IPH v1.0.9 =
`8bfb84d557755c67d9b5643efe573bdcae4c1a4a`, Resolve v1.1.4 =
`8d1dac7f326a45ba08060c1e24a5dd6f6f00b3ab`); actionlint is clean.
- Validated end-to-end on a consumer module: all module test matrix jobs
(Linux/Windows/macOS) pass, with a masked secret and a verbatim variable
observed in the tests.1 parent ea19a3e commit d4020f3
7 files changed
Lines changed: 20 additions & 151 deletions
File tree
- .github
- scripts
- workflows
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
39 | | - | |
| 42 | + | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
39 | | - | |
| 42 | + | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | 39 | | |
47 | 40 | | |
48 | 41 | | |
49 | 42 | | |
50 | 43 | | |
51 | 44 | | |
52 | 45 | | |
53 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
492 | | - | |
| 492 | + | |
| 493 | + | |
493 | 494 | | |
494 | 495 | | |
495 | 496 | | |
| |||
0 commit comments