Skip to content

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

Open
@andrei-ticudeanu-caphyon

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions