Skip to content

Conversation

cacieprins
Copy link
Contributor

Adds --posix-exit-codes flag, which disables exiting with the number of tests fail. This is preliminary to adding a custom (but compliant) exit code for terminal cloud API failures during recording or parallel runs.

See: cypress-io/cypress#32485

Copy link

cypress bot commented Sep 30, 2025

cypress-documentation    Run #693

Run Properties:  status check passed Passed #693  •  git commit bb8c67b515: formatting
Project cypress-documentation
Branch Review feat/posix-exit-codes
Run status status check passed Passed #693
Run duration 04m 24s
Commit git commit bb8c67b515: formatting
Committer Cacie Prins
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 309
View all changes introduced in this branch ↗︎
UI Coverage  10.86%
  Untested elements 2482  
  Tested elements 3  
Accessibility  97.21%
  Failed rules  1 critical   3 serious   4 moderate   0 minor
  Failed elements 28  

@MikeMcC399

This comment was marked as resolved.

@cacieprins
Copy link
Contributor Author

Please add what the default exit code contains when the option --posix-exit-codes is not used. This does not appear to be documented anywhere that I could find.

This is the default behavior as described in the previous two paragraphs. We are considering whether or not to modify the default behavior to align to posix standards as a breaking change in a later release.

Comment on lines 443 to 450
#### `cypress run --posix-exit-codes` {#cypress-run-posix-exit-codes}
Exit with POSIX exit code of 1 when there are test failures or if Cypress could not run.
```shell
cypress run --posix-exit-codes
```
Copy link
Contributor

@MikeMcC399 MikeMcC399 Sep 30, 2025

Choose a reason for hiding this comment

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

Maybe cross-link here to the section #Exit-code?

I completely missed this section when I glanced at the change 🤭

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea! Updated here 524b211

Comment on lines 636 to 640
...
```
```text
## print exit code on Mac or Linux
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
...
```
```text
## print exit code on Mac or Linux
...
## print exit code on Mac or Linux

Merge into one code block like the other examples above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍


## 15.4.0

_Released 9/30/2025_
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
_Released 9/30/2025_
_Released 10/7/2025_

| `--no-runner-ui` | [Hides the Cypress Runner UI](#cypress-run-no-runner-ui) |
| `--parallel` | [Run recorded specs in parallel across multiple machines](#cypress-run-parallel) |
| `--port`,`-p` | [Override default port](#cypress-run-port-lt-port-gt) |
| `--posix-exit-codes` | [Exit with a POSIX-compliant exit code](#cypress-run-posix-exit-codes) rather than the number of failed tests. |
Copy link
Member

Choose a reason for hiding this comment

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

This option needs to be added to the Module API doc: https://deploy-preview-6284--cypress-docs.netlify.app/app/references/module-api

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.

4 participants