Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/workers.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ const createWorkerObjects = (testGroups, config, testRoot, options, selectedRuns
workerObj.setTestRoot(testRoot)
workerObj.addOptions(options)
workerObj.runOutputDir = path.resolve(testRoot, finalConfig.output)
mkdirp.sync(workerObj.runOutputDir)
testWorkerArray.push(workerObj)
})
workers.push(...testWorkerArray)
Expand Down
19 changes: 19 additions & 0 deletions test/data/sandbox/codecept.workers-multiple-output.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export const config = {
tests: './workers-multiple-browsers/*.js',
timeout: 10000,
output: './output/workers-multiple-output',
helpers: {
FakeDriver: {
require: '../fake_driver',
browser: 'dummy',
},
},
include: {},
mocha: {},
multiple: {
dev: {
browsers: ['chromium', 'webkit'],
},
},
name: 'sandbox',
}
16 changes: 16 additions & 0 deletions test/runner/run_workers_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ describe('CodeceptJS Workers Runner', function () {
expect(stdout).toContain(customName)
if (fs.existsSync(outputDir)) {
createdOutput = true
fs.rmSync(outputDir, { recursive: true, force: true })
}
expect(createdOutput).toEqual(true)
expect(err).toEqual(null)
Expand Down Expand Up @@ -574,6 +575,21 @@ describe('CodeceptJS Workers Runner', function () {
})
})

it('should create output directory of each run in multi-run', function (done) {
if (!semver.satisfies(process.version, '>=11.7.0')) this.skip('not for node version')
const outputDir = path.join(codecept_dir, 'output', 'workers-multiple-output')
fs.rmSync(outputDir, { recursive: true, force: true })

exec(`${codecept_run_glob('codecept.workers-multiple-output.conf.js')} 2 dev`, (err, stdout) => {
expect(stdout).toMatch(/OK\s+\|\s+8 passed/)
expect(err).toEqual(null)
for (const run of ['dev_chromium1', 'dev_webkit1']) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curios why there is 1 appended to the folder name?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kobenguyent
Have no idea. This is how run-workers names the folders.
run-multiple names them as dev_chromium_1, dev_webkit_2, dev_firefox_3 etc. (which makes sense to me)
Maybe some inconsistency.

expect(fs.existsSync(path.join(outputDir, run))).toEqual(true)
}
done()
})
})

it('should write one JUnit report per browser with all suites of that browser in multi-run --by suite', function (done) {
if (!semver.satisfies(process.version, '>=11.7.0')) this.skip('not for node version')
const outputDir = path.join(codecept_dir, 'output', 'junit-multiple')
Expand Down
Loading