diff --git a/cypress/integration/1/[foo].js b/cypress/integration/1/[foo].js new file mode 100644 index 0000000..ce7d280 --- /dev/null +++ b/cypress/integration/1/[foo].js @@ -0,0 +1,3 @@ +describe('Spec filename contains glob characters', () => { + it('should run', () => { cy.wrap(true).should('eq', true) }) +}) diff --git a/cypress/integration/2/[foo].js b/cypress/integration/2/[foo].js new file mode 100644 index 0000000..37101e4 --- /dev/null +++ b/cypress/integration/2/[foo].js @@ -0,0 +1,3 @@ +describe('Spec filename contains glob', () => { + it('should run', () => { cy.wrap(true).should('eq', true) }) +}) diff --git a/cypress/integration/3/[foo].js b/cypress/integration/3/[foo].js new file mode 100644 index 0000000..37101e4 --- /dev/null +++ b/cypress/integration/3/[foo].js @@ -0,0 +1,3 @@ +describe('Spec filename contains glob', () => { + it('should run', () => { cy.wrap(true).should('eq', true) }) +}) diff --git a/cypress/integration/4/[foo].js b/cypress/integration/4/[foo].js new file mode 100644 index 0000000..37101e4 --- /dev/null +++ b/cypress/integration/4/[foo].js @@ -0,0 +1,3 @@ +describe('Spec filename contains glob', () => { + it('should run', () => { cy.wrap(true).should('eq', true) }) +}) diff --git a/cypress/integration/5/[foo].js b/cypress/integration/5/[foo].js new file mode 100644 index 0000000..37101e4 --- /dev/null +++ b/cypress/integration/5/[foo].js @@ -0,0 +1,3 @@ +describe('Spec filename contains glob', () => { + it('should run', () => { cy.wrap(true).should('eq', true) }) +}) diff --git a/cypress/integration/6/[foo].js b/cypress/integration/6/[foo].js new file mode 100644 index 0000000..37101e4 --- /dev/null +++ b/cypress/integration/6/[foo].js @@ -0,0 +1,3 @@ +describe('Spec filename contains glob', () => { + it('should run', () => { cy.wrap(true).should('eq', true) }) +}) diff --git a/lib/package-lock.json b/lib/package-lock.json index e5ec5f6..b276376 100644 --- a/lib/package-lock.json +++ b/lib/package-lock.json @@ -1,17 +1,19 @@ { "name": "cypress-parallel", - "version": "0.8.3", + "version": "0.9.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "cypress-parallel", - "version": "0.8.3", + "version": "0.9.0", "license": "MIT", "dependencies": { "cli-table3": "^0.6.0", + "colors": "^1.4.0", "cross-spawn": "^7.0.3", "fs-extra": "^10.0.0", + "glob-escape": "^0.0.2", "is-npm": "^5.0.0", "lodash.camelcase": "^4.3.0", "mocha": "^8.2.1", @@ -181,15 +183,6 @@ "colors": "^1.1.2" } }, - "node_modules/cli-table3/node_modules/colors": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", - "optional": true, - "engines": { - "node": ">=0.1.90" - } - }, "node_modules/cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -216,6 +209,14 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "node_modules/colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "engines": { + "node": ">=0.1.90" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -401,6 +402,14 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/glob-escape": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/glob-escape/-/glob-escape-0.0.2.tgz", + "integrity": "sha1-nCf3gh7RwTd1gvPv2VWOP2dWKO0=", + "engines": { + "node": ">= 0.10" + } + }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -1418,14 +1427,6 @@ "colors": "^1.1.2", "object-assign": "^4.1.0", "string-width": "^4.2.0" - }, - "dependencies": { - "colors": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", - "optional": true - } } }, "cliui": { @@ -1451,6 +1452,11 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==" + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1570,6 +1576,11 @@ "path-is-absolute": "^1.0.0" } }, + "glob-escape": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/glob-escape/-/glob-escape-0.0.2.tgz", + "integrity": "sha1-nCf3gh7RwTd1gvPv2VWOP2dWKO0=" + }, "glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", diff --git a/lib/package.json b/lib/package.json index b93b8b6..768e33b 100644 --- a/lib/package.json +++ b/lib/package.json @@ -26,11 +26,12 @@ "cli-table3": "^0.6.0", "colors": "^1.4.0", "cross-spawn": "^7.0.3", + "fs-extra": "^10.0.0", + "glob-escape": "^0.0.2", "is-npm": "^5.0.0", "lodash.camelcase": "^4.3.0", "mocha": "^8.2.1", - "yargs": "15.3.1", - "fs-extra": "^10.0.0" + "yargs": "15.3.1" }, "peerDependencies": { "cypress-multi-reporters": "^1.5.0" diff --git a/lib/thread.js b/lib/thread.js index 84919e9..b032d5f 100644 --- a/lib/thread.js +++ b/lib/thread.js @@ -3,6 +3,7 @@ const { isYarn } = require('is-npm'); const path = require('path'); const fs = require('fs'); const camelCase = require('lodash.camelcase'); +const globEscape = require('glob-escape'); const { settings } = require('./settings'); const { sleep } = require('./utility'); @@ -11,8 +12,8 @@ function getPackageManager() { const pckManager = isYarn ? 'yarn' : process.platform === 'win32' - ? 'npm.cmd' - : 'npm'; + ? 'npm.cmd' + : 'npm'; return pckManager; } @@ -49,7 +50,7 @@ function createReporterConfigFile(path) { } function createCommandArguments(thread) { - const specFiles = `'${thread.list.join(',')}'`; + const specFiles = `${thread.list.map(path => globEscape(path)).join(',')}`; const childOptions = [ 'run', `${settings.script}`, diff --git a/package.json b/package.json index 1d3d71b..8c2c154 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "start": "npm start --prefix demo-app", "cy:open": "cypress open", "cy:run": "cypress run --browser chrome --headless", - "cy:parallel": "node_modules/.bin/cypress-parallel -s cy:run -t 4 -d 'cypress/integration/1/*.js' -m false", + "cy:parallel": "node_modules/.bin/cypress-parallel -s cy:run -t 4 -d 'cypress/integration/1/*.js'", "cy:parallel:many": "node_modules/.bin/cypress-parallel -s cy:run -t 8 -d 'cypress/integration/**/*.js'", "cy:parallel:spec": "node_modules/.bin/cypress-parallel -s cy:run -t 2 -d cypress/integration/1 -r spec", "cy:parallel:junit": "node_modules/.bin/cypress-parallel -s cy:run -t 2 -d cypress/integration/1 -r mocha-junit-reporter -o 'mochaFile=demo-app/reporting/junit/e2e-junit-[hash].xml'",