Add note about test-trace artifact to test readme (#38770)

* Add note about test-trace artifact to test readme

* Add link to valid test modes
This commit is contained in:
JJ Kasper 2022-07-18 13:01:37 -05:00 committed by GitHub
parent aa664868c1
commit f004868706
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,3 +29,8 @@ There are some test specific environment variables that can be used to help debu
- When investigating failures in isolated tests you can use `NEXT_TEST_SKIP_CLEANUP=1` to prevent deleting the temp folder created for the test, then you can run `pnpm next` while inside of the temp folder to debug the fully setup test project.
- You can also use `NEXT_SKIP_ISOLATE=1` if the test doesn't need to be installed to debug and it will run inside of the Next.js repo instead of the temp directory, this can also reduce test times locally but is not compatible with all tests.
- The `NEXT_TEST_MODE` env variable allows toggling specific test modes for the `e2e` folder, it can be used when not using `pnpm test-dev` or `pnpm test-start` directly. Valid test modes can be seen here: https://github.com/vercel/next.js/blob/aa664868c102ddc5adc618415162d124503ad12e/test/lib/e2e-utils.ts#L46
## Debugging
When tests are run in CI and a test failure occurs we attempt to capture traces of the playwright run to make debugging the failure easier. A test-trace artifact should be uploaded after the workflow completes which can be downloaded, unzipped, and then inspected with `pnpm playwright show-trace ./path/to/trace`