Commit f85f512
feat: make Help tests runnable standalone via Set-BuildEnvironment
tests/Help.tests.ps1 bootstraps the build via Invoke-psake when
$Env:BHBuildOutput is unset, but build.psake.ps1's properties block
needs BuildHelpers vars (BHProjectName, BHPSModuleManifest) that are only
populated by ./build.ps1 before psake runs. Running the Help tests in
isolation (e.g. Invoke-Pester tests/Help.tests.ps1 from an editor)
bypasses that, leaving the vars empty and the standalone build broken.
Call Set-BuildEnvironment inside the existing bootstrap guard in both
BeforeDiscovery and BeforeAll so the vars are populated before psake is
invoked. The guard only fires when BHBuildOutput is unset, so there is no
effect when tests run via ./build.ps1 or in CI; Set-BuildEnvironment
-Force is idempotent.
Surfaced by a cross-repo audit against a consumer module
(tablackburn/PlexAutomationToolkit) that already carried this fix locally.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 329ca92 commit f85f512
2 files changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
| |||
99 | 105 | | |
100 | 106 | | |
101 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
102 | 114 | | |
103 | 115 | | |
104 | 116 | | |
| |||
0 commit comments