Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
942530a
[test optimization] Fix playwright e2e tests flakiness (#5438)
juan-fernandez Mar 19, 2025
9461c3a
Report waf init and update success and failure (#5388)
IlyasShabi Mar 19, 2025
0c8751c
bump native appsec package (#5439)
IlyasShabi Mar 19, 2025
e374119
[test optimization] Improve playwright flakiness (this time for real?…
juan-fernandez Mar 19, 2025
24a2607
dbm: tedious (sql server) service mode (#5375)
tlhunter Mar 19, 2025
edc0de4
increase next.js test timeout to 5 minutes (#5442)
rochdev Mar 19, 2025
00b1529
lazy load dd-trace-api integration (#5406)
rochdev Mar 19, 2025
9f46dbc
retry test agent start when it fails (#5443)
rochdev Mar 20, 2025
aca4f05
fix mysql/mysql2/pg dbm trace id tests (#5436)
rochdev Mar 20, 2025
d5a436a
fix amqplib flaky dsm tests (#5445)
rochdev Mar 20, 2025
7483391
fix aws-sdk kinesis flaky dsm test (#5446)
rochdev Mar 20, 2025
a68c72a
fix profiling test expectating minimum 2 requests instead of 1 (#5449)
rochdev Mar 20, 2025
bcd9fbd
add matrix strategy to llmobs sdk ci job (#5451)
rochdev Mar 20, 2025
5bdc342
retry npm install/view for appsec and plugins tests (#5434)
rochdev Mar 21, 2025
0a33d5d
set dc-polyfill version to 0.1.6 (#5457)
rochdev Mar 21, 2025
b18ea0a
replace node action cache with custom cache in ci (#5454)
rochdev Mar 21, 2025
a41d43d
feat(llmobs): add integration tag to llmobs spans (#5465)
Yun-Kim Mar 21, 2025
bc3be93
chore(llmobs): add span.finished telemetry metric (#5444)
Yun-Kim Mar 21, 2025
acbb8dc
fix release script esm error on node 20 (#5368)
rochdev Mar 21, 2025
7eda6c5
fix connection pool error in mongoose tests (#5435)
rochdev Mar 21, 2025
ac08612
make cache action unix compatible and update test agent (#5464)
rochdev Mar 24, 2025
4bd1de0
fix wrong test error message when expected span was not received (#5447)
rochdev Mar 25, 2025
7c5cecd
[test optimization] [SDTEST-1630] Attempt to fix flaky tests implemen…
Mariovido Mar 25, 2025
0075b25
[test optimization] [SDTEST-1720] Change capabilities tagging to send…
Mariovido Mar 25, 2025
23bdda6
Fix logging null when debugging and sending data without any error (#…
simon-id Mar 25, 2025
5027915
feat(llmobs): add vertexai plugin (#5413)
sabrenner Mar 25, 2025
bddd71d
waf requests telemetry metrics (#5384)
IlyasShabi Mar 25, 2025
a385cac
fix memory leak in runtime.node.heap.* metrics (#5476)
rochdev Mar 25, 2025
90ab0cb
chore(llmobs): add span size telemetry metrics (#5468)
Yun-Kim Mar 25, 2025
1b8d583
Add a few TODO's (#5477)
watson Mar 25, 2025
8370d31
Fix iast flaky code injection tests (#5460)
uurien Mar 26, 2025
38b0372
v5.44.0
rochdev Mar 26, 2025
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
21 changes: 19 additions & 2 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
name: Install dependencies
description: Install dependencies
inputs:
cache:
description: "Whether to enable caching of node_modules."
required: false
default: 'false'
runs:
using: composite
steps: # retry in case of server error from registry
steps:
- id: yarn-cache
uses: actions/cache@v4
with:
key: yarn-cache-${{ github.workflow }}-${{ github.job }}-${{ hashFiles('yarn.lock') }}-v2
path: node_modules.tar
if: inputs.cache == 'true'
- run: tar -xf node_modules.tar
shell: bash
if: inputs.cache == 'true' && steps.yarn-cache.outputs.cache-hit == 'true'
# Retry in case of server error from registry.
- run: yarn install --frozen-lockfile --ignore-engines || yarn install --frozen-lockfile --ignore-engines
shell: bash

- run: tar -cf node_modules.tar node_modules
shell: bash
if: inputs.cache == 'true' && steps.yarn-cache.outputs.cache-hit != 'true'
1 change: 0 additions & 1 deletion .github/actions/node/active-lts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ runs:
steps:
- uses: actions/setup-node@v4
with:
cache: yarn
node-version: '22'
1 change: 0 additions & 1 deletion .github/actions/node/latest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ runs:
steps:
- uses: actions/setup-node@v4
with:
cache: yarn
node-version: 'latest'
1 change: 0 additions & 1 deletion .github/actions/node/newest-maintenance-lts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ runs:
steps:
- uses: actions/setup-node@v4
with:
cache: yarn
node-version: '20'
1 change: 0 additions & 1 deletion .github/actions/node/oldest-maintenance-lts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ runs:
steps:
- uses: actions/setup-node@v4
with:
cache: yarn
node-version: '18'
2 changes: 1 addition & 1 deletion .github/actions/testagent/start/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ runs:
using: composite
steps:
- uses: actions/checkout@v4
- run: docker compose up -d testagent
- run: docker compose up -d testagent || docker compose up -d testagent
shell: bash
5 changes: 3 additions & 2 deletions .github/workflows/appsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ./.github/actions/node/active-lts
- uses: ./.github/actions/install
with:
cache: 'true'
- run: yarn test:appsec:ci
- uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1

Expand Down Expand Up @@ -230,7 +232,6 @@ jobs:
- uses: ./.github/actions/testagent/start
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
cache: yarn
node-version: ${{ matrix.version }}
- uses: ./.github/actions/install
- run: yarn test:appsec:plugins:ci
Expand All @@ -257,7 +258,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: yarn install
- uses: ./.github/actions/install
- uses: ./.github/actions/node/oldest-maintenance-lts
- run: yarn test:integration:appsec
- uses: ./.github/actions/node/active-lts
Expand Down
37 changes: 28 additions & 9 deletions .github/workflows/llmobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,22 @@ concurrency:

jobs:
sdk:
strategy:
matrix:
version: [18, 20, 22, latest]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ./.github/actions/testagent/start
- uses: ./.github/actions/node/oldest-maintenance-lts
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: ${{ matrix.version }}
- uses: ./.github/actions/install
- run: yarn test:llmobs:sdk:ci
- uses: ./.github/actions/node/newest-maintenance-lts
- run: yarn test:llmobs:sdk:ci
- uses: ./.github/actions/node/active-lts
- run: yarn test:llmobs:sdk:ci
- uses: ./.github/actions/node/latest
- run: yarn test:llmobs:sdk:ci
- if: always()
uses: ./.github/actions/testagent/logs
with:
suffix: llmobs-${{ github.job }}
suffix: llmobs-${{ github.job }}-${{ matrix.version }}
- uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1

openai:
Expand Down Expand Up @@ -74,7 +73,7 @@ jobs:
with:
suffix: llmobs-${{ github.job }}

aws-sdk:
bedrock:
runs-on: ubuntu-latest
env:
PLUGINS: aws-sdk
Expand All @@ -93,3 +92,23 @@ jobs:
uses: ./.github/actions/testagent/logs
with:
suffix: llmobs-${{ github.job }}

vertex-ai:
runs-on: ubuntu-latest
env:
PLUGINS: google-cloud-vertexai
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ./.github/actions/testagent/start
- uses: ./.github/actions/node/oldest-maintenance-lts
- uses: ./.github/actions/install
- run: yarn test:llmobs:plugins:ci
shell: bash
- uses: ./.github/actions/node/active-lts
- run: yarn test:llmobs:plugins:ci
shell: bash
- uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
- if: always()
uses: ./.github/actions/testagent/logs
with:
suffix: llmobs-${{ github.job }}
3 changes: 1 addition & 2 deletions .github/workflows/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ jobs:
- 1521:1521
- 5500:5500
testagent:
image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.16.0
image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.21.1
env:
LOG_LEVEL: DEBUG
TRACE_LANGUAGE: javascript
Expand All @@ -877,7 +877,6 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
cache: yarn
node-version: '16'
- uses: ./.github/actions/install
- run: yarn config set ignore-engines true
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/profiling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ./.github/actions/node/active-lts
- uses: ./.github/actions/install
with:
cache: 'true'
- run: yarn test:profiler:ci
- run: yarn test:integration:profiler
- uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
23 changes: 22 additions & 1 deletion .github/workflows/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,32 @@ jobs:
env:
DD_INJECTION_ENABLED: 'true'

integration-playwright:
strategy:
matrix:
version: [18, latest]
runs-on: ubuntu-latest
env:
DD_SERVICE: dd-trace-js-integration-tests
DD_CIVISIBILITY_AGENTLESS_ENABLED: 1
DD_API_KEY: ${{ secrets.DD_API_KEY_CI_APP }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: ${{ matrix.version }}
- uses: ./.github/actions/install
# Install system dependencies for playwright
- run: npx playwright install-deps
- run: yarn test:integration:playwright
env:
NODE_OPTIONS: '-r ./ci/init'

integration-ci:
strategy:
matrix:
version: [18, latest]
framework: [cucumber, playwright, selenium, jest, mocha]
framework: [cucumber, selenium, jest, mocha]
runs-on: ubuntu-latest
env:
DD_SERVICE: dd-trace-js-integration-tests
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tracing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ./.github/actions/node/active-lts
- uses: ./.github/actions/install
with:
cache: 'true'
- run: yarn test:trace:core:ci
- uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
5 changes: 5 additions & 0 deletions benchmark/sirun/runtime-metrics/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This benchmark runs the with runtime metrics and an accelerated flush. While
this can catch code regressions, it's mostly meant to catch things like memory
leaks where metrics would start piling up. This can be hard to catch in tests,
but it would cause the app to become slower and slower over time which would
be visible in the benchmark.
5 changes: 5 additions & 0 deletions benchmark/sirun/runtime-metrics/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict'

require('../../..').init()

setTimeout(() => {}, 1000)
22 changes: 22 additions & 0 deletions benchmark/sirun/runtime-metrics/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "runtime-metrics",
"run": "node index.js",
"run_with_affinity": "bash -c \"taskset -c $CPU_AFFINITY node index.js\"",
"cachegrind": false,
"iterations": 5,
"instructions": true,
"variants": {
"control": {
"env": {
"DD_RUNTIME_METRICS_ENABLED": "false"
}
},
"with-runtime-metrics": {
"baseline": "control",
"env": {
"DD_RUNTIME_METRICS_ENABLED": "true",
"DD_RUNTIME_METRICS_FLUSH_INTERVAL": "20"
}
}
}
}
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ services:
- LDAP_PASSWORDS=password1,password2

testagent:
image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.16.0
image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.21.1
ports:
- "127.0.0.1:9126:9126"
environment:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Feature: Attempt to fix
Scenario: Say attempt to fix
When the greeter says attempt to fix
Then I should have heard "attempt to fix"
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const assert = require('assert')
const { When, Then } = require('@cucumber/cucumber')

let numAttempt = 0

Then('I should have heard {string}', function (expectedResponse) {
if (this.whatIHeard === 'quarantine') {
assert.equal(this.whatIHeard, 'fail')
Expand All @@ -21,3 +23,16 @@ When('the greeter says disabled', function () {
// expected to fail if not disabled
this.whatIHeard = 'disabld'
})

When('the greeter says attempt to fix', function () {
// eslint-disable-next-line no-console
console.log('I am running') // just to assert whether this is running
// expected to fail
if (process.env.SHOULD_ALWAYS_PASS) {
this.whatIHeard = 'attempt to fix'
} else if (process.env.SHOULD_FAIL_SOMETIMES) {
this.whatIHeard = numAttempt++ % 2 === 0 ? 'attempt to fix' : 'attempt to fx'
} else {
this.whatIHeard = 'attempt to fx'
}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { test, expect } = require('@playwright/test')

test.beforeEach(async ({ page }) => {
await page.goto(process.env.PW_BASE_URL)
})

test('should work with passing tests', async ({ page }) => {
await expect(page.locator('.hello-world')).toHaveText([
'Hello World'
])
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const { test, expect } = require('@playwright/test')

test.beforeEach(async ({ page }) => {
await page.goto(process.env.PW_BASE_URL)
})

test.describe('attempt to fix', () => {
test('should attempt to fix failed test', async ({ page }) => {
let textToAssert

if (process.env.SHOULD_ALWAYS_PASS) {
textToAssert = 'Hello World'
} else if (process.env.SHOULD_FAIL_SOMETIMES) {
// can't use numAttempt++ because we're running in parallel
if (Number(process.env.TEST_WORKER_INDEX) % 2 === 0) {
throw new Error('Hello Warld')
}
textToAssert = 'Hello World'
} else {
textToAssert = 'Hello Warld'
}

await expect(page.locator('.hello-world')).toHaveText([
textToAssert
])
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { expect } = require('chai')

let numAttempts = 0

describe('attempt to fix tests', () => {
it('can attempt to fix a test', () => {
// eslint-disable-next-line no-console
console.log('I am running when attempt to fix') // to check if this is being run
if (process.env.SHOULD_ALWAYS_PASS) {
expect(1 + 2).to.equal(3)
} else if (process.env.SHOULD_FAIL_SOMETIMES) {
if (numAttempts++ % 2 === 0) {
expect(1 + 2).to.equal(3)
} else {
expect(1 + 2).to.equal(4)
}
} else {
expect(1 + 2).to.equal(4)
}
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { expect } = require('chai')

describe('attempt to fix tests 2', () => {
it('can attempt to fix a test', () => {
// eslint-disable-next-line no-console
console.log('I am running when attempt to fix 2') // to check if this is being run
expect(1 + 2).to.equal(3)
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { describe, test, expect } from 'vitest'

let numAttempt = 0

describe('attempt to fix tests', () => {
test('can attempt to fix a test', () => {
// eslint-disable-next-line no-console
console.log('I am running') // to check if this is being run
if (process.env.SHOULD_ALWAYS_PASS) {
expect(1 + 2).to.equal(3)
} else if (process.env.SHOULD_FAIL_SOMETIMES) {
// We need the last attempt to fail for the exit code to be 1
if (numAttempt++ % 2 === 1) {
expect(1 + 2).to.equal(4)
} else {
expect(1 + 2).to.equal(3)
}
} else {
expect(1 + 2).to.equal(4)
}
})
})
Loading
Loading