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

--spec with glob splits filename at weird position #20794

Closed
ypresto opened this issue Mar 28, 2022 · 3 comments · Fixed by #20848
Closed

--spec with glob splits filename at weird position #20794

ypresto opened this issue Mar 28, 2022 · 3 comments · Fixed by #20848
Assignees

Comments

@ypresto
Copy link

ypresto commented Mar 28, 2022

Current behavior

When --spec option has glob [...] (even if escaped), cypress splits the argument at weird position, while it should be split by comma.

It is not only output text issue: specified spec files are actually not found by cypress even they are exists.

Desired behavior

No response

Test code to reproduce

Case 1: Split at middle of the filename

$ npx cypress run --spec 'cypress/integration/foo/bar/[baz]/test.ts,cypress/integration/foo/bar/[baz2]/test.ts,cypress/integration/foo3/bar/baz/test.ts,cypress/integration/foo4/bar/baz/foooooooooooooooo.ts'
Can't run because no spec files were found.

We searched for specs matching these glob patterns:

  > /path/to/project/e2e/cypress/integration/foo/bar/[baz]/test.ts
  > /path/to/project/e2e/cypress/integration/foo/bar/[baz2]/test.ts
  > /path/to/project/e2e/cypress/integration/foo3/bar/baz/test.ts,cypress/integration/foo4/bar/baz/foooooo
  > /path/to/project/e2e/oooooooooo.ts

Case 2: Does not split at comma

$ npx cypress run --spec 'cypress/integration/foo/bar/baz/test.ts,cypress/integration/foo/bar/[baz2]/test.ts,cypress/integration/foo3/bar/baz/test.ts,cypress/integration/foo4/bar/baz/foooooooooooooooo.ts'
Can't run because no spec files were found.

We searched for specs matching these glob patterns:

  > /path/to/project/e2e/cypress/integration/foo/bar/baz/test.ts,cypress/integration/foo/bar/[baz2]/test.ts
  > /path/to/project/e2e/cypress/integration/foo3/bar/baz/test.ts
  > /path/to/project/e2e/cypress/integration/foo4/bar/baz/foooooooooooooooo.ts

Case 3: Even when globs are escaped

$ npx cypress run --spec 'cypress/integration/foo/bar/\[baz\]/test.ts,cypress/integration/foo/bar/\[baz2\]/test.ts,cypress/integration/foo3/bar/baz/test.ts,cypress/integration/foo4/bar/baz/foooooooooooooooo.ts'
Can't run because no spec files were found.

We searched for specs matching these glob patterns:

  > /path/to/project/e2e/cypress/integration/foo/bar/\[baz\]/test.ts
  > /path/to/project/e2e/cypress/integration/foo/bar/\[baz2\]/test.ts
  > /path/to/project/e2e/cypress/integration/foo3/bar/baz/test.ts,cypress/integration/foo4/bar/baz/foooooooo
  > /path/to/project/e2e/oooooooo.ts

Working as expected when no glob patterns are specified:

$ npx cypress run --spec 'cypress/integration/foo/bar/baz/test.ts,cypress/integration/foo/bar/baz2/test.ts,cypress/integration/foo3/bar/baz/test.ts,cypress/integration/foo4/bar/baz/foooooooooooooooo.ts'
Can't run because no spec files were found.

We searched for specs matching these glob patterns:

  > /path/to/project/e2e/cypress/integration/foo/bar/baz/test.ts
  > /path/to/project/e2e/cypress/integration/foo/bar/baz2/test.ts
  > /path/to/project/e2e/cypress/integration/foo3/bar/baz/test.ts
  > /path/to/project/e2e/cypress/integration/foo4/bar/baz/foooooooooooooooo.ts

Cypress Version

9.5.2

Other

No response

@davidmunechika davidmunechika added cli stage: ready for work The issue is reproducible and in scope labels Mar 29, 2022
@davidmunechika
Copy link
Contributor

Thanks for opening this issue! I was able to reproduce the problem and we will work on getting a fix for this bug soon.

@davidmunechika davidmunechika self-assigned this Mar 30, 2022
@cypress-bot cypress-bot bot added stage: to do and removed stage: ready for work The issue is reproducible and in scope stage: to do labels Mar 30, 2022
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review stage: work in progress and removed stage: work in progress stage: needs review The PR code is done & tested, needs review labels Mar 30, 2022
@ypresto
Copy link
Author

ypresto commented Apr 11, 2022

Thank you for fixing it quickly 🎉

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Apr 11, 2022

Released in 9.5.4.

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

@cypress-bot cypress-bot bot removed the stage: needs review The PR code is done & tested, needs review label Apr 11, 2022
@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Apr 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants