Skip to content

Commit

Permalink
[test visibility] Fix cucumber e2e tests (#4654)
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-fernandez authored Sep 5, 2024
1 parent d20f8b6 commit 1c976a9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion integration-tests/cucumber/cucumber.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ const {
} = require('../../packages/dd-trace/src/plugins/util/test')

const isOldNode = semver.satisfies(process.version, '<=16')
const versions = ['7.0.0', isOldNode ? '9' : 'latest']
// TODO: change 10 to `latest` when fix is released
const versions = ['7.0.0', isOldNode ? '9' : '10']

const moduleType = [
{
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/selenium/selenium.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const {
} = require('../../packages/dd-trace/src/plugins/util/test')
const { NODE_MAJOR } = require('../../version')

const cucumberVersion = NODE_MAJOR <= 16 ? '9' : 'latest'
const cucumberVersion = NODE_MAJOR <= 16 ? '9' : '10'

const webAppServer = require('../ci-visibility/web-app-server')

Expand Down
6 changes: 3 additions & 3 deletions packages/datadog-instrumentations/src/cucumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ addHook({
// Test start / finish for newer versions. The only hook executed in workers when in parallel mode
addHook({
name: '@cucumber/cucumber',
versions: ['>=7.3.0'],
versions: ['>=7.3.0 <11.0.0'],
file: 'lib/runtime/test_case_runner.js'
}, testCaseHook)

Expand All @@ -559,7 +559,7 @@ addHook({
// `getWrappedRunTest` generates suite start and finish events
addHook({
name: '@cucumber/cucumber',
versions: ['>=7.3.0'],
versions: ['>=7.3.0 <11.0.0'],
file: 'lib/runtime/index.js'
}, (runtimePackage, frameworkVersion) => {
shimmer.wrap(runtimePackage.default.prototype, 'runTestCase', runTestCase => getWrappedRunTest(runTestCase))
Expand Down Expand Up @@ -588,7 +588,7 @@ addHook({
// `getWrappedParseWorkerMessage` generates suite finish events
addHook({
name: '@cucumber/cucumber',
versions: ['>=8.0.0'],
versions: ['>=8.0.0 <11.0.0'],
file: 'lib/runtime/parallel/coordinator.js'
}, (coordinatorPackage, frameworkVersion) => {
shimmer.wrap(coordinatorPackage.default.prototype, 'start', start => getWrappedStart(start, frameworkVersion, true))
Expand Down

0 comments on commit 1c976a9

Please sign in to comment.