Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test visibility] Remove beta flag from manual test API #4705

Merged
merged 5 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1824,14 +1824,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
Loading