Skip to content

Commit

Permalink
[test visibility] Remove beta flag from manual test API (#4705)
Browse files Browse the repository at this point in the history
Co-authored-by: Romain Komorn <[email protected]>
  • Loading branch information
juan-fernandez and romainkomorndatadog authored Sep 23, 2024
1 parent 470194a commit b079c6f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('can run tests', () => {
})
test('integration test', () => {
// Just for testing purposes, so we don't create a custom span
if (!process.env.DD_CIVISIBILITY_MANUAL_API_ENABLED) {
if (process.env.DD_CIVISIBILITY_MANUAL_API_ENABLED === 'false') {
return Promise.resolve()
}
const testSpan = tracer.scope().active()
Expand Down
9 changes: 6 additions & 3 deletions integration-tests/test-api-manual.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('test-api-manual', () => {
'--require ./ci-visibility/test-api-manual/test.fake.js ./ci-visibility/test-api-manual/run-fake-test-framework',
{
cwd,
env: { ...getCiVisAgentlessConfig(receiver.port), DD_CIVISIBILITY_MANUAL_API_ENABLED: '1' },
env: getCiVisAgentlessConfig(receiver.port),
stdio: 'pipe'
}
)
Expand All @@ -82,7 +82,7 @@ describe('test-api-manual', () => {
})
})

it('does not report test spans if DD_CIVISIBILITY_MANUAL_API_ENABLED is not set', (done) => {
it('does not report test spans if DD_CIVISIBILITY_MANUAL_API_ENABLED is set to false', (done) => {
receiver.assertPayloadReceived(() => {
const error = new Error('should not report spans')
done(error)
Expand All @@ -93,7 +93,10 @@ describe('test-api-manual', () => {
'--require ./ci-visibility/test-api-manual/test.fake.js ./ci-visibility/test-api-manual/run-fake-test-framework',
{
cwd,
env: getCiVisAgentlessConfig(receiver.port),
env: {
...getCiVisAgentlessConfig(receiver.port),
DD_CIVISIBILITY_MANUAL_API_ENABLED: 'false'
},
stdio: 'pipe'
}
)
Expand Down
8 changes: 4 additions & 4 deletions packages/dd-trace/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -1003,10 +1003,10 @@ class Config {
}

_isCiVisibilityManualApiEnabled () {
return isTrue(coalesce(
return coalesce(
process.env.DD_CIVISIBILITY_MANUAL_API_ENABLED,
false
))
true
)
}

_isTraceStatsComputationEnabled () {
Expand Down Expand Up @@ -1050,7 +1050,7 @@ class Config {
coalesce(DD_CIVISIBILITY_FLAKY_RETRY_ENABLED, true))
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._setBoolean(calc, 'isManualApiEnabled', !isFalse(this._isCiVisibilityManualApiEnabled()))
this._setString(calc, 'ciVisibilityTestSessionName', DD_TEST_SESSION_NAME)
}
this._setString(calc, 'dogstatsd.hostname', this._getHostname())
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 @@ -1835,14 +1835,14 @@ describe('Config', () => {
const config = new Config(options)
expect(config).to.have.property('isIntelligentTestRunnerEnabled', false)
})
it('should disable manual testing API by default', () => {
it('should enable manual testing API by default', () => {
const config = new Config(options)
expect(config).to.have.property('isManualApiEnabled', false)
expect(config).to.have.property('isManualApiEnabled', true)
})
it('should enable manual testing API if DD_CIVISIBILITY_MANUAL_API_ENABLED is passed', () => {
process.env.DD_CIVISIBILITY_MANUAL_API_ENABLED = 'true'
it('should disable manual testing API if DD_CIVISIBILITY_MANUAL_API_ENABLED is set to false', () => {
process.env.DD_CIVISIBILITY_MANUAL_API_ENABLED = 'false'
const config = new Config(options)
expect(config).to.have.property('isManualApiEnabled', true)
expect(config).to.have.property('isManualApiEnabled', false)
})
it('should disable memcached command tagging by default', () => {
const config = new Config(options)
Expand Down

0 comments on commit b079c6f

Please sign in to comment.