Skip to content

fix(command): give Aborted and NoTests an exit severity - #340

Merged
eddie-knight merged 4 commits into
privateerproj:mainfrom
Thanatos9404:fix/exit-severity-aborted-notests
Nov 11, 2026
Merged

eddie-knight merged 4 commits into
privateerproj:mainfrom
Thanatos9404:fix/exit-severity-aborted-notests

Conversation

@Thanatos9404

@Thanatos9404 Thanatos9404 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

exitSeverity had no entry for Aborted or NoTests, so both scored zero in mergeExitCode and a run whose only plugin aborted exited 0.

Aborted now sits between TestFail and BadUsage, as the issue suggests. NoTests goes just above TestPass, so a plugin that returns NoTests never reads as a pass, while a real TestFail from another plugin still wins. Happy to move it higher if you prefer.

A new test reads the exit code constants from package shared and fails if any lacks an entry or shares a severity.

Fixes #300

exitSeverity had no entry for Aborted or NoTests, so both scored the
map's zero value and merged as TestPass. A run whose only plugin
aborted therefore exited 0.

Aborted now ranks between TestFail and BadUsage. NoTests ranks just
above TestPass, so a plugin that evaluated nothing never reads as a
pass, while a real TestFail from another plugin still wins over it. A
new test reads the constants from shared/exitcodes.go and fails if any
of them has no entry or shares a severity with another.

Fixes privateerproj#300

Signed-off-by: Yashvardhan Thanvi <[email protected]>
@github-actions github-actions Bot added the fix label Oct 25, 2026

@jmeridth jmeridth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 (summary)

Thanks for taking this on, and for following the issue so closely. The ordering and the coverage test both look right. Two small comments inline, neither blocking. I'm fine with the NoTests placement as is.

Comment thread command/run.go Resolved
Comment thread command/run_test.go Resolved
@jmeridth
jmeridth requested a review from eddie-knight October 25, 2026 22:24
Thanatos9404 and others added 3 commits October 26, 2026 08:21
A pluginkit plugin whose suites are all NotRun still exits TestPass,
so the ranking only covers plugins that return NoTests themselves.

Signed-off-by: Yashvardhan Thanvi <[email protected]>
The coverage test parsed only shared/exitcodes.go, so an exit code
added to another file of the package would skip the check and merge as
TestPass. It now type-checks the const declarations of every non-test
file in shared.

Signed-off-by: Yashvardhan Thanvi <[email protected]>
@eddie-knight

Copy link
Copy Markdown
Contributor

Hey @Thanatos9404 — Your test revealed that we had this logic in the wrong place, or rather that the old place wasn't well suited anymore. Hugely appreciate you doing the work to reveal that. I pushed a commit to this PR moving the location of the logic and adjusting a bit while staying true to the heart of your proposal here.

Thanks!

@eddie-knight
eddie-knight merged commit c1cc06e into privateerproj:main Nov 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Aborted and NoTests are missing from exitSeverity, so an aborted-only run exits 0

3 participants