🪲 [Fix]: Test data reaches module tests in every consumer repository#377
Merged
Conversation
Replace the caller-shipped ./.github/scripts/Expose-TestData.ps1 with a call to Import-TestData, which is provided by PSModule/Install-PSModuleHelpers. All three ModuleLocal workflows (BeforeAll/Test/AfterAll) now install the helpers and run Import-TestData to expose the caller's secrets/variables to the test jobs; BeforeAll/AfterAll take the Install-PSModuleHelpers dependency they previously lacked. The helpers ref is temporarily @feat/import-testdata for end-to-end testing.
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
July 10, 2026 20:16
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the ModuleLocal reusable workflows to expose caller-provided TestData by installing PSModule/Install-PSModuleHelpers and running its new Import-TestData command, replacing the previously caller-shipped .github/scripts/Expose-TestData.ps1 script. This centralizes the logic so consumer repos no longer need to include the script for ModuleLocal jobs to work.
Changes:
- Replace
.github/scripts/Expose-TestData.ps1usage withImport-TestDatain ModuleLocal workflows after installingInstall-PSModuleHelpers. - Add the missing
Install-PSModuleHelpersdependency toBeforeAll-ModuleLocal.ymlandAfterAll-ModuleLocal.yml. - Update README documentation and remove the now-unused PowerShell script.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates documentation to describe the new Import-TestData-based approach via Install-PSModuleHelpers. |
| .github/workflows/Test-ModuleLocal.yml | Installs helpers and calls Import-TestData instead of the deleted script. |
| .github/workflows/BeforeAll-ModuleLocal.yml | Adds helpers install step and switches to Import-TestData. |
| .github/workflows/AfterAll-ModuleLocal.yml | Adds helpers install step and switches to Import-TestData. |
| .github/scripts/Expose-TestData.ps1 | Removes the old caller-shipped implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Temporarily reference PSModule/Resolve-PSModuleVersion@feat/always-evaluate-version-labels so the pipeline previews the label-driven bump (e.g. minor) even on a pull_request event. Pin to a released SHA before merge.
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
July 10, 2026 20:51
View session
6 tasks
…v1.1.4 Replaces the temporary E2E branch refs with released commit SHAs now that Import-TestData (IPH v1.0.9) and the always-evaluate-labels fix (Resolve v1.1.4) are released. Also bumps Build-Site's Install-PSModuleHelpers pin to v1.0.9 so the action is uniform across the repo.
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
July 10, 2026 22:12
View session
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
July 10, 2026 22:17
View session
Marius Storhaug (MariusStorhaug)
added a commit
to MariusStorhaug/MariusTestModule
that referenced
this pull request
Jul 11, 2026
The Import-TestData plumbing and always-evaluate-version-labels fix are now released in Process-PSModule v6.1.2 (via PSModule/Process-PSModule#377, IPH v1.0.9 + Resolve-PSModuleVersion v1.1.4), so the temporary feat/import-testdata branch ref is replaced with the released tag.
Marius Storhaug (MariusStorhaug)
added a commit
to MariusStorhaug/MariusTestModule
that referenced
this pull request
Jul 11, 2026
End-to-end test of the TestData plumbing fix, exercised through this module **without merging** the underlying changes. ## Wiring - CI calls `PSModule/Process-PSModule/.github/workflows/workflow.yml@feat/import-testdata` (PR PSModule/Process-PSModule#377), which installs `PSModule/Install-PSModuleHelpers@feat/import-testdata` (PR PSModule/Install-PSModuleHelpers#20) and runs its new `Import-TestData` command. ## What to observe - **Secrets + variables pushed into the tests** — the calling workflow passes a `TestData` object with a `secrets` map (`TEST_SECRET`, masked in logs) and a `variables` map (`TEST_VARIABLE`, not masked). `tests/Environment.Tests.ps1` asserts both arrive with their exact fixture values inside the module test job. - **(A) Versioning** — this PR is labelled `Minor`; the pipeline computes the next version accordingly. - **(B) Documentation hierarchy** — public functions are grouped into sections with landing pages on the section nodes: - `Greetings/` (landing page from `Greetings.md`) → `Get-Greeting` - `DateAndTime/` (landing page from `index.md`) → `Get-CurrentDateTime` - `Get-PSModuleTest` stays at the top level > Throwaway E2E harness — not intended to merge. --------- Co-authored-by: Marius Storhaug <Marius.Storhaug@dnb.no>
Marius Storhaug (MariusStorhaug)
added a commit
to PSModule/Template-PSModule
that referenced
this pull request
Jul 11, 2026
… (index.md + folder-named) (#27) Two example command groups demonstrate both supported ways to give a command group its documentation section landing page. `IndexSection` provides its landing page as `index.md`; `NamedSection` provides its landing page as a file named after the folder (`NamedSection.md`). Document-PSModule renders either overview page as the group's section landing page, so each group appears at `Functions/<Group>/` in the navigation of the published GitHub Pages site. - Demonstrates PSModule/Process-PSModule#372 (group overview pages become section landing pages) - Adopts PSModule/Process-PSModule#377 (caller-provided TestData reaches module tests in consumer repositories) ## New: Two command groups showcasing both landing-page conventions - `IndexSection/` — landing page from `index.md`, with `Get-IndexSectionTest`. - `NamedSection/` — landing page from the folder-named `NamedSection.md`, with `Get-NamedSectionTest`. Each renders as its group's section landing page (`Functions/IndexSection/` and `Functions/NamedSection/`) in the docs navigation. ## Technical Details - Adds `src/functions/public/IndexSection/{index.md, Get-IndexSectionTest.ps1}` and `src/functions/public/NamedSection/{NamedSection.md, Get-NamedSectionTest.ps1}`; both functions mirror the existing `*-PSModuleTest` shape and return `Hello, <Name>!`. - Adds `It` blocks for `Get-IndexSectionTest` and `Get-NamedSectionTest` in `tests/PSModuleTest.Tests.ps1`. - Generated docs place each group overview at `<Group>/index.md`; the rendered site exposes `Functions/IndexSection/index.html` and `Functions/NamedSection/index.html`. - Bumps the Process-PSModule pin (`v6.1.1` → `v6.1.2`) to adopt the fix that exposes caller-provided `TestData` to the module test jobs, keeping the module test matrix green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
TestDatasecret introduced in v6.0.0.Fixed: Test data now reaches module tests in consumer repositories
The
TestDatasecret (a single-line JSON object ofsecretsandvariables) 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 theImport-TestDatacommand, 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
TestDatatoworkflow.yml(added in v6.0.0), so no migration is required: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
Minorpreviews the correct next minor version instead of defaulting to a patch prerelease. This is picked up by adoptingResolve-PSModuleVersionv1.1.4.Technical Details
.github/scripts/Expose-TestData.ps1(138 lines); the exposure logic moved into the sharedPSModule/Install-PSModuleHelpersmodule as theImport-TestDatacommand, so it no longer has to be checked out from the caller's repository.BeforeAll-ModuleLocal.yml,Test-ModuleLocal.yml, andAfterAll-ModuleLocal.ymleach now installPSModule/Install-PSModuleHelpers@v1.0.9and runImport-TestData(envPSMODULE_TEST_DATA: ${{ secrets.TestData }}) in place of the deleted script.Plan.yml:PSModule/Resolve-PSModuleVersionpinned to v1.1.4, which contains the always-evaluate-labels fix.Build-Site.yml:Install-PSModuleHelpersbumped v1.0.8 → v1.0.9 so the action resolves to a single version across the repo.README.mddocuments that test data is exposed throughInstall-PSModuleHelpers/Import-TestData.8bfb84d557755c67d9b5643efe573bdcae4c1a4a, Resolve v1.1.4 =8d1dac7f326a45ba08060c1e24a5dd6f6f00b3ab); actionlint is clean.