Skip to content

Commit

Permalink
rename test session name
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-fernandez committed Sep 19, 2024
1 parent d871335 commit 915a7e8
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion integration-tests/cucumber/cucumber.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ versions.forEach(version => {
env: {
...envVars,
DD_TAGS: 'test.customtag:customvalue,test.customtag2:customvalue2',
DD_SESSION_NAME: 'my-test-session'
DD_TEST_SESSION_NAME: 'my-test-session'
},
stdio: 'pipe'
}
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/cypress/cypress.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ moduleTypes.forEach(({
...restEnvVars,
CYPRESS_BASE_URL: `http://localhost:${webAppPort}`,
DD_TAGS: 'test.customtag:customvalue,test.customtag2:customvalue2',
DD_SESSION_NAME: 'my-test-session'
DD_TEST_SESSION_NAME: 'my-test-session'
},
stdio: 'pipe'
}
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/jest/jest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ describe('jest CommonJS', () => {
env: {
...envVars,
DD_TAGS: 'test.customtag:customvalue,test.customtag2:customvalue2',
DD_SESSION_NAME: 'my-test-session'
DD_TEST_SESSION_NAME: 'my-test-session'
},
stdio: 'pipe'
})
Expand Down Expand Up @@ -444,7 +444,7 @@ describe('jest CommonJS', () => {
env: {
...getCiVisAgentlessConfig(receiver.port),
RUN_IN_PARALLEL: true,
DD_SESSION_NAME: 'my-test-session'
DD_TEST_SESSION_NAME: 'my-test-session'
},
stdio: 'pipe'
})
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/mocha/mocha.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ describe('mocha CommonJS', function () {
env: {
...envVars,
DD_TAGS: 'test.customtag:customvalue,test.customtag2:customvalue2',
DD_SESSION_NAME: 'my-test-session'
DD_TEST_SESSION_NAME: 'my-test-session'
},
stdio: 'pipe'
})
Expand Down Expand Up @@ -378,7 +378,7 @@ describe('mocha CommonJS', function () {
RUN_IN_PARALLEL: true,
DD_TRACE_DEBUG: 1,
DD_TRACE_LOG_LEVEL: 'warn',
DD_SESSION_NAME: 'my-test-session'
DD_TEST_SESSION_NAME: 'my-test-session'
},
stdio: 'pipe'
})
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/playwright/playwright.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ versions.forEach((version) => {
...envVars,
PW_BASE_URL: `http://localhost:${webAppPort}`,
DD_TAGS: 'test.customtag:customvalue,test.customtag2:customvalue2',
DD_SESSION_NAME: 'my-test-session'
DD_TEST_SESSION_NAME: 'my-test-session'
},
stdio: 'pipe'
}
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/vitest/vitest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ versions.forEach((version) => {
env: {
...getCiVisAgentlessConfig(receiver.port),
NODE_OPTIONS: '--import dd-trace/register.js -r dd-trace/ci/init', // ESM requires more flags
DD_SESSION_NAME: 'my-test-session'
DD_TEST_SESSION_NAME: 'my-test-session'
},
stdio: 'pipe'
}
Expand Down
6 changes: 3 additions & 3 deletions packages/dd-trace/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ class Config {
this._setValue(defaults, 'isGitUploadEnabled', false)
this._setValue(defaults, 'isIntelligentTestRunnerEnabled', false)
this._setValue(defaults, 'isManualApiEnabled', false)
this._setValue(defaults, 'ciVisibilitySessionName', '')
this._setValue(defaults, 'ciVisibilityTestSessionName', '')
this._setValue(defaults, 'logInjection', false)
this._setValue(defaults, 'lookup', undefined)
this._setValue(defaults, 'memcachedCommandEnabled', false)
Expand Down Expand Up @@ -1035,7 +1035,7 @@ class Config {
DD_CIVISIBILITY_EARLY_FLAKE_DETECTION_ENABLED,
DD_CIVISIBILITY_FLAKY_RETRY_ENABLED,
DD_CIVISIBILITY_FLAKY_RETRY_COUNT,
DD_SESSION_NAME
DD_TEST_SESSION_NAME
} = process.env

if (DD_CIVISIBILITY_AGENTLESS_URL) {
Expand All @@ -1051,7 +1051,7 @@ class Config {
this._setValue(calc, 'flakyTestRetriesCount', coalesce(maybeInt(DD_CIVISIBILITY_FLAKY_RETRY_COUNT), 5))
this._setBoolean(calc, 'isIntelligentTestRunnerEnabled', isTrue(this._isCiVisibilityItrEnabled()))
this._setBoolean(calc, 'isManualApiEnabled', this._isCiVisibilityManualApiEnabled())
this._setString(calc, 'ciVisibilitySessionName', DD_SESSION_NAME)
this._setString(calc, 'ciVisibilityTestSessionName', DD_TEST_SESSION_NAME)
}
this._setString(calc, 'dogstatsd.hostname', this._getHostname())
this._setBoolean(calc, 'isGitUploadEnabled',
Expand Down
4 changes: 2 additions & 2 deletions packages/dd-trace/src/plugin_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ module.exports = class PluginManager {
dsmEnabled,
clientIpEnabled,
memcachedCommandEnabled,
ciVisibilitySessionName
ciVisibilityTestSessionName
} = this._tracerConfig

const sharedConfig = {
Expand All @@ -147,7 +147,7 @@ module.exports = class PluginManager {
site,
url,
headers: headerTags || [],
ciVisibilitySessionName
ciVisibilityTestSessionName
}

if (logInjection !== undefined) {
Expand Down
4 changes: 2 additions & 2 deletions packages/dd-trace/src/plugins/util/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,8 @@ function getIsFaultyEarlyFlakeDetection (projectSuites, testsBySuiteName, faulty
}

function getTestSessionName (config, testCommand, envTags) {
if (config.ciVisibilitySessionName) {
return config.ciVisibilitySessionName
if (config.ciVisibilityTestSessionName) {
return config.ciVisibilityTestSessionName
}
if (envTags[CI_JOB_NAME]) {
return `${envTags[CI_JOB_NAME]}-${testCommand}`
Expand Down
10 changes: 5 additions & 5 deletions packages/dd-trace/test/config.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ describe('Config', () => {
{ name: 'isGitUploadEnabled', value: false, origin: 'default' },
{ name: 'isIntelligentTestRunnerEnabled', value: false, origin: 'default' },
{ name: 'isManualApiEnabled', value: false, origin: 'default' },
{ name: 'ciVisibilitySessionName', value: '', origin: 'default' },
{ name: 'ciVisibilityTestSessionName', value: '', origin: 'default' },
{ name: 'logInjection', value: false, origin: 'default' },
{ name: 'lookup', value: undefined, origin: 'default' },
{ name: 'openAiLogsEnabled', value: false, origin: 'default' },
Expand Down Expand Up @@ -1798,7 +1798,7 @@ describe('Config', () => {
delete process.env.DD_CIVISIBILITY_EARLY_FLAKE_DETECTION_ENABLED
delete process.env.DD_CIVISIBILITY_FLAKY_RETRY_ENABLED
delete process.env.DD_CIVISIBILITY_FLAKY_RETRY_COUNT
delete process.env.DD_SESSION_NAME
delete process.env.DD_TEST_SESSION_NAME
delete process.env.JEST_WORKER_ID
options = {}
})
Expand Down Expand Up @@ -1883,10 +1883,10 @@ describe('Config', () => {
const config = new Config(options)
expect(config).to.have.property('flakyTestRetriesCount', 5)
})
it('should set the session name if DD_SESSION_NAME is set', () => {
process.env.DD_SESSION_NAME = 'my-test-session'
it('should set the session name if DD_TEST_SESSION_NAME is set', () => {
process.env.DD_TEST_SESSION_NAME = 'my-test-session'
const config = new Config(options)
expect(config).to.have.property('ciVisibilitySessionName', 'my-test-session')
expect(config).to.have.property('ciVisibilityTestSessionName', 'my-test-session')
})
})
context('ci visibility mode is not enabled', () => {
Expand Down

0 comments on commit 915a7e8

Please sign in to comment.