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

Argument parsing crashes badly if passing "spec: {}" #3957

Closed
bahmutov opened this issue Apr 12, 2019 · 6 comments · Fixed by #18312
Closed

Argument parsing crashes badly if passing "spec: {}" #3957

bahmutov opened this issue Apr 12, 2019 · 6 comments · Fixed by #18312
Assignees
Labels
good first issue Good for newcomers pkg/server This is due to an issue in the packages/server directory type: user experience Improvements needed for UX

Comments

@bahmutov
Copy link
Contributor

3.2.0

Crash Cypress by using npx cypress run --spec {}

Screen Shot 2019-04-12 at 9 34 33 AM

Same using NPM module

const cypress = require('cypress')
cypress.run({
  // this works fine
  // spec: 'cypress/integration/spec.js'
  // this crashes badly - hanging Cypress
  spec: {}

  /*
    this exits because no specs were found
    Can't run because no spec files were found.
    We searched for any files matching this glob pattern:
  */
  // spec: []
})

I have created example in cypress-io/cypress-test-tiny#44

@bahmutov bahmutov added the pkg/server This is due to an issue in the packages/server directory label Apr 12, 2019
@bahmutov
Copy link
Contributor Author

On CI it shows the error message but keeps hanging https://circleci.com/gh/cypress-io/cypress-test-tiny/2120

A JavaScript error occurred in the main process
Uncaught Exception:
TypeError: strToArray(...).map is not a function
    at Object.toObject (/root/.cache/Cypress/3.2.0/Cypress/resources/app/packages/server/lib/util/args.js:221:39)
    at Object.start (/root/.cache/Cypress/3.2.0/Cypress/resources/app/packages/server/lib/cypress.js:70:40)
    at Object.<anonymous> (/root/.cache/Cypress/3.2.0/Cypress/resources/app/packages/server/index.js:21:43)
    at Object.<anonymous> (/root/.cache/Cypress/3.2.0/Cypress/resources/app/packages/server/index.js:23:3)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)

@bahmutov
Copy link
Contributor Author

cannot trust those users like me, defensive programming

@jennifer-shehane jennifer-shehane added the good first issue Good for newcomers label Apr 24, 2019
@cypress-bot cypress-bot bot added the stage: ready for work The issue is reproducible and in scope label Apr 24, 2019
@jennifer-shehane jennifer-shehane added the type: user experience Improvements needed for UX label Apr 24, 2019
@ivanprotsykfreetour
Copy link

had this issue using a glob pattern in package.json
"cy:run:local": "cypress run -spec \"cypress/integration/!(examples)**/*.spec.js\""

@duncdrum
Copy link

yup running into this on travis as well. Funnily only for pull-request builds. We have CI configured to run different specs on different major versions via ENV variables.
You can see the expected result of a commit in my fork yet in the Pull-request for that commit cypress hangs.

@saharshMMC
Copy link

saharshMMC commented Sep 28, 2021

I am also facing it.
Running in GitHub actions, a single spec file for testing and then uploading screenshots and videos to artifacts.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 11, 2021

Released in 8.6.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v8.6.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Oct 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers pkg/server This is due to an issue in the packages/server directory type: user experience Improvements needed for UX
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants