Commit Graph

83 Commits

Author SHA1 Message Date
Trek Glowacki
866d0c173d [tests] remove unused opts.skipTeam (#11650)
I can't find this being used anywhere.
2024-05-23 15:25:04 -05:00
Sean Massa
b09d7b6130 [tests] allow errors to define retry delay (#11597)
Errors can now define their own retry delay. This is necessary for some
kinds of errors where all retries will run within the same second.
2024-05-14 14:15:31 -05:00
Sean Massa
722adf0e10 some errors can specify retries (#11581)
Trying a different approach to retrying errors when logs must contain a value.

Alternative to: https://github.com/vercel/vercel/pull/11577
2024-05-10 22:19:10 +00:00
Jeff See
4c018d4b78 Add retry logic for when a probe finds the Vercel preview page (#11473)
We sometimes fail a probe check because we're still seeing this page:

<img width="1086" alt="Screenshot 2024-04-19 at 3 11 17 PM" src="https://github.com/vercel/vercel/assets/5414297/8bc92b2d-d720-4970-8f72-7804bb4e91ce">

This just adds some retry logic before proceeding. If we still see the page after 10 tries it errors
2024-04-23 17:58:53 +00:00
Nathan Rajlich
3e57c4a2de [tests] Remove disableSSO() function (#11380)
The SSO Protection feature is now turned off by default for testing accounts. So this manual logic for disabling the feature on each project test fixture is no longer necessary.
2024-04-06 07:47:56 +00:00
Nathan Rajlich
c82a55c460 [tests] Use AL2 build container for relevant e2e tests (#11329)
* Forces the AL2 build container image for fixtures that depend on it,
via `engines.node` in package.json for most cases.
* The `testDeployment()` function was updated to send
`projectSettings.nodeVersion` in the POST body, to mimic the behavior in
CLI.
* For Go, Ruby, and Python tests, the `projectSettings.nodeVersion`
property is set "globally" in the Jest setup file, so that individual
fixtures didn't need to be adjusted.
2024-03-27 12:19:30 -07:00
Wyatt Johnson
b1d8b83abb [next] Support pre-generated pages without fallbacks with Partial Prerendering (#11183) 2024-03-01 18:29:31 -07:00
JJ Kasper
0da7ea7b78 Add retry handling when hitting SSO (#11061)
This aims to reduce flakiness when SSO disabling for a test project is
still disabling/propagating.

x-ref:
https://github.com/vercel/vercel/actions/runs/7563953104/job/20597320056?pr=11059
x-ref:
https://github.com/vercel/vercel/actions/runs/7563953104/job/20597322078?pr=11059

---------

Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2024-01-18 13:17:49 -08:00
Wyatt Johnson
fd29b966d3 tests: added tests for PPR (#10808)
This adds some tests to the PPR implementation for Next.js. This also
fixes a bug where the static pages were incorrectly generating a header
that falsly indicated that it postponed.
2023-11-08 09:21:51 -07:00
JJ Kasper
7b553c7032 Disable deployment SSO protection for tests (#10799)
Our tests rely on not being behind deployment protection which is now enabled by default so this adds a step to tests to disable this setting to allow tests to continue working as expected.
2023-11-07 05:04:29 +00:00
Zack Tanner
c3c54d6e69 [next]: Fix RSC rewrite behavior (#10415)
- Removes some of the hacks from #10388 that were attempting to resolve an issue with RSC prefetches to `pages` routes in favor of adding rsc rewrites for all dynamic paths, and letting it fall through to a 404 if there's no match
- Fixes an issue where RSC requests were matching the wrong path (filesystem rather than RSC variant) introduced in above mentioned change
  - Closes https://github.com/vercel/next.js/issues/54698
2023-09-07 14:03:14 +00:00
Chris Barber
6cdd38d130 [tests] Pin Next.js version in test fixtures (#9910)
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2023-05-19 09:06:08 -05:00
Chris Barber
65a6e713c8 [node] Fix ESM dependency support (#9692) 2023-04-26 12:23:43 -05:00
Sean Massa
4c77dab5cb [tests][cli] convert CLI integration tests to TS (#9672)
Converts the CLI integration tests to TypeScript. This will make it easier to pick apart the test pollution.
2023-03-18 18:21:45 +00:00
Sean Massa
e210977a9c [tests] update python tests to use zero config (#9668)
This PR is some cleanup before splitting python e2e tests.

Changes:

- use `probes.json`
- use `/api` autodetection instead of `builds` array

---

I was also trying to figure out why these tests are so much faster when run locally (293s) vs. CI (1099s). I encountered issues trying to view the build logs for the deployments that are made.
2023-03-16 14:41:40 +00:00
Steven
bada86b8d6 [tests] Add prettier check (#9664)
This PR fixes the formatting on several files that were never run through `prettier`.

It also makes sure to run `prettier` in CI to to [fail fast](https://github.com/vercel/vercel/actions/runs/4408442998/jobs/7723453978) when the incorrect formatting is attempted.
2023-03-13 19:55:59 +00:00
JJ Kasper
53cab61e88 [next] Fix deploying with cached build (#9555)
This leverages the relative app dir field in the required files manifest when available so that we don't rely on absolute paths from a cached build since the cache can be restored in a separate context where the value no longer applies.

x-ref: https://github.com/vercel/next.js/pull/45864
x-ref: https://github.com/vercel/next.js/pull/46393
x-ref: https://github.com/vercel/next.js/discussions/39432#discussioncomment-4914549
x-ref: [slack thread](https://vercel.slack.com/archives/C03S8ED1DKM/p1675821643786319)
2023-02-25 02:46:06 +00:00
Nathan Rajlich
48eed7532a [tests] Properly test for multiple headers with same name in probes (#9538)
Updates the `responseHeaders` probe checks to properly test for multiple headers with the same name.

Previously the probes were using `headers.get()` which concats multiple headers into a single string, which results in the test not really checking if there are in fact multiple headers with the same name. Using `headers.raw()` allows us to properly test for that.

A couple of Python tests that were already checking for multiple `set-cookie` headers needed to be updated to match the full value, since the check now properly validates the full string match of each header (before it was basically just doing a `string.includes()` check).

This is a precursor for https://github.com/vercel/vercel/pull/9533.
2023-02-24 22:07:00 +00:00
Marc Greenstock
1c8b4717e3 [ruby] fix: HEAD requests (#9436)
When WEBrick receives `HEAD` requests it discards the body (i.e.
`req.body.nil? => true`), this causes Vercel to throw a
`BODY_NOT_A_STRING_FROM_FUNCTION` since it is expecting the serverless
function to respond with a string in the body.

---------

Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Steven <steven@ceriously.com>
2023-02-16 16:41:56 -05:00
Steven
8f49969585 [tests] Update tests script names (#9433)
### Description 

These script names are currently really long and that makes it difficult
to read.

In particular, the most important part (the package name) is often
truncated.

See before/after below.

## Before

<img width="302" alt="image"
src="https://user-images.githubusercontent.com/229881/218588978-b8ed9a7a-f4da-4d58-af3f-2b1a7087737d.png">

## After

<img width="290" alt="image"
src="https://user-images.githubusercontent.com/229881/218596895-65627ad0-2895-4bd7-8506-f5f545a419d3.png">
2023-02-14 10:31:46 -05:00
Nathan Rajlich
a7a5bf1a12 [tests] Pass in builder to runBuildLambda() (#9262)
Removes the need for `next`/`static-build` to be present in the root `package.json` file.
2023-01-19 15:10:06 -08:00
Ethan Arrowood
02feb564a7 [static-build][fs-detectors] add gatsby builder plugin injection (#9252)
Modifies the `@vercel/static-build` injection logic in order to now inject both the analytics and builder gatsby plugins.
2023-01-19 03:34:47 +00:00
Nathan Rajlich
301bcf58fb [node-bridge] Support streaming response for Serverless Function (#8795)
Adds streaming response support for React Server Components with Next 13.
2022-11-02 02:16:37 +00:00
JJ Kasper
f5486a8297 [next] Update to route app rsc paths correctly (#8611)
### Related Issues

x-ref: [slack thread](https://vercel.slack.com/archives/C035J346QQL/p1663799417151099)

Failing probes are unrelated, more info can be seen in [this thread](https://vercel.slack.com/archives/C035J346QQL/p1663820032810519?thread_ts=1663775935.504379&cid=C035J346QQL)
2022-09-22 20:44:40 +00:00
Mark Glagola
225e0a4de3 [tests] Use new VERCEL_TEST_TOKEN for tests (#8614)
Use `VERCEL_TEST_TOKEN` for tests
2022-09-22 16:07:43 -04:00
Steven
3856623785 [build-utils] Prefix debug message (#8378)
This PR adds `VERCEL_DEBUG_PREFIX` environment variable which lets you set a prefix for the debug logs.
2022-08-24 18:50:20 +00:00
Steven
1c14e945f9 [tests] Reduce test logs (#8455)
This PR reduces the noisy test logs that currently look like this:

<img width="1013" alt="image" src="https://user-images.githubusercontent.com/229881/186479890-e954ca9c-782e-49b8-89e7-6409185bb490.png">
2022-08-24 14:00:10 -04:00
Steven
bfc553db11 [tests] Add support for probes.json (#8279)
Previously, our test fixtures used to use a probes prop in `vercel.json` that was removed right before it was deployed.

This PR allows a separate `probes.json` file with the same content to separate the test fixture input from the test probes.

This allows us to test real "zero config" deployments without a `vercel.json` file.
2022-08-03 20:15:50 -04:00
Steven
b5b792e42f [tests] Update tests to run with vercel cli tarball (#8257)
This PR update the tests suite to wait for Vercel CLI tarball and then use that tarball to run E2E tests.

This is valuable because it will package all the packages in this monorepo to make the tests follow more closely what will happen in production once merged.

Since the current "Find Changes" step takes about 2 minutes, we run that first (it happens concurrently with the tarball preparation). Then once we complete "Find Changes" we wait for the tarball but it will likely be ready by that point since it also takes about 2 minutes. After both of those steps, the E2E tests continue as usual but with the `VERCEL_CLI_VERSION` set to the tarball.

- Related to #7967 
- Closes #8245 
- Closes #8227
2022-07-27 17:56:03 -04:00
Steven
afd303b94a [tests] Fix turbo cache for test changes (#8246)
When we make changes in `test/lib/**`, it should run all the E2E tests again for every package.

https://turborepo.org/docs/reference/configuration
2022-07-25 17:14:33 -04:00
JJ Kasper
0ad7fd34f4 [next][node][redwood][remix] Update @vercel/nft to 0.21.0 (#8208)
### Related Issues

Updates to the latest version of `@vercel/nft` which adds fs concurrency limits to help alleviate memory usage. 

x-ref: https://github.com/vercel/nft/pull/301

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [ ] The code changed/added as part of this PR has been covered with tests
- [ ] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2022-07-22 00:45:53 +00:00
JJ Kasper
8cf67b549b [next] Ensure manifests are specific to the included pages (#8172)
### Related Issues

This updates to filter the `routes-manifest` and `pages-manifest` to only include entries for the pages that are being included in the specific serverless function. This fixes the case where multiple dynamic routes could match a path but one is configured with `fallback: false` so shouldn't match when executing for a different dynamic route. 

A regression test for this specific scenario has been added in the `00-mixed-dynamic-routes` fixture. 

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [ ] The code changed/added as part of this PR has been covered with tests
- [ ] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2022-07-20 23:06:44 +00:00
Steven
18c19ead76 [tests] Upgrade python tests to 3.9 (#8181)
New python 3.6 deployments will fail today per the previous announcement https://vercel.com/changelog/python-3-6-is-being-deprecated

This PR updates the tests to use python 3.9 instead.
2022-07-19 17:43:20 +00:00
JJ Kasper
967c24f1bb [next] Ensure trailing slash is handled while resolving _next/data rewrites (#8015)
* Ensure trailing slash is handled while resolving _next/data rewrites

* update regex
2022-06-25 12:39:30 -05:00
Nathan Rajlich
6855e3df54 [tests] Allow for multiple probes (#7957)
The `probes` in the vercel.json files in tests fixtures weren't allowing both `mustContain` _and_ `responseHeaders` probes due to an `else` block. This PR allows to combine those checks into the same probe test.
2022-06-14 06:54:16 +00:00
Sean Massa
e0900128d6 [cli][client][tests] update to node14-compatible target (drop support for node12) (#7865)
Node 12 is EOL and we're starting to reference packages that don't install on node lower than 14, such as nuxt@3 and remix. Let's update to 14 for now.

---

Reimplements: https://github.com/vercel/vercel/pull/7819
2022-06-02 19:01:34 +00:00
Nathan Rajlich
fbd9080859 [tests] Add vc build integration test (#7876)
[cli] Add `vc build` integration test

Adds a `vc build` integration test to ensure the ncc'd CLI works as
expected to supplement the unit tests from #7869.

Co-authored-by: Steven <steven@ceriously.com>
2022-05-26 15:05:31 -04:00
Sean Massa
a5a990995c [tests] improve error message when a deploy fails (#7864)
improve error message
2022-05-23 17:02:29 -05:00
Nathan Rajlich
5a7851a7f7 [tests] Revert "update CI to use node@14 and drop support for node@12 (#7819)" (#7853)
Revert "[tests] update CI to use node@14 and drop support for node@12 (#7819)"

This reverts commit 89b5aad367.
2022-05-21 20:11:08 -07:00
Sean Massa
89b5aad367 [tests] update CI to use node@14 and drop support for node@12 (#7819)
Node 12 is EOL and we're starting to reference packages that don't install on node lower than 14, such as nuxt@3 and remix. Let's update to 14 for now.
2022-05-21 05:20:43 +00:00
JJ Kasper
0f720472c4 [cli] Migrate Dev tests from ava to jest (#7822)
* Migrate ava cli dev tests to jest

* remove outdated test

* update tests

* Update utils

* update stdio to fix stalling

* test stdio tests

* add debug logs

* more logs

* use strip ansi

* update

* add exit flag and fix next dev test

* update timeout for mac ci

* update cancel

* update cancel tests.yml -> test.yml

* update other ids -> names

* remove outdated test

* de-dupe scripts

* remove redwood dev test due to size
2022-05-19 14:01:13 -05:00
Nathan Rajlich
acd756436c [node] Fix 11-symlinks integration test fixture (#7823)
The `symlink` symlink wasn't being persisted through Turbo's cache,
so this test was failing. So move the symlink directly into the git repo
since there's no need to create it at build-time (git can store symlinks
just fine).

Additionally, the test itself was not testing that the symlink was indeed
re-created as a symlink from within the lambda environment (it actually
wasn't, due to the upload code not considering symlinks), so the test
has been updated to test for that as well.
2022-05-18 22:04:58 -07:00
Nathan Rajlich
623e43f865 [next] Add @vercel/next Builder (#7793) 2022-05-18 23:51:48 +00:00
CommanderRoot
d2ba06c6cb [examples][cli][routing-utils][static-build] replace deprecated String.prototype.substr() (#7588)
.substr() is deprecated so we replace it with .slice() or substring() which aren't deprecated
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>

Co-authored-by: Steven <steven@ceriously.com>
2022-03-24 17:03:40 -04:00
Steven
81ea0082f1 [python] Upgrade python 3.9 (#7008)
* [python] Upgrade python 3.9

* Fix python path

* Improve testing

* Add support for version selection via Pipfile

* Parse the "Pipfile.lock" instead

* Fix support for Node.js 12
2021-11-19 13:42:17 -05:00
Nathan Rajlich
3cf155e999 [tests] Retry fetch upon "ECONNREFUSED" (#5635)
CI failed due to this error code, which can be retried.
2021-01-04 16:06:28 -08:00
JJ Kasper
6d6ccbdc25 [tests] Add retrying for GitHub actions connection error (#5533)
Follow-up to https://github.com/vercel/vercel/pull/5526 this also adds retrying for fetch connection issues in GitHub Actions to prevent false test failures.

x-ref: https://github.com/vercel/vercel/runs/1518604380
2020-12-09 21:11:01 +00:00
JJ Kasper
c02dc9ac49 [next] Add public dir check and update tests (#5526)
* Add public dir check and update tests

* De-dupe test checks a bit
2020-12-08 10:25:55 -05:00
JJ Kasper
0f42a63c03 [next] Ensure correct route order for i18n + custom-routes (#5421)
Co-authored-by: Steven <steven@ceriously.com>
2020-11-14 17:13:08 -05:00
Steven
5c3cd17074 [tests] Cache token when possible (#5179)
This PR solves an issue where tests would sometimes be rate limited when generating a token. This can be solved by caching the token like we do for E2E tests.

Example failure: https://github.com/vercel/vercel/runs/1098030228#step:11:9376

I also update the `@vercel/node` tests to compare the error message, exactly like how we do it with `@vercel/static-build`.
2020-09-11 10:02:07 -04:00