Skip to content

Revive or retire disabled test suites#2764

Merged
nohwnd merged 1 commit into
mainfrom
nohwnd-audit-skipped-tests
Jun 27, 2026
Merged

Revive or retire disabled test suites#2764
nohwnd merged 1 commit into
mainfrom
nohwnd-audit-skipped-tests

Conversation

@nohwnd

@nohwnd nohwnd commented Jun 27, 2026

Copy link
Copy Markdown
Member

Summary

A sweep for production-quality test hygiene turned up three .Tests.ps1 suites disabled with a top-level returnInvoke-Pester discovered them but ran zero tests, so they were silent dead weight. This revives the ones that still apply and retires the ones that don't.

Changes

  • Environment.Tests.ps1 — revived (9 pass / 1 Windows-only skip). The old suite relied on Mock, but Pester's internals call & $SafeCommands['Get-Variable'], which bypasses Mock. Rewrote it to override the $SafeCommands entry (faking PSVersionTable / IsWindows etc. and restoring in finally), and aligned with the PS <7Windows threshold from Remove code specifically for PS 2.0-5.0 #2735 (PS 6 is EOL).

  • Describe.Tests.ps1 — removed dead v4 half (3 live tests remain). The post-return block exercised DescribeImpl / New-PesterState -Path / EnterTestGroup, all long gone from src.

  • TestsRunningInCleanRunspace.Tests.ps1 — migrated then deleted. A Pester v4 Start-Job fossil (Set-TestInconclusive, Invoke-Pester -Strict, dash-less Should Be, v4 NUnit schema). I checked each scenario against Pester 6 behavior and migrated the genuinely-unique, still-valid ones into modern in-process tests in Pester.RSpec.ts.ps1:

    • Invoke-Pester swallows pipeline output from the system under test (with / without -PassThru)
    • It without a ScriptBlock fails the run
    • a test file with a syntax error fails the run without throwing

    Redundant scenarios (skip counts, PassThru counts, NUnit format, setup/teardown failure) were dropped as already covered elsewhere; the obsolete v4 "Strict mode" scenario was dropped outright.

  • SetupTeardown.Tests.ps1 — updated a stale comment that pointed at the deleted suite (now points to Pester.Runtime.ts.ps1).

Verification

  • Pester.RSpec.ts.ps1: 116/116 pass (including the 4 migrated tests)
  • Environment.Tests.ps1 + Describe.Tests.ps1: 12 pass / 1 skip / 0 fail
  • No dt focus-tests left behind; no dangling references to the deleted file.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Three .Tests.ps1 suites were disabled with a top-level `return`, so
Invoke-Pester discovered them but ran zero tests.

- Environment.Tests.ps1: revived. Replace obsolete Mock-based fakes with
  the $SafeCommands override pattern (Pester internals call
  & $SafeCommands['Get-Variable'], which bypasses Mock) and align with the
  PS <7 => Windows threshold from #2735.
- Describe.Tests.ps1: remove the dead Pester v4 second half that exercised
  DescribeImpl / New-PesterState -Path / EnterTestGroup, all removed from src.
- TestsRunningInCleanRunspace.Tests.ps1: delete this Pester v4 Start-Job
  fossil after migrating its still-unique scenarios (output swallowing,
  It-without-scriptblock, graceful syntax-error handling) into modern
  in-process tests in Pester.RSpec.ts.ps1.
- SetupTeardown.Tests.ps1: update a stale comment that referenced the
  deleted suite.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nohwnd nohwnd merged commit 4da66de into main Jun 27, 2026
13 checks passed
@nohwnd nohwnd deleted the nohwnd-audit-skipped-tests branch June 27, 2026 16:19
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.

1 participant