-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat: --posix-exit-codes cli flag in run mode
#32609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
--posix-exit-codes cli flag in run mode
cypress
|
||||||||||||||||||||||||||||
| Project |
cypress
|
| Branch Review |
feat-32605-posix-exit-codes
|
| Run status |
|
| Run duration | 09m 04s |
| Commit |
|
| Committer | Cacie Prins |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
694
|
|
|
0
|
|
|
130
|
| View all changes introduced in this branch ↗︎ | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cacieprins I'm not sure how to mention this, but this also fixes a bug where if you opt into this - then tests with a number of failures that are a multiple of 256 will now properly send an exit code that will fail instead of exitCode=0. Maybe another line item in the bugfixes????
Makes sense! posix exit codes are generally 8 bits; most shells handle exit codes >255 as modulo 256. |
Co-authored-by: Jennifer Shehane <[email protected]>
Co-authored-by: Jennifer Shehane <[email protected]>
|
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
--posix-exit-codesflag for run/record mode #32605Additional details
Steps to test
As in the added system test,
cypress run --posix-exit-codesagainst a spec with multiple test failures; assert that the exit code is 1 rather than the number of tests that fail.How has the user experience changed?
PR Tasks
cypress-documentation? docs: adds --posix-exit-codes cli flag for run mode cypress-documentation#6284type definitions?Note
Adds
--posix-exit-codestocypress runand plumbs it through CLI, server, and types so runs exit 1 on any failures (0 on success), with tests and changelog updates.--posix-exit-codesflag and help text incli/lib/cli.tsand plumb option viacli/lib/exec/run.tsandcli/lib/util.ts(posixExitCodes).packages/server/lib/cypress.ts, ifoptions.posixExitCodesis set, exit1whenresults.totalFailed > 0, else0.packages/server/lib/util/args.js(allow list + alias forposix-exit-codes).posixExitCodestocli/types/cypress-npm-api.d.tsandpackages/types/src/modeOptions.ts.system-tests/test/posix_exit_codes_spec.tsvalidating exit codes; add pass-through insystem-tests/lib/system-tests.ts.cli/CHANGELOG.mdwith new feature entry.Written by Cursor Bugbot for commit 4696ca3. This will update automatically on new commits. Configure here.