Skip to content

Set LASTEXITCODE when Invoke-Pester fails internally - #3020

Merged
nohwnd merged 1 commit into
pester:mainfrom
pathei-kosmos:fix/invoke-pester-internal-exit-code
Sep 5, 2026
Merged

Set LASTEXITCODE when Invoke-Pester fails internally#3020
nohwnd merged 1 commit into
pester:mainfrom
pathei-kosmos:fix/invoke-pester-internal-exit-code

Conversation

@pathei-kosmos

Copy link
Copy Markdown
Contributor

Invoke-Pester could overwrite the exit status of an internal error with $null when the run was not created yet, or with 0 when a plugin failed after an otherwise successful run.

This change tracks the process exit code separately from the test failure count so internal errors keep the existing -1 exit code without changing how test failures are reported.

Regression tests cover both failure paths.

@codecov

codecov Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@b6eaa72). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3020   +/-   ##
=======================================
  Coverage        ?   91.44%           
=======================================
  Files           ?        2           
  Lines           ?     8354           
  Branches        ?        0           
=======================================
  Hits            ?     7639           
  Misses          ?      715           
  Partials        ?        0           
Flag Coverage Δ
ps51-windows-2022 90.89% <ø> (?)
ps51-windows-latest 90.89% <ø> (?)
ps7-macos-14 90.30% <ø> (?)
ps7-macos-latest 90.30% <ø> (?)
ps7-ubuntu-2204 90.31% <ø> (?)
ps7-ubuntu-latest 90.31% <ø> (?)
ps7-windows-2022 90.98% <ø> (?)
ps7-windows-latest 90.98% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nohwnd

nohwnd commented Sep 5, 2026

Copy link
Copy Markdown
Member

Ty!

@nohwnd
nohwnd merged commit 605bb99 into pester:main Sep 5, 2026
22 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.

2 participants