Guard against drift between `plasterManifest.xml` and the `Invoke-Plaster` test stub
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- powershell
- Domain
- testing-qa
Research direction
Start by reading the stub in tests/Unit/Public/New-SampleModule.tests.ps1 and the parameter entries in Sampler/Templates/Sampler/plasterManifest.xml. Add the guard under tests/Unit/Public/, then run ./build.ps1 -Tasks test -PesterPath 'tests/Unit/Public/New-SampleModule.tests.ps1' -CodeCoverageThreshold 0; done means the test detects a missing stub parameter.
Written by the indexing model from the issue text.
Description
Problem description
PR #560 added unit tests in tests/Unit/Public/New-SampleModule.tests.ps1 that replace Invoke-Plaster with a hand-maintained stub listing every Plaster parameter statically. The stub is required because Invoke-Plaster declares manifest-driven parameters via dynamicparam, which Pester's auto-generated mock proxy cannot model.
When a new Use* toggle or parameter is added to Sampler/Templates/Sampler/plasterManifest.xml, the stub will silently drop it — $PSBoundParameters will not contain it and the tests will keep passing while real scaffolding behavior regresses.
Verbose logs
N/A
How to reproduce
- Add a new
<parameter name="UseSomething" ...>entry toSampler/Templates/Sampler/plasterManifest.xml. - Do not update the stub in
tests/Unit/Public/New-SampleModule.tests.ps1. - Run
./build.ps1 -Tasks test -PesterPath 'tests/Unit/Public/New-SampleModule.tests.ps1' -CodeCoverageThreshold 0. - Observe that tests pass even though the stub does not accept the new parameter.
Expected behavior
A test fails when the stub's param() block is out of sync with the parameters defined in plasterManifest.xml.
Current behavior
No such check exists; drift is silent.
Suggested solution
Add a lightweight guard test under tests/Unit/Public/ that:
- Parses
Sampler/Templates/Sampler/plasterManifest.xml. - Enumerates
<parameter name="...">nodes. - Asserts every name is present in
(Get-Command Invoke-Plaster).Parameters.KeyswithinInModuleScope.
Consider also documenting the stub pattern in .github/instructions/test-writing.instructions.md.
Operating system the target node is running
N/A
PowerShell version and build the target node is running
N/A
Module version used
Sampler Unreleased / post-#560.
- Dominant language
- PowerShell
- Stars
- 243
- Forks
- 46
- Avg merge
- 1h 41m
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from gaelcolas/Sampler
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
All issues in gaelcolas/Sampler
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100