Skip to content

Use a non-zero exit code if the tests failed#20878

Merged
timvandermeij merged 1 commit intomozilla:masterfrom
timvandermeij:exit-code
Mar 15, 2026
Merged

Use a non-zero exit code if the tests failed#20878
timvandermeij merged 1 commit intomozilla:masterfrom
timvandermeij:exit-code

Conversation

@timvandermeij
Copy link
Contributor

@timvandermeij timvandermeij commented Mar 15, 2026

The bots currently detect if the tests failed or not by checking the output text, but this is error-prone as it would break if the text gets changed (which is rather unexpected) and it's non-standard as usually processes report success/failure via their exit code.

This commit makes sure that the test process fails with a non-zero exit code if the tests failed, and a zero exit code otherwise. Note that we keep the same output text as before, so this change should not impact the bots, but it does form another step to unlock usage in GitHub Actions (which uses the exit code of commands to determine the status of the workflow run).

Related to #11851.

The bots currently detect if the tests failed or not by checking the
output text, but this is error-prone as it would break if the text gets
changed (which is rather unexpected) and it's non-standard as usually
processes report success/failure via their exit code.

This commit makes sure that the test process fails with a non-zero exit
code if the tests failed, and a zero exit code otherwise. Note that we
keep the same output text as before, so this change should not impact
the bots, but it does form another step to unlock usage in GitHub
Actions (which uses the exit code of commands to determine the status of
the workflow run).
@codecov-commenter
Copy link

codecov-commenter commented Mar 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.54%. Comparing base (3127492) to head (c798f88).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #20878      +/-   ##
==========================================
+ Coverage   62.51%   62.54%   +0.03%     
==========================================
  Files         173      173              
  Lines      121246   121246              
==========================================
+ Hits        75796    75833      +37     
+ Misses      45450    45413      -37     
Flag Coverage Δ
fonttest 7.66% <ø> (?)
unittestcli 62.51% <ø> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@timvandermeij
Copy link
Contributor Author

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @timvandermeij received. Current queue size: 1

Live output at: http://54.193.163.58:8877/228da838fee543f/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @timvandermeij received. Current queue size: 1

Live output at: http://54.241.84.105:8877/dd6903b8b2c85c7/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/dd6903b8b2c85c7/output.txt

Total script time: 45.34 mins

  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED
  different ref/snapshot: 1

Image differences available at: http://54.241.84.105:8877/dd6903b8b2c85c7/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/228da838fee543f/output.txt

Total script time: 70.30 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 1

Image differences available at: http://54.193.163.58:8877/228da838fee543f/reftest-analyzer.html#web=eq.log

Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you.

@timvandermeij timvandermeij merged commit 6ca9389 into mozilla:master Mar 15, 2026
12 checks passed
@timvandermeij timvandermeij deleted the exit-code branch March 15, 2026 18:45
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.

4 participants