Skip to content

Commit

Permalink
[ci-visibility] Support mocha parallel mode (#4314)
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-fernandez authored May 23, 2024
1 parent d1e1d01 commit ead2f41
Show file tree
Hide file tree
Showing 17 changed files with 1,196 additions and 730 deletions.
7 changes: 7 additions & 0 deletions ci/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const { isTrue } = require('../packages/dd-trace/src/util')

const isJestWorker = !!process.env.JEST_WORKER_ID
const isCucumberWorker = !!process.env.CUCUMBER_WORKER_ID
const isMochaWorker = !!process.env.MOCHA_WORKER_ID

const options = {
startupLogs: false,
Expand Down Expand Up @@ -44,6 +45,12 @@ if (isCucumberWorker) {
}
}

if (isMochaWorker) {
options.experimental = {
exporter: 'mocha_worker'
}
}

if (shouldInit) {
tracer.init(options)
tracer.use('fs', false)
Expand Down
1 change: 1 addition & 0 deletions ext/exporters.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ declare const exporters: {
AGENT_PROXY: 'agent_proxy',
JEST_WORKER: 'jest_worker',
CUCUMBER_WORKER: 'cucumber_worker'
MOCHA_WORKER: 'mocha_worker'
}

export = exporters
3 changes: 2 additions & 1 deletion ext/exporters.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ module.exports = {
DATADOG: 'datadog',
AGENT_PROXY: 'agent_proxy',
JEST_WORKER: 'jest_worker',
CUCUMBER_WORKER: 'cucumber_worker'
CUCUMBER_WORKER: 'cucumber_worker',
MOCHA_WORKER: 'mocha_worker'
}
Loading

0 comments on commit ead2f41

Please sign in to comment.