Skip to content

Commit

Permalink
config spec
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-fernandez committed Oct 24, 2024
1 parent 63f5e33 commit 967f7fd
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/dd-trace/test/config.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@ describe('Config', () => {
{ name: 'isIntelligentTestRunnerEnabled', value: false, origin: 'default' },
{ name: 'isManualApiEnabled', value: false, origin: 'default' },
{ name: 'ciVisibilityTestSessionName', value: '', origin: 'default' },
{ name: 'ciVisAgentlessLogSubmissionEnabled', value: false, origin: 'default' },
{ name: 'isTestDynamicInstrumentationEnabled', value: false, origin: 'default' },
{ name: 'logInjection', value: false, origin: 'default' },
{ name: 'lookup', value: undefined, origin: 'default' },
{ name: 'openAiLogsEnabled', value: false, origin: 'default' },
Expand Down Expand Up @@ -1875,6 +1877,8 @@ describe('Config', () => {
delete process.env.DD_CIVISIBILITY_FLAKY_RETRY_COUNT
delete process.env.DD_TEST_SESSION_NAME
delete process.env.JEST_WORKER_ID
delete process.env.DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED
delete process.env.DD_AGENTLESS_LOG_SUBMISSION_ENABLED
options = {}
})
context('ci visibility mode is enabled', () => {
Expand Down Expand Up @@ -1963,6 +1967,24 @@ describe('Config', () => {
const config = new Config(options)
expect(config).to.have.property('ciVisibilityTestSessionName', 'my-test-session')
})
it('should not enable agentless log submission by default', () => {
const config = new Config(options)
expect(config).to.have.property('ciVisAgentlessLogSubmissionEnabled', false)
})
it('should enable agentless log submission if DD_AGENTLESS_LOG_SUBMISSION_ENABLED is true', () => {
process.env.DD_AGENTLESS_LOG_SUBMISSION_ENABLED = 'true'
const config = new Config(options)
expect(config).to.have.property('ciVisAgentlessLogSubmissionEnabled', true)
})
it('should not set isTestDynamicInstrumentationEnabled by default', () => {
const config = new Config(options)
expect(config).to.have.property('isTestDynamicInstrumentationEnabled', false)
})
it('should set isTestDynamicInstrumentationEnabled if DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED is passed', () => {
process.env.DD_TEST_DYNAMIC_INSTRUMENTATION_ENABLED = 'true'
const config = new Config(options)
expect(config).to.have.property('isTestDynamicInstrumentationEnabled', true)
})
})
context('ci visibility mode is not enabled', () => {
it('should not activate intelligent test runner or git metadata upload', () => {
Expand Down

0 comments on commit 967f7fd

Please sign in to comment.