Golden.Tests.ps1 reaches into the module with InModuleScope Maester but never
imports it, so it passes only when another test file in the same run imported it
first. Run on its own it fails with "No modules named 'Maester' are currently
loaded".
Measured on main at 2d659e8:
Golden.Tests.ps1 alone, as it is: 12 passed, 1 failed
-> No modules named 'Maester' are currently loaded.
Golden.Tests.ps1 alone, with this: 13 passed, 0 failed
CI never saw it, because it runs every file in one invocation where something
else has already imported the module. The cost falls on a contributor who
follows AGENTS.md - add a built-in test, run the exporter, then run this file to
check the fixtures - and meets a failure that has nothing to do with the change
being made.
One line, in the form the other 98 test files use. It does not disturb a
combined run: this file together with AttributeReview, NativeTestAttributes and
Test-MtCaEmergencyAccessExists in a single Invoke-Pester gives 93 of 93.
Golden.Tests.ps1reaches into the module withInModuleScope Maesterbut never imports it, so it passes only when another test file in the same run imported it first. Run on its own, it fails:Measured on
mainat2d659e8, the file on its own through Pester 5.7.1:main, as it isCI never sees it, because it runs every file in one invocation where something else has already imported the module. The cost falls on a contributor doing what
AGENTS.mdsays to do — add a built-in test, runbuild/golden/Export-MtGoldenFixture.ps1, then run this file to check the fixtures — and meeting a failure that has nothing to do with their change. I ran into it while checking whether something of mine had broken the fixtures; it had not.One line, in the form the other 98 test files use. It does not disturb a combined run: this file together with
AttributeReview,NativeTestAttributesandTest-MtCaEmergencyAccessExistsin a singleInvoke-Pestergives 93 of 93.The red
build-validation (ubuntu-latest)this will show ismain's, not this change: four tests fail there today, and #2795 and #2797 between them account for all four.Summary by CodeRabbit