bahmutov / cypress-split

Split Cypress specs across parallel CI machines for speed
MIT License
199 stars 22 forks source link

List of specs not supporting wildcards #231

Open SebeFromGermany opened 4 months ago

SebeFromGermany commented 4 months ago

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:

Any help would be appreciated.

jd-brennan commented 3 months ago

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 commented 3 months ago

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 commented 2 months ago

I have tested the SPEC wildcards in https://github.com/bahmutov/cypress-split/pull/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 commented 2 months ago

@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. https://github.com/bahmutov/cypress-split/blob/e166a56c8195db699bd2040b29747253adf3002a/src/parse-inputs.js#L106