Skip to content

Commit

Permalink
fix crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-fernandez committed Sep 4, 2024
1 parent 1e43098 commit 9275549
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 1 addition & 2 deletions packages/datadog-plugin-jest/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ const {
TEST_EARLY_FLAKE_ABORT_REASON,
JEST_DISPLAY_NAME,
TEST_IS_RUM_ACTIVE,
TEST_BROWSER_DRIVER,
TEST_SESSION_NAME
TEST_BROWSER_DRIVER
} = require('../../dd-trace/src/plugins/util/test')
const { COMPONENT } = require('../../dd-trace/src/constants')
const id = require('../../dd-trace/src/id')
Expand Down
4 changes: 3 additions & 1 deletion packages/datadog-plugin-vitest/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ class VitestPlugin extends CiPlugin {
[TEST_SESSION_NAME]: testSessionName
}
}
this.tracer._exporter.setMetadataTags(metadataTags)
if (this.tracer._exporter.setMetadataTags) {
this.tracer._exporter.setMetadataTags(metadataTags)
}

const testSuite = getTestSuitePath(testSuiteAbsolutePath, this.repositoryRoot)
const testSuiteMetadata = getTestSuiteCommonTags(
Expand Down
5 changes: 4 additions & 1 deletion packages/dd-trace/src/plugins/ci_plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ module.exports = class CiPlugin extends Plugin {
[TEST_SESSION_NAME]: testSessionName
}
}
this.tracer._exporter.setMetadataTags(metadataTags)
// tracer might not be initialized correctly
if (this.tracer._exporter.setMetadataTags) {
this.tracer._exporter.setMetadataTags(metadataTags)
}

this.testSessionSpan = this.tracer.startSpan(`${this.constructor.id}.test_session`, {
childOf,
Expand Down

0 comments on commit 9275549

Please sign in to comment.