Commit graph

86 commits

Author SHA1 Message Date
Zack Tanner
809164d776
Enable PPR tests for test suites (#59030)
Cherry-picks #58708 without the dependency on https://github.com/vercel/next.js/pull/58779

Co-authored-by: Wyatt Johnson <633002+wyattjoh@users.noreply.github.com>
2023-11-29 03:22:45 +00:00
Leah
25bc6afa1f
fix(ci): exclusion regex now actually works instead of ignoring all tests (#58259) 2023-11-09 21:43:35 +01:00
SADIK KUZU
59f3b6487f
Fix typo in run-tests.js (#57821)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-10-31 14:26:17 -07:00
Sukka
17553c5e25
chore: reduce fs-extra usage in scripts/ (#56917)
The PR follows #56536 and #56491, replacing `fs-extra` usages inside the `scripts/` folder.

Note that the `copy` and `move` haven't been replaced yet. Currently, there is no better recursive copy (lightweight, promise-based, Node.js built-in `copyFile` API-based, support the `filter` option) library alternative available on npm, and Node.js built-in `fs.rename` doesn't support `overwrite`.

The PR also replaces many async fs API usage with their sync versions.

cc @wbinnssmith
2023-10-17 19:31:19 +00:00
Jimmy Lai
62ab0e33a2
ci: add job summary to the test suite runs (#56742)
This PR adds Github Actions summaries to the test suite that runs in the CI so that you can easily visualise which tests failed + what the relevant log was instead of parsing the logs yourself.

Example here https://github.com/vercel/next.js/actions/runs/6495658699

![CleanShot 2023-10-12 at 14 57 32@2x](https://github.com/vercel/next.js/assets/11064311/7d65496b-6e28-460a-8bef-3f2e91266d00)
2023-10-12 13:57:09 +00:00
Tobias Koppers
52356a0e14
invert test filtering logic to exclude known failing (#56663)
### What?

instead of include known passing tests

also updates the update test manifest

### Why?

Newly added test cases should always pass turbopack (or at least you would need to manually opt-out of it.

### How?

Uses a exclude list of tests instead of an allow list

Closes WEB-1752
2023-10-10 18:26:40 +00:00
Justin Ridgewell
efd6b682b8
turbopack: only skip known flakey test cases (#55976)
### What?

A follow up to https://github.com/vercel/next.js/pull/55975, this will
list every flakey test in the turbopack suite so that we can run the
remaining passing tests.

### Why?

More tests is more better.

### How?

Trial and error. Gonna let CI tell me what's flakey with a few runs.

Closes WEB-1651
2023-09-26 16:58:34 +02:00
Justin Ridgewell
b0aecccaa2
Allow filtering individual test cases inside test files (#55786)
### What?

Updates `run-test.js` to allow running individual test cases inside a test file.

### Why?

So that we can dramatically increase Turbopack's test coverage. Turbopack has implemented most (but not all) necessary features from the webpack bundles. But a single failing test case would prevent us from running any case inside a test file. With case filtering, we're able to run the cases we know will pass and prevent regressions on those.

### How?

Case filtering is only exposed via the `NEXT_EXTERNAL_TESTS_FILTERS` ENV, which points to a JSON file containing a map of test files with the test cases inside those files that are known to pass.

The known-passing test cases can be updated after Turbopack's daily integration test run by running `test/build-turbopack-tests-manifest.js`, which will update the `test/turbopack-tests-manifest.json` manifest.

Closes WEB-1640

Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com>
2023-09-22 21:37:48 +00:00
Tobias Koppers
fabab8cf05
improve CI log (#55736)
### What?

* expands the first test failure
* uses an  emoji for visibility
* adds (killed) to killed processes to not confuse them with errors

![image](https://github.com/vercel/next.js/assets/1365881/4735124b-ad76-4664-93ea-b893d41e8abd)


Closes WEB-1623
2023-09-21 15:07:00 +00:00
Zack Tanner
7422109b8e
Run unit tests in a separate job (#55621)
This runs unit tests separate from the `test-dev` task to make it a bit more obvious these are running, and allow for an easy way to add any unit-test specific behavior in the future

[slack x-ref](https://vercel.slack.com/archives/C04DUD7EB1B/p1695150908857269)
2023-09-20 00:34:38 +00:00
Steven
a607deaaf7
chore(ci): emit env vars that impact ci results (#54534)
The values of `NEXT_TEST_MODE` and `HEADLESS` can impact the test results so we should capture these values when CI runs.
2023-08-24 23:12:23 +00:00
OJ Kwon
2e67454ae5
test(ci): refine test suite name unique (#54013)
### What

Pairing PR to https://github.com/vercel/turbo/pull/5714, which I believe last piece to reenable correct datadog test reports for daily next.js integration + turbopack.

1. Creates a unique suite name to avoid collision / merging across different env / grouped test run
2. revert suitename template (which is for _suites_, not _suite_ for top level) as 1 resolves uniqueness
2023-08-14 19:58:56 +00:00
Tobias Koppers
61baae126f
fix Next.rs API (#53456)
### What?

* fixes problems in Next.rs API introduced by #52846 
* adds test infrastructure for experimental turbo testing
* adds two test cases to verify the infrastructure
* add grouping of output logs in run-tests
* simplify template loading

### Why?

### How?
2023-08-02 14:31:52 +02:00
Zack Tanner
3b1ccbf996
additional test runner refactoring (#53406)
This relocates the regex patterns that were being used for `test-dev`, `test-prod`, and `test-integration` actions to be part of `run-tests`. Also fixes e2e tests since they were expected to be found in `e2e` rather than `test/e2e`, and updated it exit with a failure code in case of no tests being found 

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-08-01 00:04:45 +00:00
Zack Tanner
604681912b
ensure colocated unit tests run in CI & fix various failing tests (#53270)
Colocated unit tests (such as ones in `packages/next` and `packages/font`) weren't running in CI since `run-tests` marks the glob cwd as `<root>/tests`. This modifies the working directory to be the root so the new expanded test pattern will pick up files outside of `test/`.

Several of these tests were failing so there are updates in here to fix them. Specifically:

- Source Sans Pro font was renamed to Source Sans 3
- `fillCacheWithDataProperty` test was hitting the `bailOptimistic` code path
- `resolve-metadata` had an invalid assertion (`rel: icon` gets added as part of `IconsMetadata`)
- `resolve-opengraph` wasn't handling undefined images
- `server-patch-reducer` now use inline snapshots as one was failing since it now has a prefetchCache
2023-07-28 13:54:15 +00:00
OJ Kwon
bcb63f3250
ci(workflow): enable test trace upload (#51107)
### What?

WEB-1150. 

This PR is an attempt to upload next.js's test results into datadog test trace to track its status. 

Originally it tried to use automatic trace injection (dd-trace/ci/init). However, due to some of custom environments / setup we use it was not compatible out of the box. Instead, this PR injects a new test reportert to generate junit report, then upload it at once at the end of the testing pipeline.

The reporter is configured to run when necessary variables set, local run should not be affected. 

One thing to note is this report will not count retry results, as it'll create duplicated test entry with multiple results since we runts jest per individual test. This'll allow to detect flaky test easier, but also it means we'll get bit of skewed test results compare to the real world as first failure will be accounted as test fail immediately.
2023-06-12 17:14:13 +00:00
OJ Kwon
534414d54e
ci(workflow): enable test trace again (#50817)
### What?

Another attempt to https://github.com/vercel/next.js/pull/50619 and WEB-1150, trying to apply setup guard more throughly.

I still do not know why original PR passed CI but fails to subsequent PRs after merge, but hope this could be a right guard to prevent unexpected failures.
2023-06-08 10:52:49 +00:00
JJ Kasper
e4b230677c
Add ignores to fix jest-haste failures (#50875)
This pops up occasionally depending on order tests are run and `.next` being present and `jest` trying to process modules inside this folder. 

x-ref: https://github.com/vercel/next.js/actions/runs/5193671295/jobs/9364540542?pr=50869
2023-06-06 22:37:05 +00:00
OJ Kwon
38f7c3bd1b
Revert "ci(workflow): enable datadog traces for the tests" (#50815)
Reverts vercel/next.js#50619

Seeing some weird failure supposed to not occur since we never enabled this 

https://github.com/vercel/next.js/actions/runs/5181685987/jobs/9337538270?pr=50600

Investigating after reverting.
2023-06-05 22:13:06 +00:00
OJ Kwon
2b1f0d9351
ci(workflow): enable datadog traces for the tests (#50619)
### What?

This PR attempts to enable datadog trace integrations to the next.js integration tests if env is configured. With this, datadog can observe each test suite's results and detect some meaningful information (i.e flaky) for us.

However, I wasn't able to verify this works with next.js repo since for some reason CI worker does not pick up the api key in the env (https://vercel.slack.com/archives/C04KC8A53T7/p1685597124894539). Still this won't affect existing workflow, and once enabled I can test it over vercel/turbo repo instead.

Partially resolved WEB-1150.
2023-06-05 20:28:22 +00:00
JJ Kasper
29c2e89bd1
Break up large test suites (#50458)
This breaks up some of our longest running tests which allows more
parallelizing of the tests. This also moves turbopack tests filtering
back to an allow list as it is running a lot of unrelated tests
currently which isn't ideal. We should only be running against tests
that are explicitly testing turbopack e.g. build tests should not be
duplicated in the turbopack group.

```sh
test/integration/css/test/group-1.test.js: 762.655
test/integration/edge-runtime-module-errors/test/index.test.js: 695.309
test/integration/css/test/group-2.test.js: 671.848
test/integration/i18n-support/test/index.test.js: 518.173
test/integration/scss-modules/test/index.test.js: 451.704
test/integration/css-features/test/index.test.js: 417.318
test/integration/css-modules/test/index.test.js: 403.405
test/integration/eslint/test/index.test.js: 381.563
test/integration/500-page/test/index.test.js: 371.134
test/integration/telemetry/test/index.test.js: 367.691
test/development/acceptance-app/ReactRefreshLogBox.test.ts: 335.878
test/integration/create-next-app/templates.test.ts: 334.01
test/integration/scss/test/group-2.test.js: 327.255
test/integration/scss/test/group-1.test.js: 318.574
test/integration/edge-runtime-configurable-guards/test/index.test.js: 313.834
test/e2e/instrumentation-hook/instrumentation-hook.test.ts: 294.618
test/development/acceptance-app/error-recovery.test.ts: 283.355
test/e2e/app-dir/app/vercel-speed-insights.test.ts: 278.242
test/integration/create-next-app/index.test.ts: 272.442
```
2023-05-28 13:59:41 -07:00
JJ Kasper
a3ab542630
Add new build and test workflow (#50436)
This adds new `build and test` and `build and deploy` workflows in favor
of the existing massive `build, test, and deploy` workflow. Since the
new workflows will use `pull_request_target` this waits to remove the
existing workflow until the new one is tested.

While testing this new workflow flakey behavior in tests have also been
addressed. Along with the new workflow we will also be leveraging new
runners which allow us to run tests against the production binary of
`next-swc` so this avoids slight differences in tests we've seen due to
running against the dev binary.

Furthermore we will have a new flow for allowing workflow runs on PRs
from external forks which will either require a comment be checking a
box approving the run after each change or a label added by the team.

The new flow also no longer relies on `actions/cache` or similar which
have proven to be pretty unreliable.

Tests runs with the new workflow can be seen here
https://github.com/vercel/next.js/actions/runs/5100673508/jobs/9169416949
2023-05-27 21:02:31 -07:00
OJ Kwon
2fc0160a26
test(turbopack): run next.js integration tests with denylist (#50172)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation or adding/fixing Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md



## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change



### Why?

### How?

Closes NEXT-
Fixes #

-->

### What?

WEB-1086.

This PR flips the way running next.js integration test with Turbopack,
instead of using allowlist to run selectively enabled test now uses
denylists. The immediate effect is now any new test being added (as a
new file) will be executed with Turbopack by default, and should be
manually excluded if it fails.

Still, the number of tests we run remains same.
2023-05-23 10:55:33 +02:00
OJ Kwon
dd85daaf4e
test(turbopack): script to sync latest test lists (#50008)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation or adding/fixing Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md



## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

This PR adjusts manifests for the next.js test with Turbopack, as I
found upstream test keep changing and need to sync its latests state
into the manifest.

Manifest is now .js file contains 2 arrays, one for the enabled, and
others for the disabled. Disabled doesn't mean it's always failing
though.
2023-05-19 09:10:29 +02:00
OJ Kwon
0dce75f642
ci(test): enable turbopack test (#49466)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation or adding/fixing Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md



## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change



### Why?

### How?

Closes NEXT-
Fixes #

-->

### What?

closees WEB-1019.

As discussed, this PR enables running a set of next.js integration tests
with turbopack as blocking CI check. The tests listed as `enabled` is
considered as stable, that should not fail in any case except upstream
test flakyness.

Current approach is simple as we have only small set of tests and does
not consider it becomes a bottleneck. Adding a test under
https://github.com/vercel/next.js/pull/49466/files#diff-fdc68d6039dbe36607cda253b318cd3598a09a94ccb8994f3695aa1d9e1e404bR2
will makes run with turbopack in the CI. in the future, I'll revise test
suite itself so runner, or test case can mark & execute test with
existing test group / scheduling.
2023-05-09 10:46:54 -07:00
JJ Kasper
1088b3f682
Only create tarballs once per run-tests (#48321)
When our `run-tests` util is used we can safely only create one instance
of the package tarballs and re-use for the tests and then cleaning up at
the end.

Ports changes from testing new workflow
0ceae76bf4
2023-04-12 23:23:59 -07:00
Steven
7d9d7dd41b
chore: reduce noisy logs when updating timing gist (#47446)
Example noisy logs today:
https://github.com/vercel/next.js/actions/runs/4501965165/jobs/7923231538#step:6:130
2023-03-23 11:53:05 -07:00
Jan Kaifer
f3ef4e99b0
Cover 1st-party examples with tests (#45270)Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
We want to make sure that our examples are not breaking.
We don't want to be slowed down by broken 3rd party packages, but we
need to ensure that examples covering next.js features are always green.

Added as a standalone workflow that doesn't parallelize. It will just
run on a cron schedule, so we can check for current status. We can add
Slack ping later if we need to.

The workflow tests just that our examples can build, so mostly TS
issues. We could definitely follow up with actual tests, but that is not
as low-hanging.

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-02-27 11:54:24 +01:00
OJ Kwon
9b91fd5a08
test(integration): emits successful test output for continue on error (#46008)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:
-->

- closes WEB-600
- partially resolves WEB-544

This PR applies minor ergonomics changes to the test runner. First,
allows to emit successful test reports if continue_on_error is enabled:
this allows to track total test stats with --turbo runs. Secondly allows
to specify custom timeouts for the e2e - as written in comment otherwise
it can exceed total 6 hours of job limit due to having lots of
timeout-related failing tests.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ]
[e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-16 15:44:38 -08:00
OJ Kwon
3be1287e7d
test(integration): fix skip retry count logic (#45930)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:
-->

This is improved followup for
https://github.com/vercel/next.js/pull/45914, I realized I applied retry
count logic only for the teardown, not for the actual execution. PR
changes whole retrycount if predicate matches, also changes minor
ergonomics for the turbopack output with custom binary.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ]
[e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

---------
2023-02-14 21:56:08 -08:00
OJ Kwon
3502fca7a1
test(integration): allow to partially skip retry (#45914)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:
-->

Closes WEB-592.

This PR adds a naive checker named `skipRetryTestManifest`, which can be
loaded by env variable. It expects a formed json includes single array -
if it is available and matchs to the path for the failed test, it'll
skip retrying.

Primarily this is supposed to be used in conjunction with
`NEXT_TEST_CONTINUE_ON_ERROR` - when running all of the tests with
turbopack regardless of failure, there are certain set of tests
`expected` to fail currently but it keeps retrying to increase whole
test execution time. Having a known set of test to skip retry
potentially reduce those time.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-02-14 13:30:34 -08:00
OJ Kwon
3d05c13ba4
test(integration): allow to conitnue when test suite fails (#45682)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:
-->

Partially resolves WEB-544.

This PR adds a new detection to the external env variable
`NEXT_TEST_CONTINUE_ON_ERROR`. If those variable is set, even if a suite
of test fails test runner will keep executing remaining tests.

Turbopack (vercel/turbo) runs Next.js integration tests to track its
feature parity to the existing Next.js features and currently it is
expected to fail on certain test: however, we still want to execute all
of the tests to track how many tests are passing / fails.

Once this change lands turbopack need further verification to see if all
of tests are actually running.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ]
[e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-07 17:51:54 -08:00
JJ Kasper
434a8cb7d0
Fix missing hasHeader mock during revalidate (#45681)
Replaces usage of `hasHeader` of `getHeader` and also ensures we include
`hasHeader` in our `mockRes` we create during revalidate for good
measure.

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

Closes: https://github.com/vercel/next.js/issues/34929
Closes: https://github.com/vercel/next.js/issues/37338
Closes: https://github.com/vercel/next.js/issues/45481
2023-02-07 17:51:26 -08:00
Jan Kaifer
d022ccb432
Clean up CI logs (#45171) 2023-02-02 15:46:17 +00:00
JJ Kasper
d5a188de06
Update test env variable passing (#44912) 2023-01-15 23:20:16 -08:00
JJ Kasper
c2e0271c33
Use test timings token when available (#44549)
This request occasionally gets a `403` response most likely from rate
limiting inside of GitHub actions so this attempts to increase our rate
limits by using the test timings token when available.

x-ref:
https://github.com/vercel/next.js/actions/runs/3833572871/jobs/6525160878
x-ref:
https://github.com/vercel/next.js/actions/runs/3833158940/attempts/1
2023-01-03 15:36:59 -08:00
JJ Kasper
50857dad46
Fix isolated tests on windows and update azure config (#44457)
Fixes handling in isolated tests for windows and adds initial setup to run the main `app-dir` test suite. Also adds retrying when fetching test timings fails due to rate limiting. 

Closes: https://github.com/vercel/next.js/pull/44331
2022-12-31 08:12:42 +00:00
Jan Kaifer
ab328c6c39
Add tracing for testing tools (#44046) 2022-12-16 09:58:04 +01:00
JJ Kasper
295f15e057
Fix test retry cleanup (#43011)
As noticed in
https://github.com/vercel/next.js/pull/42966#pullrequestreview-1181705091
we weren't resetting tests correctly on retry causing an incorrect pass.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-11-16 13:16:35 -08:00
Jaril
06607e3dd1
Add Replay integration for dev e2e tests (#40955)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

@ijjk moving this here.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-09-29 14:45:10 -07:00
JJ Kasper
070239e666
Revert "Merge e2e test node_modules (#40926)" (#40974)
This reverts commit b508fef218.

Fixes: https://github.com/vercel/next.js/actions/runs/3139454323/jobs/5100342131

We aren't able to modify the filesystem for E2E deployments so this reverts the change introduced in the above PR to ensure deployment tests are able to run correctly with custom `node_modules`.
2022-09-28 08:08:46 +00:00
Jiachi Liu
b508fef218
Merge e2e test node_modules (#40926)
Merge e2e tests customized `node_modules` with installed `node_modules`,
to let you debug easily locally without moving folder between
`node_modules` and `node_modules_bak`

Also add `optoutServerComponentsBundle` to config schema.
2022-09-27 15:18:08 +02:00
JJ Kasper
f00aef4bf7
Update test failure logging (#39655)
This attempts to address the missing log outputs noticed in the below test run.
x-ref: https://github.com/vercel/next.js/runs/7839842437?check_suite_focus=true
2022-08-16 15:14:37 +01:00
JJ Kasper
2722876eb5
Add delay before exiting tests for log flushing (#39302) 2022-08-03 15:48:17 -05:00
JJ Kasper
889481e85f
Update delayed test output handling (#39078) 2022-07-27 11:41:42 -05:00
JJ Kasper
a4abc1e77d
Expose test timings token for e2e tests (#37756)
* Expose test timings token for e2e tests

* update flake
2022-06-16 11:56:43 -05:00
JJ Kasper
f7b81316ae
Update to leverage pnpm for monorepo (#37259)
* Update to leverage pnpm for monorepo

* update compiled

* update stats action

* update ci install step

* update ci

* add test dep

* update invoking scripts

* update caching

* skip cache for now

* update dep

* update packages and fix babel

* update compiled

* update lint

* update test

* update ci

* update pnpm store caching

* update path for windows

* update restore-key config

* update caching

* remove extra build azure stage

* re-add checkout

* update setting pnpm store

* bump

* remove azure caching as pnpm is faster to download

* update contributing

* apply suggestions

* remove install-peers

* prepublish -> prepublishOnly

* prepublish -> prepublishOnly more

* more yarn -> pnpm references

* more yarn -> pnpm references take 2

* use workspace protocol for root package.json

Co-authored-by: Steven <steven@ceriously.com>
2022-05-28 23:35:16 -05:00
JJ Kasper
81850eb295
Update deploy E2E test setup (#37126)
* Update deploy E2E test setup
2022-05-23 17:37:21 -05:00
JJ Kasper
e148d2bdbd
Continue testing react v17 with e2e tests (#35787)
* Continue testing react v17 with e2e tests

* update react 17 expected error

* Update env variable name and add log

* fix starter cache version

* remove extra setup condition

* Revert "remove extra setup condition"

This reverts commit 5760a9f8867213f95a9fac073fe27a9ec01b780f.

* update basepath test

* remove log

* stabilize test
2022-03-31 17:35:00 -05:00
Tim Neutkens
62bb3482fe
Fix Fast Refresh for React 18 (#35718)
- Updates the React 18 test suite to the latest React version.
- Upgrade `react-refresh` module

Fixes #35518
Fixes #35703

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`


Co-authored-by: Jiachi Liu <4800338+huozhi@users.noreply.github.com>
2022-03-30 12:16:17 +00:00