Skip to content

fix: pem.test exit 1 on test failure#10250

Open
MarkAtwood wants to merge 1 commit intowolfSSL:masterfrom
MarkAtwood:fix/pem-test-exit-code
Open

fix: pem.test exit 1 on test failure#10250
MarkAtwood wants to merge 1 commit intowolfSSL:masterfrom
MarkAtwood:fix/pem-test-exit-code

Conversation

@MarkAtwood
Copy link
Copy Markdown

Summary

scripts/pem.test tracks TEST_FAIL_CNT and prints a FAILURES message when tests fail, but always exits 0 — making the script useless as an automated gate since test harnesses only see the exit code.

  • Add exit 1 after cleanup when TEST_FAIL_CNT != 0

Test plan

  • Run scripts/pem.test against a build where a test is expected to fail — confirm exit code is now 1
  • Run scripts/pem.test against a clean passing build — confirm exit code is still 0

/cc @douzzer @SparkiDev for review

Copilot AI review requested due to automatic review settings April 17, 2026 21:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Ensures scripts/pem.test returns a failing exit code when one or more tests fail, allowing CI/test harnesses to gate on the script’s result.

Changes:

  • Exit with status 1 after cleanup when TEST_FAIL_CNT is non-zero.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/pem.test
Comment on lines +460 to +462
if [ "$TEST_FAIL_CNT" != "0" ]; then
exit 1
fi
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

!= "0" performs a string comparison; since TEST_FAIL_CNT is a numeric counter, it’s more robust/idiomatic to use a numeric test (e.g., -ne 0). If TEST_FAIL_CNT can ever be empty/unset, consider defaulting it (e.g., ${TEST_FAIL_CNT:-0}) before the comparison to avoid test errors in stricter shells.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

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