Skip to content
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

Exit codes for cli #24695

Open
ckocyigit opened this issue Nov 7, 2022 · 3 comments
Open

Exit codes for cli #24695

ckocyigit opened this issue Nov 7, 2022 · 3 comments
Labels
E2E Issue related to end-to-end testing Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. type: feature New feature that does not currently exist

Comments

@ckocyigit
Copy link

https://docs.cypress.io/guides/guides/command-line#Exit-code documents that cypress basically has three exit behaviours.

Cypress succeeds means exit code 0

Cypress fails (complete run failure) exit code 1

Cypress: Specs are failing means exit code is amount of specs failed

But what if just one spec failed.

You could not differentiate if the whole run just failed or just one spec based on the exit codes.

@ckocyigit
Copy link
Author

image

@emilyrohrbough emilyrohrbough transferred this issue from cypress-io/cypress-documentation Nov 15, 2022
@flotwig
Copy link
Contributor

flotwig commented Nov 16, 2022

We're following Mocha's behavior here: #3559

There's only so much data that can be communicated via an exit code, so there's not much we can do here. For detailed information about what passed/failed/crashed, you should use either the Junit Reporter or the Module API.

@spiltcoffee
Copy link

@flotwig I assume you meant this issue? mochajs/mocha#3559

Anyway, a related exit code issue due to this practice is that if you have a multiple of 256 failed tests, then Cypress inappropriately exits with an exit code of 0 in contexts where the exit code is only 8 bits (i.e. unix).

Mocha faced this issue previously (mochajs/mocha#2438) and resolved it by clamping to 255 if 255+ tests failed (mochajs/mocha#2445).

@nagash77 nagash77 added E2E Issue related to end-to-end testing Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. and removed routed-to-e2e labels Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E2E Issue related to end-to-end testing Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. type: feature New feature that does not currently exist
Projects
None yet
Development

No branches or pull requests

4 participants