Skip to content

Commit

Permalink
fetch di enabled for mocha
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-fernandez committed Dec 17, 2024
1 parent a17c93f commit 6782ab5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/datadog-plugin-mocha/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ class MochaPlugin extends CiPlugin {
browserDriver: spanTags[TEST_BROWSER_DRIVER]
}
)
if (willBeRetried && this.di) {
if (willBeRetried && this.di && this.libraryConfig?.isDiEnabled) {
const testName = span.context()._tags[TEST_NAME]
const debuggerParameters = this.addDiProbe(err)
debuggerParameterPerTest.set(testName, debuggerParameters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ class CiVisibilityExporter extends AgentInfoExporter {
isEarlyFlakeDetectionEnabled,
earlyFlakeDetectionNumRetries,
earlyFlakeDetectionFaultyThreshold,
isFlakyTestRetriesEnabled
isFlakyTestRetriesEnabled,
isDiEnabled
} = remoteConfiguration
return {
isCodeCoverageEnabled,
Expand All @@ -207,7 +208,8 @@ class CiVisibilityExporter extends AgentInfoExporter {
earlyFlakeDetectionNumRetries,
earlyFlakeDetectionFaultyThreshold,
isFlakyTestRetriesEnabled: isFlakyTestRetriesEnabled && this._config.isFlakyTestRetriesEnabled,
flakyTestRetriesCount: this._config.flakyTestRetriesCount
flakyTestRetriesCount: this._config.flakyTestRetriesCount,
isDiEnabled: isDiEnabled && this._config.isTestDynamicInstrumentationEnabled
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ function getLibraryConfiguration ({
itr_enabled: isItrEnabled,
require_git: requireGit,
early_flake_detection: earlyFlakeDetectionConfig,
flaky_test_retries_enabled: isFlakyTestRetriesEnabled
flaky_test_retries_enabled: isFlakyTestRetriesEnabled,
di_enabled: isDiEnabled
}
}
} = JSON.parse(res)
Expand All @@ -107,7 +108,8 @@ function getLibraryConfiguration ({
earlyFlakeDetectionConfig?.slow_test_retries?.['5s'] || DEFAULT_EARLY_FLAKE_DETECTION_NUM_RETRIES,
earlyFlakeDetectionFaultyThreshold:
earlyFlakeDetectionConfig?.faulty_session_threshold ?? DEFAULT_EARLY_FLAKE_DETECTION_ERROR_THRESHOLD,
isFlakyTestRetriesEnabled
isFlakyTestRetriesEnabled,
isDiEnabled: isDiEnabled && isFlakyTestRetriesEnabled
}

log.debug(() => `Remote settings: ${JSON.stringify(settings)}`)
Expand Down

0 comments on commit 6782ab5

Please sign in to comment.