bahmutov / cypress-split

Split Cypress specs across parallel CI machines for speed
MIT License
212 stars 24 forks source link

Splitting component tests leads to build errors #218

Closed alexey-tikhonok closed 7 months ago

alexey-tikhonok commented 8 months ago

Hi, thanks for making such a great package.

cypress: 12.7.0 cypress-split: 1.19.0 command in my project: npm run cy:run

I tried to implement splitting for angular component tests and all my attempts failed, so I created a repository with a code based on your examples to provide you with a reproducible example.

There are some webpack-related errors:

image image

And without splitting there are no errors:

image

bahmutov commented 7 months ago

Hmm, it needs the specs to be relative to the project, ughh, I need to think about and experiment with other situations. Right now it returns all absolute filenames

cypressSplit(on, config);
// config.specPattern
// has a list of absolute spec filenames 

In your case, it seems that it only works if the config.specPattern is relative filenames.

bahmutov commented 7 months ago

Ok, I think the simplest solution is to transform the specs to relative form, then your project works. I added the code example to the README, see it https://github.com/bahmutov/cypress-split?tab=readme-ov-file#relative-specs-output