Skip to content

Commit

Permalink
ci(workflow): turbopack test upload
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Jun 11, 2023
1 parent 4caf4f4 commit aab383d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
secrets: inherit

report-test-results:
needs: ['test-dev', 'test-prod', 'test-integration']
needs: ['test-dev', 'test-prod', 'test-integration', 'test-turbopack-dev']
runs-on: [self-hosted, linux, x64]
name: upload test trace to datadog
# We'll not block the CI if the upload fails
Expand All @@ -157,11 +157,16 @@ jobs:
- uses: actions/download-artifact@v3
with:
name: Test trace reports
path: test/test-junit-report
- run: |
path: test
- name: Upload traces
run: |
ls -al ./test
npm install -g junit-report-merger @datadog/datadog-ci
jrm ./nextjs-test-result-junit.xml "test/test-junit-report/**/*.xml"
DD_ENV=ci datadog-ci junit upload --git-repository-url https://github.com/vercel/next.js --service nextjs ./nextjs-test-result-junit.xml
jrm ./turbopack-test-result-junit.xml "test/turbopack-test-junit-report/**/*.xml"
# Put a separate tag for the tests with turbopack to distinguish between same test names
DD_ENV=ci datadog-ci junit upload --tags type:nextjs --service nextjs ./nextjs-test-result-junit.xml
DD_ENV=ci datadog-ci junit upload --tags type:turbopack --service nextjs ./turbopack-test-result-junit.xml
tests-pass:
needs:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/build_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,7 @@ jobs:
if: ${{ inputs.afterBuild }}
with:
name: Test trace reports
path: test/test-junit-report
path: |
test/test-junit-report
test/turbopack-test-junit-report
if-no-files-found: ignore
6 changes: 5 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ if (shouldEnableTestTrace) {
if (!customJestConfig.reporters) {
customJestConfig.reporters = ['default']
}

const outputDirectory = process.env.__INTERNAL_NEXT_DEV_TEST_TURBO_DEV
? '<rootDir>/turbopack-test-junit-report'
: '<rootDir>/test-junit-report'
customJestConfig.reporters.push([
'jest-junit',
{
outputDirectory: '<rootDir>/test-junit-report',
outputDirectory,
reportTestSuiteErrors: 'true',
uniqueOutputName: 'true',
outputName: 'nextjs-test-junit',
Expand Down
3 changes: 2 additions & 1 deletion test/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.vscode

e2e/**/tsconfig.json
test-junit-report/
test-junit-report/
turbopack-test-junit-report/

0 comments on commit aab383d

Please sign in to comment.