Skip to content

Modernize release tests and remove dead publish tooling#2909

Merged
nohwnd merged 4 commits into
pester:mainfrom
nohwnd:nohwnd-update-release-tests
Jul 19, 2026
Merged

Modernize release tests and remove dead publish tooling#2909
nohwnd merged 4 commits into
pester:mainfrom
nohwnd:nohwnd-update-release-tests

Conversation

@nohwnd

@nohwnd nohwnd commented Jul 19, 2026

Copy link
Copy Markdown
Member

Fix #2877

The VersionChecks and StyleRules tests only ran through publish/testRelease.ps1, and nothing calls that script anymore. publish/release.ps1 runs test.ps1, testRelease.ps1 imported a publish/Pester.psd1 that does not exist, and the version check compared against a CHANGELOG.md we removed back in 2020.

Changes

  • Delete publish/testRelease.ps1.
  • Rewrite the manifest checks in tst/Pester.Tests.ps1 with BeforeAll instead of the old $script: state, and drop the CHANGELOG.md checks. They run in CI now (valid manifest, name, guid).
  • Remove the trailing-whitespace/tab/newline style rules. PSScriptAnalyzer already flags those on src/ in the code-analysis workflow, and I don't want a formatting gate in the test run.
  • Keep the module packaging check (Install-PSResource Pester shows installation path warning #2826) and run it in test.ps1 instead of only through the dead release script.
  • Remove the if ($PSVersionTable.PSVersion.Major -ge 3) PSv2 guard.
  • While cleaning up, remove more dead v4-era publish tooling that nothing calls: buildNugetPackage.ps1 (derived the version from a git tag), getNugetExe.ps1, and publish/vendor (a vendored nuget.exe and a psake packages.config). The current build.ps1/release.ps1 use dotnet and nuget from PATH.

No release-time version gate. The tag is created when the draft release is published, after the automated release runs, so HEAD is not tagged when release.ps1 runs. release.ps1 already derives the version from the manifest, not a tag, so it is unchanged.

Verification

./test.ps1 -File tst/Pester.Tests.ps1 -NoBuild -SkipPTests on a clean build: 29 passed. Green on all CI legs including Windows PowerShell 5.1 on the prior push.

Heads-up: #2875 also edits tst/Pester.Tests.ps1 (assertion migration), so one of the two will need a rebase.

🤖

@nohwnd
nohwnd force-pushed the nohwnd-update-release-tests branch from fa90edc to 6172453 Compare July 19, 2026 07:37
Fix pester#2877

The VersionChecks and StyleRules tests only ran through
publish/testRelease.ps1, and nothing calls that script anymore.
publish/release.ps1 runs test.ps1, testRelease.ps1 imported a
publish/Pester.psd1 that does not exist, and the version check compared
against a CHANGELOG.md we removed in 2020.

- Delete publish/testRelease.ps1.
- Rewrite the manifest checks with BeforeAll/BeforeDiscovery instead of
  the old $script: state, and drop the CHANGELOG.md checks.
- Keep the release-only version and tag check, but guard it with -Skip
  unless HEAD is a tagged release commit.
- Make release.ps1 fetch the tags and require HEAD to be on a release
  tag before running the tests. The publish pipeline can check out a
  shallow clone with no tags, and then the version check would silently
  skip and we would publish without it. Now it either runs or the
  release stops with a clear message.
- Remove the trailing-whitespace/tab/newline style rules. I don't want a
  formatting gate in CI, and PSScriptAnalyzer already flags these on src/
  in the code-analysis workflow.
- Keep the module packaging check (issue pester#2826) and run it in test.ps1
  instead of only through the dead release script.
- Remove the PSv2 (PSVersion -ge 3) guard.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@nohwnd
nohwnd force-pushed the nohwnd-update-release-tests branch from 6172453 to c01f303 Compare July 19, 2026 07:44
nohwnd added 2 commits July 19, 2026 10:02
Join-Path with three path arguments is PowerShell 7+ only. On 5.1 it
throws "A positional parameter cannot be found that accepts argument
'.git'" and fails discovery of the whole file. Nest the two calls
instead, which works on both.

🤖
The version check compared the module version against a git tag on HEAD,
and the release.ps1 guard required HEAD to be on a tag. But the tag is
created when the draft GitHub release is published, after the automated
release runs on CI, so at release time HEAD is not tagged. The guard
would have blocked every release, and the check could never run. Remove
both, and revert release.ps1.

The manifest validity and module packaging checks stay and run in CI.
release.ps1 already derives the version from the manifest, not a tag, so
it needs no tag at all.

🤖
@nohwnd
nohwnd enabled auto-merge (squash) July 19, 2026 08:37
buildNugetPackage.ps1 (which derived the version from a git tag),
getNugetExe.ps1, and publish/vendor (a vendored nuget.exe and a psake
packages.config) are all leftovers from the old build. Nothing calls
them; build.ps1 and release.ps1 use dotnet and nuget from PATH.

🤖
@nohwnd nohwnd changed the title Modernize release tests, remove unused testRelease.ps1 Modernize release tests and remove dead publish tooling Jul 19, 2026
@nohwnd
nohwnd merged commit 909a892 into pester:main Jul 19, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update and verify release tests

1 participant