Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ own `CHANGELOG.md` (generated from `CHANGELOG.template.md` during init).

- "Repository secrets" section in `README.md` documenting the GitHub Actions secrets the bundled workflows expect (`PSGALLERY_API_KEY`, `CODECOV_TOKEN`, `GITGUARDIAN_API_KEY`) — required vs. optional, source, and failure mode when missing.
- `Initialize-Template.ps1` now mentions configuring GitHub repository secrets in its post-init "Next steps" output, between the build-test step and the first push.
- `tests/Help.tests.ps1` now calls `Set-BuildEnvironment` inside its build-bootstrap guard (both `BeforeDiscovery` and `BeforeAll`) so the Help tests can run standalone — e.g. `Invoke-Pester tests/Help.tests.ps1` directly from an editor — without first running `./build.ps1`. The call is skipped entirely when tests run through the build pipeline (the guard only fires when `BHBuildOutput` is unset), and `Set-BuildEnvironment -Force` is idempotent, so there is no effect on CI or `./build.ps1` runs.

### Changed

Expand Down
12 changes: 12 additions & 0 deletions tests/Help.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ BeforeDiscovery {
# Check if the BHBuildOutput environment variable exists to determine if this test is running in a psake
# build or not. If it does not exist, it is not running in a psake build, so build the module.
if ($null -eq $Env:BHBuildOutput) {
# Populate BuildHelpers env vars so build.psake.ps1's properties block has
# the values it needs (BHPSModuleManifest, BHProjectName). When running via
# ./build.ps1 this happens before psake; running tests in isolation bypasses
# that, so we do it here. Set-BuildEnvironment is idempotent and -Force keeps
# it from erroring if the vars are already set.
Set-BuildEnvironment -Path (Split-Path -Path $PSScriptRoot -Parent) -Force
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
$buildFilePath = Join-Path -Path $PSScriptRoot -ChildPath '..\build.psake.ps1'
$invokePsakeParameters = @{
TaskList = 'Build'
Expand Down Expand Up @@ -99,6 +105,12 @@ BeforeAll {
# Check if the BHBuildOutput environment variable exists to determine if this test is running in a psake
# build or not. If it does not exist, it is not running in a psake build, so build the module.
if ($null -eq $Env:BHBuildOutput) {
# Populate BuildHelpers env vars so build.psake.ps1's properties block has
# the values it needs (BHPSModuleManifest, BHProjectName). When running via
# ./build.ps1 this happens before psake; running tests in isolation bypasses
# that, so we do it here. Set-BuildEnvironment is idempotent and -Force keeps
# it from erroring if the vars are already set.
Set-BuildEnvironment -Path (Split-Path -Path $PSScriptRoot -Parent) -Force
$buildFilePath = Join-Path -Path $PSScriptRoot -ChildPath '..\build.psake.ps1'
$invokePsakeParameters = @{
TaskList = 'Build'
Expand Down
Loading