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

List of specs not supporting wildcards #231

Open
SebeFromGermany opened this issue Feb 20, 2024 · 4 comments
Open

List of specs not supporting wildcards #231

SebeFromGermany opened this issue Feb 20, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@SebeFromGermany
Copy link

I'm having an issue with the following command:
$ SPEC="cypress\folder1\**\*.spec.ts, cypress\folder2\**\*.spec.ts" npx cypress run --env split=1,splitIndex1=1

The command is not working as expected. It seems to skip all files, stating that no files were found. I'm not sure if I'm doing something wrong or if it's not supported to use wildcards in the list of specs.

Additional information:

  • Cypress version: 12.10.0
  • Cypress-Split version: 1.20.1
  • Operating System: Windows 10 22H2

Any help would be appreciated.

@jd-brennan
Copy link

I ran into this too. I'm not sure how it's supposed to work. Is the cyress arg -spec supposed to show up in the config object? Might be that config object value for spec is not a string, but an object with two strings.

@jd-brennan
Copy link

I ran into this too. I'm not sure how it's supposed to work. Is the cyress arg -spec supposed to show up in the config object? Might be that config object value for spec is not a string, but an object with two strings.

I fixed my issue by moving spec to the env:

cypress run --env 'spec=cypress/integration/local/**/*.js'

@bahmutov bahmutov added the bug Something isn't working label Apr 9, 2024
@bahmutov
Copy link
Owner

bahmutov commented Apr 9, 2024

I have tested the SPEC wildcards in #260 and they work on Mac and Linux. You could try debugging it by running with DEBUG=cypress-split variable to see the debug output

@SebeFromGermany
Copy link
Author

@bahmutov The issue appears to be related to the use of backslashes in the spec filter. When forward slashes are used, cypress-split functions correctly. This seems to be a problem unique to Windows. A potential solution could be to implement path.posix.resolve to ensure that the type of slashes used does not cause any issues.

return path.resolve(specFilename)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants