Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci-visibility] Support mocha parallel mode #4314

Merged
merged 8 commits into from
May 23, 2024
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
Loading