cypress-split icon indicating copy to clipboard operation
cypress-split copied to clipboard

List of specs not supporting wildcards

Open SebeFromGermany opened this issue 1 year ago • 5 comments

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.

SebeFromGermany avatar Feb 20 '24 15:02 SebeFromGermany

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 avatar Apr 05 '24 00:04 jd-brennan

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'

jd-brennan avatar Apr 06 '24 00:04 jd-brennan

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

bahmutov avatar Apr 09 '24 18:04 bahmutov

@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

SebeFromGermany avatar Apr 11 '24 14:04 SebeFromGermany

@SebeFromGermany if this is still a problem, do you mind opening a PR with a fix?

bahmutov avatar Dec 16 '24 14:12 bahmutov