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

V5.22.0 proposal #4641

Merged
merged 27 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b06d6b9
fix(openai): tracing occurs in correct async context (#4583)
sabrenner Aug 13, 2024
9448824
more correct package guardrails (#4600)
bengl Aug 13, 2024
128a170
log error to telmetry (#4605)
bengl Aug 13, 2024
bbbfdad
PROF-10320: Separate SSI telemetry and heuristics activation (#4592)
szegedi Aug 14, 2024
805355b
Safer shimming (#4585)
bengl Aug 15, 2024
b37bdf6
update axois to 1.7.4 (#4608)
bengl Aug 15, 2024
6a522a9
[test visibility] Add configuration flags to auto test retries (#4609)
juan-fernandez Aug 19, 2024
ec5ac35
Add error strings to telemetry, not just error instances (#4612)
juan-fernandez Aug 19, 2024
c823283
PROF-10329, APMAPI-213: Make sure `profiling.enabled` is boolean for …
szegedi Aug 19, 2024
e38d3dc
prevent .git directory from being uploaded (#4614)
desponda Aug 19, 2024
1aa476e
PROF-10330: Emit SSI information in the profile system info (#4607)
szegedi Aug 20, 2024
16ea1fb
PROF-10329, APMAPI-213: Make sure `products.profiler.enabled` is bool…
szegedi Aug 20, 2024
bb6b237
Fix AppSec manual blocking parameters (#4606)
uurien Aug 21, 2024
e9611c8
use npm pack instead of git clone for system test binaries (#4616)
rochdev Aug 22, 2024
8217c9e
fix(lambda): gate timeout spans and add missing clear (#4446)
duncanista Aug 26, 2024
e6a3355
test: fix the chrome selenium identifier (#4624)
tlhunter Aug 26, 2024
8a7e1c4
chore(w3c): avoid setting _dd.parent_id to 16 zeros (#4576)
mabdinur Aug 26, 2024
99d5908
hapi: migrate from AsyncResource to TracingChannel, see #4597 (#4622)
tlhunter Aug 26, 2024
c85ddc1
PROF-10330: Slim SSI metadata from 3 elements to 2 (#4620)
szegedi Aug 27, 2024
01e82ec
Fix Node.js version to v22.6 instead of "latest" (#4629)
watson Aug 27, 2024
bfd7b01
run all-green on pushes to master (#4632)
bengl Aug 27, 2024
0e97a06
Rename rasp metrics (#4635)
iunanua Aug 28, 2024
0dd8032
[test] allow FakeAgent to respond to remote config requests (#4626)
watson Aug 28, 2024
d37e095
wrap all callbacks in instrumentations with wrapFunction (#4634)
bengl Aug 28, 2024
e17da3f
next.js: cap test range to 14.2.6 for now (#4636)
tlhunter Aug 28, 2024
a60446a
Bump `@datadog/native-appsec` to `8.1.1` (#4630)
CarlesDD Aug 29, 2024
bcec071
v5.22.0
bengl Aug 29, 2024
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
2 changes: 1 addition & 1 deletion .github/actions/node/latest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ runs:
steps:
- uses: actions/setup-node@v3
with:
node-version: 'latest'
node-version: '22.6'
3 changes: 3 additions & 0 deletions .github/workflows/all-green.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: All Green
on:
pull_request:
push:
branches:
- master

jobs:

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/appsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,7 @@ jobs:
matrix:
version:
- 18
- latest
range: ['9.5.0', '11.1.4', '13.2.0', '*']
- 22.6
runs-on: ubuntu-latest
env:
PLUGINS: next
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
aws-sdk:
strategy:
matrix:
node-version: ['18', 'latest']
node-version: ['18', '22.6']
runs-on: ubuntu-latest
services:
localstack:
Expand Down Expand Up @@ -412,7 +412,7 @@ jobs:
http:
strategy:
matrix:
node-version: ['18', '20', 'latest']
node-version: ['18', '20', '22.6']
runs-on: ubuntu-latest
env:
PLUGINS: http
Expand Down Expand Up @@ -648,8 +648,7 @@ jobs:
matrix:
version:
- 18
- latest
range: ['9.5.0', '11.1.4', '13.2.0', '*']
- 22.6
runs-on: ubuntu-latest
env:
PLUGINS: next
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
# setting fail-fast to false in an attempt to prevent this from happening
fail-fast: false
matrix:
version: [18, 20, latest]
version: [18, 20, 22.6]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
integration-ci:
strategy:
matrix:
version: [18, latest]
version: [18, 22.6]
framework: [cucumber, playwright, selenium, jest, mocha]
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
# Important: This is outside the minimum supported version of dd-trace-js
# Node > 16 does not work with Cypress@6.7.0 (not even without our plugin)
# TODO: figure out what to do with this: we might have to deprecate support for cypress@6.7.0
version: [16, latest]
version: [16, 22.6]
# 6.7.0 is the minimum version we support
cypress-version: [6.7.0, latest]
module-type: ['commonJS', 'esm']
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ jobs:
uses: actions/checkout@v4
with:
path: dd-trace-js
- name: Pack dd-trace-js
run: mkdir -p ./binaries && echo /binaries/$(npm pack --pack-destination ./binaries ./dd-trace-js) > ./binaries/nodejs-load-from-npm
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: system_tests_binaries
path: .
path: ./binaries/**/*

get-essential-scenarios:
runs-on: ubuntu-latest
Expand Down
91 changes: 91 additions & 0 deletions integration-tests/cucumber/cucumber.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,97 @@ versions.forEach(version => {
}).catch(done)
})
})

it('is disabled if DD_CIVISIBILITY_FLAKY_RETRY_ENABLED is false', (done) => {
receiver.setSettings({
itr_enabled: false,
code_coverage: false,
tests_skipping: false,
flaky_test_retries_enabled: true,
early_flake_detection: {
enabled: false
}
})

const eventsPromise = receiver
.gatherPayloadsMaxTimeout(({ url }) => url.endsWith('/api/v2/citestcycle'), payloads => {
const events = payloads.flatMap(({ payload }) => payload.events)

const tests = events.filter(event => event.type === 'test').map(event => event.content)

assert.equal(tests.length, 1)

const retriedTests = tests.filter(test => test.meta[TEST_IS_RETRY] === 'true')
assert.equal(retriedTests.length, 0)
})

childProcess = exec(
'./node_modules/.bin/cucumber-js ci-visibility/features-retry/*.feature',
{
cwd,
env: {
...envVars,
DD_CIVISIBILITY_FLAKY_RETRY_ENABLED: 'false'
},
stdio: 'pipe'
}
)

childProcess.on('exit', () => {
eventsPromise.then(() => {
done()
}).catch(done)
})
})

it('retries DD_CIVISIBILITY_FLAKY_RETRY_COUNT times', (done) => {
receiver.setSettings({
itr_enabled: false,
code_coverage: false,
tests_skipping: false,
flaky_test_retries_enabled: true,
early_flake_detection: {
enabled: false
}
})

const eventsPromise = receiver
.gatherPayloadsMaxTimeout(({ url }) => url.endsWith('/api/v2/citestcycle'), payloads => {
const events = payloads.flatMap(({ payload }) => payload.events)

const tests = events.filter(event => event.type === 'test').map(event => event.content)

// 2 failures
assert.equal(tests.length, 2)

const failedTests = tests.filter(test => test.meta[TEST_STATUS] === 'fail')
assert.equal(failedTests.length, 2)
const passedTests = tests.filter(test => test.meta[TEST_STATUS] === 'pass')
assert.equal(passedTests.length, 0)

// All but the first one are retries
const retriedTests = tests.filter(test => test.meta[TEST_IS_RETRY] === 'true')
assert.equal(retriedTests.length, 1)
})

childProcess = exec(
'./node_modules/.bin/cucumber-js ci-visibility/features-retry/*.feature',
{
cwd,
env: {
...envVars,
DD_CIVISIBILITY_FLAKY_RETRY_COUNT: 1
},
stdio: 'pipe'
}
)

childProcess.on('exit', () => {
eventsPromise.then(() => {
done()
}).catch(done)
})
})
})
}
})
Expand Down
115 changes: 115 additions & 0 deletions integration-tests/cypress/cypress.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,121 @@ moduleTypes.forEach(({
}).catch(done)
})
})

it('is disabled if DD_CIVISIBILITY_FLAKY_RETRY_ENABLED is false', (done) => {
receiver.setSettings({
itr_enabled: false,
code_coverage: false,
tests_skipping: false,
flaky_test_retries_enabled: true,
early_flake_detection: {
enabled: false
}
})

const receiverPromise = receiver
.gatherPayloadsMaxTimeout(({ url }) => url.endsWith('/api/v2/citestcycle'), payloads => {
const events = payloads.flatMap(({ payload }) => payload.events)
const testSuites = events.filter(event => event.type === 'test_suite_end').map(event => event.content)
assert.equal(testSuites.length, 1)
assert.equal(testSuites[0].meta[TEST_STATUS], 'fail')

const tests = events.filter(event => event.type === 'test').map(event => event.content)
assert.equal(tests.length, 3)

assert.includeMembers(tests.map(test => test.resource), [
'cypress/e2e/flaky-test-retries.js.flaky test retry eventually passes',
'cypress/e2e/flaky-test-retries.js.flaky test retry never passes',
'cypress/e2e/flaky-test-retries.js.flaky test retry always passes'
])
assert.equal(tests.filter(test => test.meta[TEST_IS_RETRY] === 'true').length, 0)
})

const {
NODE_OPTIONS, // NODE_OPTIONS dd-trace config does not work with cypress
...restEnvVars
} = getCiVisEvpProxyConfig(receiver.port)

const specToRun = 'cypress/e2e/flaky-test-retries.js'

childProcess = exec(
version === 'latest' ? testCommand : `${testCommand} --spec ${specToRun}`,
{
cwd,
env: {
...restEnvVars,
CYPRESS_BASE_URL: `http://localhost:${webAppPort}`,
DD_CIVISIBILITY_FLAKY_RETRY_ENABLED: 'false',
SPEC_PATTERN: specToRun
},
stdio: 'pipe'
}
)

childProcess.on('exit', () => {
receiverPromise.then(() => done()).catch(done)
})
})

it('retries DD_CIVISIBILITY_FLAKY_RETRY_COUNT times', (done) => {
receiver.setSettings({
itr_enabled: false,
code_coverage: false,
tests_skipping: false,
flaky_test_retries_enabled: true,
early_flake_detection: {
enabled: false
}
})

const receiverPromise = receiver
.gatherPayloadsMaxTimeout(({ url }) => url.endsWith('/api/v2/citestcycle'), payloads => {
const events = payloads.flatMap(({ payload }) => payload.events)
const testSuites = events.filter(event => event.type === 'test_suite_end').map(event => event.content)
assert.equal(testSuites.length, 1)
assert.equal(testSuites[0].meta[TEST_STATUS], 'fail')

const tests = events.filter(event => event.type === 'test').map(event => event.content)
assert.equal(tests.length, 5)

assert.includeMembers(tests.map(test => test.resource), [
'cypress/e2e/flaky-test-retries.js.flaky test retry eventually passes',
'cypress/e2e/flaky-test-retries.js.flaky test retry eventually passes',
'cypress/e2e/flaky-test-retries.js.flaky test retry never passes',
'cypress/e2e/flaky-test-retries.js.flaky test retry never passes',
'cypress/e2e/flaky-test-retries.js.flaky test retry always passes'
])

assert.equal(tests.filter(test => test.meta[TEST_IS_RETRY] === 'true').length, 2)
})

const {
NODE_OPTIONS, // NODE_OPTIONS dd-trace config does not work with cypress
...restEnvVars
} = getCiVisEvpProxyConfig(receiver.port)

const specToRun = 'cypress/e2e/flaky-test-retries.js'

childProcess = exec(
version === 'latest' ? testCommand : `${testCommand} --spec ${specToRun}`,
{
cwd,
env: {
...restEnvVars,
CYPRESS_BASE_URL: `http://localhost:${webAppPort}`,
DD_CIVISIBILITY_FLAKY_RETRY_COUNT: 1,
SPEC_PATTERN: specToRun
},
stdio: 'pipe'
}
)

childProcess.on('exit', () => {
receiverPromise.then(() => {
done()
}).catch(done)
})
})
})

it('correctly calculates test code owners when working directory is not repository root', (done) => {
Expand Down
Loading
Loading