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
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
distributeTestsByWeightfunction 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 thef.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 versiongetFilePathsByPathbut 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
distributeTestsByWeightfunction works correctly and the files are split accordingly?OS: Windows 10
Node: 20.9.0
Cypress: 13.12.0
cypress-parallel: 0.14.0