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

Empty --spec parameter error message is misleading for Cypress developers #22328

Closed
sainthkh opened this issue Jun 15, 2022 · 4 comments
Closed
Labels
E2E Issue related to end-to-end testing stale no activity on this issue for a long period type: bug type: error message

Comments

@sainthkh
Copy link
Contributor

Current behavior

When you don't pass anything after --spec like yarn workspace @packages/launchpad cypress:run:e2e --spec, it shows the error message like below:

No version of Cypress is installed in: /home/sainthkh/.cache/Cypress/0.0.0-development/Cypress

Please reinstall Cypress by running: cypress install

----------

Cypress executable not found at: /home/sainthkh/.cache/Cypress/0.0.0-development/Cypress/Cypress

----------

Platform: linux-x64 (Ubuntu - 20.04)
Cypress Version: 0.0.0-development

Cypress is actually installed (or cached in CI). The --spec is empty. But the message is really misleading.

Desired behavior

Maybe, the message should be changed to No spec files provided. They should be provided after --spec argument.

Test code to reproduce

In our project root, yarn workspace @packages/launchpad cypress:run:e2e --spec

Cypress Version

10.1.0

Other

No response

@cypress-bot cypress-bot bot added the stage: investigating Someone from Cypress is looking into this label Jun 15, 2022
@marktnoonan
Copy link
Contributor

What's happening here seems to be a quirk of how we ensure that in the Cypress repo, we run in dev mode. This script runs when @packages/launchpad cypress:run:e2e is run.

The issue is not with the --spec flag as such. In a regular project the message is fine. npx cypress run --spec leads to this:

error: option '-s, --spec <spec>' argument missing

But within the cypress repo, that last flag ends up receiving --dev as the argument. I didn't look too closely, but something in the timing of when we push it seems to be an issue.

Swallowing the --dev flag means it no longer prevents the attempt to verify the Cypress binary for the version 0.0.0-development. There's nothing in the cache to verify at that path, since we aren't working with a binary that was installed, we are working with whatever the current code is in the branch being developed. So Cypress complains, correctly, that you don't have anything at that path. The same thing happens if you leave --browser at the end, for example, or any flag that needs an argument.

This definitely could be better, I'll route this to the team to improve at some point so that it works as expected when developing Cypress, just as is does when using a regular build. But at least for users of Cypress in other projects, this all seems to be working as expected.

@sainthkh sainthkh changed the title Empty --spec parameter error message is misleading. Empty --spec parameter error message is misleading for Cypress developers Jun 16, 2022
@sainthkh
Copy link
Contributor Author

@marktnoonan I added "for Cypress Developers" for clarity.

@cypress-bot cypress-bot bot added stage: routed to e2e-core and removed stage: investigating Someone from Cypress is looking into this stage: routed to e2e-core labels Jun 16, 2022
@marktnoonan marktnoonan removed their assignment Jun 21, 2022
@mschile mschile added triage and removed triage labels Aug 18, 2022
@nagash77 nagash77 added E2E Issue related to end-to-end testing and removed E2E-core labels Nov 8, 2022
@github-actions
Copy link
Contributor

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@github-actions github-actions bot added the stale no activity on this issue for a long period label May 12, 2023
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 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 stale no activity on this issue for a long period type: bug type: error message
Projects
None yet
Development

No branches or pull requests

6 participants