Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Jun 1, 2023
1 parent fa076a3 commit 1926edb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_and_test.yml
Expand Up @@ -20,6 +20,7 @@ env:
TURBO_TEAM: 'vercel'
TURBO_REMOTE_ONLY: 'true'
NEXT_TELEMETRY_DISABLED: 1
DATADOG_API_KEY: ${{ secrets.DATA_DOG_API_KEY }}
# we build a dev binary for use in CI so skip downloading
# canary next-swc binaries in the monorepo
NEXT_SKIP_NATIVE_POSTINSTALL: 1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build_reusable.yml
Expand Up @@ -43,6 +43,7 @@ env:
NEXT_SKIP_NATIVE_POSTINSTALL: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
NEXT_TEST_JOB: 1
DATADOG_API_KEY: ${{ secrets.DATA_DOG_API_KEY }}

jobs:
build:
Expand Down
13 changes: 13 additions & 0 deletions run-tests.js
Expand Up @@ -322,6 +322,18 @@ async function main() {

const shouldRecordTestWithReplay = process.env.RECORD_REPLAY && isRetry

const traceEnv = process.env.DATADOG_API_KEY ? {
DD_API_KEY: process.env.DATADOG_API_KEY,
DD_CIVISIBILITY_AGENTLESS_ENABLED: 'true',
DD_ENV: 'ci',
DD_SERVICE: 'nextjs',
NODE_OPTIONS: !!process.env.DATADOG_API_KEY
? '-r dd-trace/ci/init'
: undefined,
} : {}

console.log('---------------------------', !!process.env.DATADOG_API_KEY)

const child = spawn(
jestPath,
[
Expand All @@ -341,6 +353,7 @@ async function main() {
stdio: ['ignore', 'pipe', 'pipe'],
env: {
...process.env,
...traceEnv,
RECORD_REPLAY: shouldRecordTestWithReplay,
// run tests in headless mode by default
HEADLESS: 'true',
Expand Down

0 comments on commit 1926edb

Please sign in to comment.