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

parallel-weights.json not taken into consideration when running cypress-parallel with -d and wildcard (*) #206

Open
andrei-ticudeanu-caphyon opened this issue Oct 16, 2024 · 0 comments

Comments

@andrei-ticudeanu-caphyon
Copy link

andrei-ticudeanu-caphyon commented Oct 16, 2024

When using cypress-parallel with a path containing * like in this example: "cy:parallel": "cypress-parallel -s cy:run -t 2 -d 'cypress\\e2e\\tst\\*.js'",, the getTestSuitePaths function from test-suite.js uses the getFilePathsByGlob function. This function returns the file list using the "/" path separator (cypress/e2e/tst/test_1.cy.js)

When the distributeTestsByWeight function is called, it compares (endsWith) the file lists above with the ones from the parallel-weights.json and it results in a map with all weights equal to 1. This occurs because in the parallel-weights.json file the paths are saved with backslash "\" ("cypress\\e2e\\tst\\test_1.cy.js") and the f.endsWith(spec) condition returns always false.

I noticed that if I change the command to "cy:parallel": "cypress-parallel -s cy:run -t 2 -d 'cypress\\e2e\\tst\\'",, then the code uses the deprecated version getFilePathsByPath but the weight file is considered and the file splitting is done correctly.

Is there any way that I can use the pattern version (*) so that the distributeTestsByWeight function works correctly and the files are split accordingly?

OS: Windows 10
Node: 20.9.0
Cypress: 13.12.0
cypress-parallel: 0.14.0

@andrei-ticudeanu-caphyon andrei-ticudeanu-caphyon changed the title parallel-weights.json not taken into consideration when running cypress-parallel with path using wildcard (*) parallel-weights.json not taken into consideration when running cypress-parallel with -d and wildcard (*) Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant