forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Report tests to Datadog from Job that executed them (vercel#73180)
- Loading branch information
Showing
2 changed files
with
19 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -615,47 +615,6 @@ jobs: | |
stepName: 'test-ppr-prod-${{ matrix.group }}' | ||
secrets: inherit | ||
|
||
report-test-results-to-datadog: | ||
needs: | ||
[ | ||
'changes', | ||
'test-unit', | ||
'test-dev', | ||
'test-prod', | ||
'test-integration', | ||
'test-ppr-dev', | ||
'test-ppr-prod', | ||
'test-ppr-integration', | ||
'test-turbopack-dev', | ||
'test-turbopack-integration', | ||
'test-turbopack-production', | ||
'test-turbopack-production-integration', | ||
] | ||
if: ${{ always() && needs.changes.outputs.docs-only == 'false' && !github.event.pull_request.head.repo.fork }} | ||
|
||
runs-on: ubuntu-latest | ||
name: report test results to datadog | ||
steps: | ||
- name: Download test report artifacts | ||
id: download-test-reports | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: test-reports-* | ||
path: test | ||
merge-multiple: true | ||
|
||
- name: Upload test report to datadog | ||
run: | | ||
if [ -d ./test/test-junit-report ]; then | ||
# Add a `test.type` tag to distinguish between turbopack and next.js runs | ||
DD_ENV=ci npx @datadog/[email protected] junit upload --tags test.type:nextjs --service nextjs ./test/test-junit-report | ||
fi | ||
if [ -d ./test/turbopack-test-junit-report ]; then | ||
# Add a `test.type` tag to distinguish between turbopack and next.js runs | ||
DD_ENV=ci npx @datadog/[email protected] junit upload --tags test.type:turbopack --service nextjs ./test/turbopack-test-junit-report | ||
fi | ||
tests-pass: | ||
needs: | ||
[ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -243,19 +243,27 @@ jobs: | |
name: webpack bundle analysis stats-${{ steps.var.outputs.input_step_key }} | ||
path: packages/next/dist/compiled/next-server/report.*.html | ||
|
||
- name: Upload test report artifacts | ||
uses: actions/upload-artifact@v4 | ||
- name: Upload test report to datadog | ||
if: ${{ inputs.afterBuild && always() }} | ||
with: | ||
name: test-reports-${{ steps.var.outputs.input_step_key }} | ||
path: | | ||
test/test-junit-report | ||
test/turbopack-test-junit-report | ||
test/rspack-test-junit-report | ||
if-no-files-found: ignore | ||
run: | | ||
# Add a `test.type` tag to distinguish between turbopack and next.js runs | ||
# Add a `nextjs.test_session.name` tag to help identify the job | ||
if [ -d ./test/test-junit-report ]; then | ||
npx @datadog/[email protected] junit upload \ | ||
--service nextjs \ | ||
--tags test.type:nextjs \ | ||
--tags test_session.name:"${{ inputs.stepName }}" \ | ||
./test/test-junit-report | ||
fi | ||
if [ -d ./test/turbopack-test-junit-report ]; then | ||
npx @datadog/[email protected] junit upload \ | ||
--service nextjs \ | ||
--tags test.type:turbopack \ | ||
--tags test_session.name:"${{ inputs.stepName }}" \ | ||
./test/turbopack-test-junit-report | ||
fi | ||
# upload playwright snapshots from failed tests | ||
- name: Upload test report artifacts | ||
- name: Upload Playwright Snapshots | ||
uses: actions/upload-artifact@v4 | ||
if: ${{ inputs.afterBuild && always() }} | ||
with: | ||
|