5656 - name : Get Playwright version from versions package.json
5757 id : playwright-version
5858 run : |
59- PLAYWRIGHT_VERSION=$(node -p "require('./packages/dd-trace/test/plugins/versions/package.json').dependencies['@playwright/test']")
59+ PLAYWRIGHT_VERSION=$(node -p \
60+ "const versions = require('./integration-tests/playwright/versions'); \
61+ versions.getLatestPlaywrightSpecifier() === 'latest' \
62+ ? versions.latest \
63+ : versions.latestSupportedByNode18")
6064 echo "version=$PLAYWRIGHT_VERSION" >> $GITHUB_OUTPUT
6165 echo "Playwright version: $PLAYWRIGHT_VERSION"
6266 - name : Cache Playwright browsers
@@ -73,14 +77,14 @@ jobs:
7377 strategy :
7478 fail-fast : false
7579 matrix :
76- playwright-version : [oldest, latest]
80+ playwright-version : [oldest, latest, latest-node18 ]
7781 name : Ensure Playwright Docker image (${{ matrix.playwright-version }})
7882 runs-on : ubuntu-latest
7983 permissions :
8084 contents : read
8185 packages : write
8286 outputs :
83- # Both matrix jobs set this to the same value, so the last-writer-wins
87+ # All matrix jobs set this to the same value, so the last-writer-wins
8488 # behaviour of matrix outputs is safe here.
8589 images : ${{ steps.versions.outputs.images }}
8690 steps :
@@ -89,19 +93,35 @@ jobs:
8993 id : versions
9094 run : |
9195 LATEST=$(node -p "require('./integration-tests/playwright/versions').latest")
96+ LATEST_NODE18=$(node -p "require('./integration-tests/playwright/versions').latestSupportedByNode18")
9297 OLDEST=$(node -p "require('./integration-tests/playwright/versions').oldest")
9398 DOCKER_HASH=$(sha256sum .github/playwright/Dockerfile | cut -c1-8)
9499 LATEST_TAG="${LATEST}-${DOCKER_HASH}"
100+ LATEST_NODE18_TAG="${LATEST_NODE18}-${DOCKER_HASH}"
95101 OLDEST_TAG="${OLDEST}-${DOCKER_HASH}"
96102 BASE="ghcr.io/datadog/dd-trace-js/playwright-tools"
97- IMAGES=$(printf '{"latest":"%s:%s","oldest":"%s:%s"}' "$BASE" "$LATEST_TAG" "$BASE" "$OLDEST_TAG")
98- PW_VERSION=$([ "${{ matrix.playwright-version }}" = "latest" ] && echo "$LATEST" || echo "$OLDEST")
99- IMAGE_TAG=$([ "${{ matrix.playwright-version }}" = "latest" ] && echo "$LATEST_TAG" || echo "$OLDEST_TAG")
103+ IMAGES=$(printf \
104+ '{"latest":{"latest":"%s:%s","oldest":"%s:%s"},"oldest":{"latest":"%s:%s","oldest":"%s:%s"}}' \
105+ "$BASE" "$LATEST_TAG" "$BASE" "$OLDEST_TAG" "$BASE" "$LATEST_NODE18_TAG" "$BASE" "$OLDEST_TAG")
106+ case "${{ matrix.playwright-version }}" in
107+ latest)
108+ PW_VERSION="$LATEST"
109+ IMAGE_TAG="$LATEST_TAG"
110+ ;;
111+ latest-node18)
112+ PW_VERSION="$LATEST_NODE18"
113+ IMAGE_TAG="$LATEST_NODE18_TAG"
114+ ;;
115+ *)
116+ PW_VERSION="$OLDEST"
117+ IMAGE_TAG="$OLDEST_TAG"
118+ ;;
119+ esac
100120 echo "images=$IMAGES" >> $GITHUB_OUTPUT
101121 echo "pw-version=$PW_VERSION" >> $GITHUB_OUTPUT
102122 echo "image-tag=$IMAGE_TAG" >> $GITHUB_OUTPUT
103123 - name : Log in to GHCR
104- uses : docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
124+ uses : docker/login-action@abd2ef45e78c5afb21d64d4ca52ee8550d9572c7 # v4.5.1
105125 with :
106126 registry : ghcr.io
107127 username : ${{ github.actor }}
@@ -140,7 +160,7 @@ jobs:
140160 permissions :
141161 id-token : write
142162 container :
143- image : ${{ fromJson(needs.playwright-image.outputs.images)[matrix.playwright-version] }}
163+ image : ${{ fromJson(needs.playwright-image.outputs.images)[matrix.node-version][matrix. playwright-version] }}
144164 credentials :
145165 username : ${{ github.actor }}
146166 password : ${{ secrets.GITHUB_TOKEN }}
@@ -214,12 +234,12 @@ jobs:
214234 name : integration-webdriverio (${{ matrix.webdriverio-version }}, node-${{ matrix.node-version }})
215235 runs-on : ubuntu-latest
216236 steps :
217- - uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
237+ - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
218238 - uses : ./.github/actions/node
219239 with :
220240 version : ${{ matrix.node-version }}
221241 - uses : ./.github/actions/install
222- - run : npm run test:instrumentations
242+ - run : npm run test:instrumentations:ci
223243 env :
224244 PLUGINS : webdriverio
225245 - run : npm run test:integration:webdriverio:coverage
@@ -279,6 +299,14 @@ jobs:
279299 - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
280300 - uses : ./.github/actions/plugins/test
281301
302+ dependency-helpers :
303+ runs-on : ubuntu-latest
304+ steps :
305+ - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
306+ - uses : ./.github/actions/node
307+ - uses : ./.github/actions/install
308+ - run : npm run test:integration:test-optimization:helpers
309+
282310 integration-cucumber :
283311 strategy :
284312 fail-fast : false
@@ -326,7 +354,7 @@ jobs:
326354 IMAGE="ghcr.io/datadog/dd-trace-js/selenium-tools:${DOCKER_HASH}"
327355 echo "image=$IMAGE" >> $GITHUB_OUTPUT
328356 - name : Log in to GHCR
329- uses : docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
357+ uses : docker/login-action@abd2ef45e78c5afb21d64d4ca52ee8550d9572c7 # v4.5.1
330358 with :
331359 registry : ghcr.io
332360 username : ${{ github.actor }}
@@ -499,3 +527,45 @@ jobs:
499527 - uses : ./.github/actions/coverage
500528 with :
501529 flags : test-optimization-vitest-${{ matrix.version }}
530+
531+ integration-vitest-browser :
532+ needs : playwright-image
533+ runs-on : ubuntu-latest
534+ permissions :
535+ id-token : write
536+ strategy :
537+ fail-fast : false
538+ matrix :
539+ version : [oldest, latest]
540+ name : integration-vitest-browser (node-${{ matrix.version }})
541+ container :
542+ image : ${{ fromJson(needs.playwright-image.outputs.images)[matrix.version].latest }}
543+ credentials :
544+ username : ${{ github.actor }}
545+ password : ${{ secrets.GITHUB_TOKEN }}
546+ env :
547+ DD_SERVICE : dd-trace-js-integration-tests
548+ DD_CIVISIBILITY_AGENTLESS_ENABLED : 1
549+ OPTIONS_OVERRIDE : 1
550+ steps :
551+ - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
552+ - uses : ./.github/actions/dd-sts-api-key
553+ id : dd-sts
554+ continue-on-error : true
555+ - uses : ./.github/actions/node
556+ with :
557+ version : ${{ matrix.version }}
558+ - uses : ./.github/actions/install
559+ - name : Configure Git safe directory
560+ run : git config --global --add safe.directory "$GITHUB_WORKSPACE"
561+ - run : npm run test:instrumentations
562+ env :
563+ PLUGINS : vitest-main
564+ - run : npm run test:integration:vitest:coverage
565+ env :
566+ NODE_OPTIONS : " -r ./ci/init"
567+ DD_API_KEY : ${{ steps.dd-sts.outputs.api_key }}
568+ SPEC : vitest.browser
569+ - uses : ./.github/actions/coverage
570+ with :
571+ flags : test-optimization-vitest-browser-${{ matrix.version }}
0 commit comments