🪲 [Fix]: Test data reaches module tests in every consumer repository#377
Open
Marius Storhaug (MariusStorhaug) wants to merge 3 commits into
Open
🪲 [Fix]: Test data reaches module tests in every consumer repository#377Marius Storhaug (MariusStorhaug) wants to merge 3 commits into
Marius Storhaug (MariusStorhaug) wants to merge 3 commits into
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
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.