Skip to content

Commit

Permalink
retire replay-io
Browse files Browse the repository at this point in the history
  • Loading branch information
gaojude committed Nov 27, 2024
1 parent 2c546bb commit e6d8358
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 685 deletions.
11 changes: 0 additions & 11 deletions contributing/core/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,6 @@ and then inspected with `pnpm playwright show-trace ./path/to/trace`

Add `NEXT_TEST_TRACE=1` to enable test profiling. It's useful for improving our testing infrastructure.

### Recording the browser using Replay.io

Using [Replay.io](https://www.replay.io/) you can record and time-travel debug the browser.

1. Clear all local replays using `pnpm replay rm-all`
2. Run the test locally using the `RECORD_REPLAY=1` environment variables.
(e.g. `RECORD_REPLAY=1 pnpm test-dev test/e2e/app-dir/app/index.test.ts`)
3. Upload all the replays to your workspace using your API key:
`RECORD_REPLAY_API_KEY=addkeyhere pnpm replay upload-all`
4. Check the uploaded replays in your workspace, while uploading it provides the URLs.

### Testing Turbopack

To run the test suite using Turbopack, you can use the `TURBOPACK=1` environment variable:
Expand Down
4 changes: 0 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ const customJestConfig = {
prettierPath: require.resolve('prettier-2'),
}

if (process.env.RECORD_REPLAY) {
customJestConfig.testRunner = '@replayio/jest/runner'
}

// Check if the environment variable is set to enable test report,
// Insert a reporter to generate a junit report to upload.
//
Expand Down
18 changes: 0 additions & 18 deletions jest.replay.config.js

This file was deleted.

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@
"@next/third-parties": "workspace:*",
"@opentelemetry/api": "1.4.1",
"@picocss/pico": "1.5.10",
"@replayio/jest": "27.2.35",
"@replayio/playwright": "1.1.8",
"@replayio/replay": "0.20.1",
"@svgr/webpack": "5.5.0",
"@swc/cli": "0.1.55",
"@swc/core": "1.6.13",
Expand Down
606 changes: 0 additions & 606 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions run-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,12 +451,7 @@ ${ENDGROUP}`)
const start = new Date().getTime()
let outputChunks = []

const shouldRecordTestWithReplay = process.env.RECORD_REPLAY && isRetry

const args = [
...(shouldRecordTestWithReplay
? [`--config=jest.replay.config.js`]
: []),
...(process.env.CI ? ['--ci'] : []),
'--runInBand',
'--forceExit',
Expand Down Expand Up @@ -489,8 +484,6 @@ ${ENDGROUP}`)
? {}
: {
IS_RETRY: isRetry ? 'true' : undefined,
RECORD_REPLAY: shouldRecordTestWithReplay,

TRACE_PLAYWRIGHT:
process.env.NEXT_TEST_MODE === 'deploy' ? undefined : 'true',
CIRCLECI: '',
Expand Down
23 changes: 0 additions & 23 deletions test/lib/browsers/replay.ts

This file was deleted.

16 changes: 3 additions & 13 deletions test/lib/next-webdriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,9 @@ export default async function webdriver(
pushErrorAsConsoleLog,
} = options

// we import only the needed interface
if (
process.env.RECORD_REPLAY === 'true' ||
process.env.RECORD_REPLAY === '1'
) {
const { Replay, quit } = await require('./browsers/replay')
CurrentInterface = Replay
browserQuit = quit
} else {
const { Playwright, quit } = await import('./browsers/playwright')
CurrentInterface = Playwright
browserQuit = quit
}
const { Playwright, quit } = await import('./browsers/playwright')
CurrentInterface = Playwright
browserQuit = quit

const browser = new CurrentInterface()
const browserName = process.env.BROWSER_NAME || 'chrome'
Expand Down

0 comments on commit e6d8358

Please sign in to comment.