find-cypress-specs icon indicating copy to clipboard operation
find-cypress-specs copied to clipboard

Options from cypress-split are ignored

Open maguszoldik opened this issue 2 years ago • 1 comments

Hi. I use cypress-split with a config that should ignore some specs, using "ignoreTestFiles": ["*.hot-update.js", "**/some-ignored-dir/*.*"],, with a Cypress 7.7.0.

cypress-split auto detects my specs but keep some-ignored-dir/*, then Cypress ignore them at run time, leading to unbalanced runners (only 11 files are tested out of 24 after split).

Logging things, I found that cypress-split does a specs = getSpecs(config) which leads to find-cypress-specs

    // we might have resolved config object
    // passed from the "setupNode..." callback
    if ('testingType' in options) {
      type = options.testingType
      options = {
        version: options.version,
        [type]: {
          specPattern: options.specPattern,
          excludeSpecPattern: options.excludeSpecPattern,
        },
      }
    }

I dont clearly understand the reason of this part of the code, but it is the reason why findCypressSpecsV9 go totally wrong afterward and use its default instead of the original options.

Simply comment this part resolves my issue but i'm pretty sure its not the clever thing to do.

FYI, the command line used to run the tests:
npx cypress run --env split=true --browser chrome --config-file cypress-ci.json

maguszoldik avatar May 09 '23 14:05 maguszoldik

Ughh, I would not use such old Cypress version

bahmutov avatar Dec 22 '23 18:12 bahmutov