experiment: pass ALL secrets/variables into module tests#35
Closed
MariusStorhaug wants to merge 8 commits into
Closed
experiment: pass ALL secrets/variables into module tests#35MariusStorhaug wants to merge 8 commits into
MariusStorhaug wants to merge 8 commits into
Conversation
Point CI at PSModule/Process-PSModule@feat/import-testdata. Push a masked secret (TEST_SECRET) and a non-masked variable (TEST_VARIABLE) into the module test jobs via TestData, asserted in tests/Environment.Tests.ps1. Reorganize public functions into sections (Greetings/ with a named landing page, DateAndTime/ with an index.md landing page) to show documentation on the section nodes, leaving Get-PSModuleTest at the top level.
Adds an It block that Write-Hosts both values. GitHub Actions masks TEST_SECRET (registered via ::add-mask:: by Import-TestData) to *** in the log, while TEST_VARIABLE is printed verbatim - demonstrating that only the secrets map is masked.
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.
Per the GitHub Actions coding standard, uses: references are pinned to a full 40-character commit SHA with the human-readable version as a trailing comment. Replaces the v6.1.2 tag pin with its commit SHA (d4020f3).
Replaces the two hardcoded TestData fixtures with toJSON(secrets)/toJSON(vars) to dump every secret and variable, and rewrites the environment test to iterate and print every environment variable the job can see. Purpose: observe whether Import-TestData can enumerate a full dump (and how Actions masks secrets).
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
The raw toJSON(secrets) dump failed because Import-TestData rejects the auto-injected github_token (reserved GITHUB_ prefix). Add a Prep-TestData job that serializes all secrets/variables, removes github_token, and forwards the sanitized JSON as the TestData secret so the full enumeration can actually run.
…plicitly Proves the positive half: variables enumerate fine via toJSON(vars) (no github_token, not secret-blocked, passed inline), while secrets must be named explicitly.
Owner
Author
|
Experiment complete — findings recorded. Closing and deleting this throwaway branch. |
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.
Experiment (not for merge).
Changes the caller
TestDatainput to a full dump:and rewrites
tests/Environment.Tests.ps1to iterate and print every environment variable the job can see.Goal: observe whether
Import-TestDatacan enumerate a full dump, and how Actions masks secrets.Expectation:
Import-TestDatalikely rejects the auto-injectedgithub_token(reservedGITHUB_prefix), failing the "Expose caller-provided test data" step before tests run.