@cnc-tools/storm 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/application.js +5 -1
- package/dist/bin/storm.js +6 -2
- package/dist/build-info.js +1 -1
- package/dist/chunks/{chunk-N7E6DAUE.js → chunk-27P2QSIM.js} +1 -1
- package/dist/chunks/{chunk-ZDJLKF2G.js → chunk-5ED3IDUJ.js} +7 -4
- package/dist/chunks/{chunk-6EQKA7LI.js → chunk-5TMHYH7G.js} +1 -1
- package/dist/chunks/{chunk-AX4EQZUS.js → chunk-BFLYGMG3.js} +12 -7
- package/dist/chunks/{chunk-LQKNI3EG.js → chunk-BRUIATTR.js} +6 -6
- package/dist/chunks/{chunk-DOFB2ACU.js → chunk-HOKDKP5A.js} +1 -1
- package/dist/chunks/{chunk-EGNP3S6C.js → chunk-IVRRGGCD.js} +60 -20
- package/dist/chunks/{chunk-RTILVSYQ.js → chunk-QBR5VHJ7.js} +1 -1
- package/dist/chunks/{chunk-YT5OROR7.js → chunk-RA4L2ACU.js} +12 -2
- package/dist/chunks/{chunk-YGS5VRQT.js → chunk-RKONDLPS.js} +8 -5
- package/dist/chunks/{chunk-IYM44FUX.js → chunk-UC6DULWY.js} +2 -2
- package/dist/chunks/{chunk-2NZXL6OH.js → chunk-XPCUINWS.js} +1 -1
- package/dist/chunks/{chunk-Q4TKRILH.js → chunk-YBPTMJUM.js} +98 -21
- package/dist/chunks/{chunk-5UMJNVKT.js → chunk-Z5OXOZD3.js} +125 -83
- package/dist/chunks/{chunk-X4WBJIOF.js → chunk-ZH5R7W4A.js} +1 -1
- package/dist/chunks/{live-app-QFHS54SX.js → live-app-FBVWUUMT.js} +7 -7
- package/dist/commands/exec/command.d.ts +2 -0
- package/dist/commands/exec/command.js +15 -41
- package/dist/commands/exec/define-run-command.d.ts +17 -10
- package/dist/commands/exec/define-run-command.js +48 -15
- package/dist/commands/exec/driver-plan.d.ts +24 -16
- package/dist/commands/exec/driver-plan.js +34 -15
- package/dist/commands/exec/driver-refusals.js +7 -6
- package/dist/commands/exec/exec-words.d.ts +1 -1
- package/dist/commands/exec/exec-words.js +8 -2
- package/dist/commands/exec/final-results.d.ts +39 -0
- package/dist/commands/exec/final-results.js +29 -0
- package/dist/commands/exec/metadata.js +1 -1
- package/dist/commands/exec/outcomes.d.ts +13 -3
- package/dist/commands/exec/outcomes.js +21 -4
- package/dist/commands/exec/plan-run.d.ts +11 -3
- package/dist/commands/exec/plan-run.js +3 -2
- package/dist/commands/exec/run-command.d.ts +1 -1
- package/dist/commands/exec/run-command.js +27 -5
- package/dist/commands/exec/test-plan.d.ts +2 -1
- package/dist/commands/exec/test-plan.js +13 -4
- package/dist/commands/exec/tests-summary.d.ts +2 -2
- package/dist/commands/exec/worker-chart.d.ts +1 -1
- package/dist/commands/playwright/command.d.ts +10 -7
- package/dist/commands/playwright/command.js +14 -14
- package/dist/commands/playwright/metadata.js +2 -2
- package/dist/commands/runs/list/command.js +6 -6
- package/dist/commands/runs/logs/command.js +6 -6
- package/dist/commands/runs/show/command.d.ts +2 -2
- package/dist/commands/runs/show/command.js +11 -11
- package/dist/commands/runs/show/outcomes.d.ts +1 -1
- package/dist/commands/snapshots/build/command.js +12 -12
- package/dist/commands/snapshots/list/command.js +9 -9
- package/dist/commands/vitest/command.d.ts +12 -8
- package/dist/commands/vitest/command.js +14 -14
- package/dist/commands/vitest/metadata.js +2 -2
- package/dist/config/resolve.d.ts +1 -1
- package/dist/config/resolve.js +2 -1
- package/dist/config/schema.d.ts +8 -0
- package/dist/config/schema.js +5 -4
- package/dist/extensions/playwright/driver.js +17 -10
- package/dist/extensions/testserver/commands/pool/create/command.js +4 -4
- package/dist/extensions/testserver/commands/pool/list/command.js +2 -2
- package/dist/extensions/testserver/definition.d.ts +1 -1
- package/dist/extensions/testserver/extension.d.ts +1 -1
- package/dist/extensions/testserver/options/rules.d.ts +3 -3
- package/dist/extensions/testserver/options/rules.js +5 -5
- package/dist/extensions/testserver/resource.d.ts +1 -1
- package/dist/extensions/testserver/vercel-cli/index.d.ts +1 -0
- package/dist/extensions/testserver/vercel-cli/index.js +1 -0
- package/dist/extensions/testserver/vercel-cli/report.js +5 -2
- package/dist/extensions/testserver/vercel-cli/session-id.d.ts +8 -0
- package/dist/extensions/testserver/vercel-cli/session-id.js +16 -0
- package/dist/extensions/testserver/vitest/config.d.ts +2 -2
- package/dist/extensions/testserver/vitest/config.js +2 -2
- package/dist/extensions/testserver/vitest/container-scope.d.ts +25 -16
- package/dist/extensions/testserver/vitest/container-scope.js +32 -13
- package/dist/extensions/testserver/vitest/diagnostics.d.ts +5 -4
- package/dist/extensions/testserver/vitest/diagnostics.js +15 -8
- package/dist/extensions/testserver/vitest/fixtures.d.ts +10 -1
- package/dist/extensions/testserver/vitest/fixtures.js +36 -10
- package/dist/extensions/testserver/vitest/types.d.ts +9 -0
- package/dist/extensions/vitest/driver.js +28 -14
- package/dist/extensions/vitest/plan/gateways.d.ts +28 -5
- package/dist/extensions/vitest/plan/gateways.js +2 -2
- package/dist/extensions/vitest/plan/list-output.d.ts +5 -0
- package/dist/extensions/vitest/plan/list-output.js +23 -9
- package/dist/extensions/vitest/plan/live/list-gateway.d.ts +3 -2
- package/dist/extensions/vitest/plan/live/list-gateway.js +77 -64
- package/dist/extensions/vitest/plan/plan-over.d.ts +19 -7
- package/dist/extensions/vitest/plan/plan-over.js +18 -7
- package/dist/extensions/vitest/plan/plan.d.ts +14 -5
- package/dist/extensions/vitest/plan/plan.js +23 -9
- package/dist/extensions.d.ts +2 -2
- package/dist/run-directory/plan.d.ts +3 -2
- package/dist/run-directory/plan.js +6 -3
- package/dist/run-directory/run-record.d.ts +4 -3
- package/dist/runner/recipe.d.ts +5 -1
- package/dist/runner/sandboxed-command.d.ts +5 -3
- package/dist/runner/sandboxed-command.js +10 -4
- package/dist/sdk/extension/driver.d.ts +32 -6
- package/dist/sdk/extension/driver.js +12 -2
- package/dist/sdk/extension/index.d.ts +1 -1
- package/dist/sdk/extension/index.js +2 -1
- package/dist/sdk/extension/resource-definition.d.ts +6 -5
- package/dist/vendor/testserver-sdk/container/api-request.d.ts +2 -3
- package/dist/vendor/testserver-sdk/container/api-request.js +2 -3
- package/dist/vendor/testserver-sdk/container/container.d.ts +12 -2
- package/dist/vendor/testserver-sdk/container/container.js +10 -7
- package/dist/vendor/testserver-sdk/container/recorder.d.ts +29 -7
- package/dist/vendor/testserver-sdk/container/recorder.js +26 -14
- package/dist/vendor/testserver-sdk/index.d.ts +1 -1
- package/dist/vendor/testserver-sdk/index.js +1 -1
- package/dist/vendor/testserver-sdk/proxy/exchange.d.ts +24 -5
- package/dist/vendor/testserver-sdk/proxy/exchange.js +43 -25
- package/dist/vendor/testserver-sdk/proxy/faulted-exchange.js +15 -10
- package/dist/vendor/testserver-sdk/proxy/faults.d.ts +6 -5
- package/dist/vendor/testserver-sdk/proxy/proxy.d.ts +10 -1
- package/dist/vendor/testserver-sdk/proxy/proxy.js +5 -3
- package/dist/vendor/testserver-sdk/proxy/records.d.ts +17 -17
- package/dist/vendor/testserver-sdk/proxy/records.js +18 -17
- package/dist/vendor/testserver-sdk/records/body.d.ts +7 -9
- package/dist/vendor/testserver-sdk/records/body.js +10 -15
- package/dist/vendor/testserver-sdk/records/headers.d.ts +79 -0
- package/dist/vendor/testserver-sdk/records/headers.js +162 -0
- package/dist/vendor/testserver-sdk/records/index.d.ts +2 -1
- package/dist/vendor/testserver-sdk/records/index.js +4 -2
- package/dist/vendor/testserver-sdk/records/records.d.ts +19 -10
- package/package.json +5 -4
- package/skills/overview.md +5 -5
- package/skills/testserver-builds.md +0 -82
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { IncomingHttpHeaders } from "node:http";
|
|
2
2
|
import type { TestserverFailure } from "../testserver/index.ts";
|
|
3
3
|
import { type RecordedBody } from "./body.ts";
|
|
4
|
+
import type { RecordedHeaders } from "./headers.ts";
|
|
4
5
|
/**
|
|
5
|
-
* The fields every request record holds, the proxy's and an API request's, besides how it ended:
|
|
6
|
-
*
|
|
6
|
+
* The fields every request record holds, the proxy's and an API request's, besides how it ended (`RequestOutcome`):
|
|
7
|
+
* what was sent, and when. No token reaches a record (`body.ts`, `headers.ts`).
|
|
7
8
|
*/
|
|
8
9
|
export type RequestRecordFields = {
|
|
9
10
|
readonly method: string;
|
|
@@ -12,12 +13,13 @@ export type RequestRecordFields = {
|
|
|
12
13
|
readonly path: string;
|
|
13
14
|
/** The query, parsed; a key given more than once maps to every value, in order. */
|
|
14
15
|
readonly query: Readonly<Record<string, string | readonly string[]>>;
|
|
15
|
-
/**
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* The request's headers as the caller sent them, redacted (`RecordedHeaders`): an `authorization` header reads
|
|
18
|
+
* its scheme and `<token>`, such as `DPoP <token>`. Never a test id header the SDK added.
|
|
19
|
+
*/
|
|
20
|
+
readonly requestHeaders: RecordedHeaders;
|
|
17
21
|
/** Absent for an empty body. */
|
|
18
22
|
readonly requestBody?: RecordedBody;
|
|
19
|
-
/** Absent for an empty body, or when no answer arrived. */
|
|
20
|
-
readonly responseBody?: RecordedBody;
|
|
21
23
|
/**
|
|
22
24
|
* The clock's reading when the request started: for an API request the SDK clock's when `fetch` was called,
|
|
23
25
|
* comparable with a factory call's `startedAt`; for a proxy record the proxy's clock's at its arrival.
|
|
@@ -27,26 +29,33 @@ export type RequestRecordFields = {
|
|
|
27
29
|
readonly durationMs: number;
|
|
28
30
|
};
|
|
29
31
|
/**
|
|
30
|
-
* How a request ended: Testserver's status, with an error if the answer broke off or was
|
|
31
|
-
* arrived. `failure` is the Testserver failure that `error` describes (`describeFailure`), when the SDK read one: beside
|
|
32
|
+
* How a request ended: Testserver's status and what came back with it, with an error if the answer broke off or was
|
|
33
|
+
* refused, or why no answer arrived. `failure` is the Testserver failure that `error` describes (`describeFailure`), when the SDK read one: beside
|
|
32
34
|
* a `status`, it says the status fails the call, as a 410 or Testserver's 503 for a stopped container does, where an
|
|
33
35
|
* `error` without it says the answer broke off; without a `status`, why the call got no answer. An abort, and an
|
|
34
36
|
* error the proxy met on its own connections, have none.
|
|
35
37
|
*/
|
|
36
38
|
export type RequestOutcome = {
|
|
37
39
|
readonly status: number;
|
|
40
|
+
/** The answer's headers, redacted as `requestHeaders` are. */
|
|
41
|
+
readonly responseHeaders: RecordedHeaders;
|
|
42
|
+
/** Absent for an empty body. */
|
|
43
|
+
readonly responseBody?: RecordedBody;
|
|
38
44
|
/** Why the answer broke off after its status arrived, or why its status fails the call. */
|
|
39
45
|
readonly error?: string;
|
|
40
46
|
readonly failure?: TestserverFailure;
|
|
41
47
|
}
|
|
42
|
-
/** No answer arrived. */
|
|
48
|
+
/** No answer arrived, so nothing came back. */
|
|
43
49
|
| {
|
|
44
50
|
readonly error: string;
|
|
45
51
|
readonly failure?: TestserverFailure;
|
|
52
|
+
readonly responseHeaders?: never;
|
|
53
|
+
readonly responseBody?: never;
|
|
46
54
|
};
|
|
47
55
|
/**
|
|
48
56
|
* One API request a container sent with `container.fetch`, recorded once its answer was read or the request
|
|
49
|
-
* failed. It holds a proxy record's fields but `
|
|
57
|
+
* failed. It holds a proxy record's fields but `fault`, and is never open. Its `responseHeaders` are Testserver's,
|
|
58
|
+
* less `content-encoding` and `content-length`, which no longer describe the body `fetch` decompressed.
|
|
50
59
|
*/
|
|
51
60
|
export type ApiRequestRecord = RequestRecordFields & RequestOutcome;
|
|
52
61
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cnc-tools/storm",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.14.0",
|
|
4
|
+
"description": "A test orchestrator: run your tests in the inner loop of development, in the cloud, in a test environment that you define",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/vercel-labs/cnc.git",
|
|
@@ -139,11 +139,12 @@
|
|
|
139
139
|
"esbuild": "^0.27.7",
|
|
140
140
|
"typescript": "^7.0.2",
|
|
141
141
|
"typescript-5": "npm:typescript@5.9.3",
|
|
142
|
-
"vitest": "4.1.10"
|
|
142
|
+
"vitest": "4.1.10",
|
|
143
|
+
"vitest-5": "npm:vitest@5.1.0"
|
|
143
144
|
},
|
|
144
145
|
"peerDependencies": {
|
|
145
146
|
"@playwright/test": "^1.56.0",
|
|
146
|
-
"vitest": "^4.1.10"
|
|
147
|
+
"vitest": "^4.1.10 || ^5.0.0"
|
|
147
148
|
},
|
|
148
149
|
"peerDependenciesMeta": {
|
|
149
150
|
"@playwright/test": {
|
package/skills/overview.md
CHANGED
|
@@ -6,7 +6,7 @@ commands: all
|
|
|
6
6
|
|
|
7
7
|
# Overview
|
|
8
8
|
|
|
9
|
-
`storm vitest` runs vitest, in a runner sandbox or on this machine.
|
|
9
|
+
`storm vitest` runs vitest, in a runner sandbox or on this machine. When `storm.config.ts` sets `testPlan: true`, it first counts the test files on this machine, and a resource can size itself from that count. Without it, it counts nothing. `storm playwright` does the same for Playwright. `storm exec` runs a different command, such as `pnpm test`, in the same way, but it does not count tests. After the run, the `runs` commands read the run back on this machine.
|
|
10
10
|
|
|
11
11
|
## Concepts
|
|
12
12
|
|
|
@@ -17,15 +17,15 @@ commands: all
|
|
|
17
17
|
- A **run id** is the name of a run, such as `20261103T192655-8277`. It is the start time of the run in UTC and a short suffix. `storm vitest`, `storm playwright` and `storm exec` print it at the end, in the `logs` line. With `--json`, the result gives it as `runId`.
|
|
18
18
|
- A **run directory** is the directory where a run writes what it did, on the machine that started the run. This is true for a sandboxed run and for an unsandboxed run. Its name is the run id. Do not read its files directly. Use the `runs` commands.
|
|
19
19
|
- A run is **active** while it goes on. A run is **finished** when it has ended and saved its test results. `runs show` shows test results only for a finished run.
|
|
20
|
-
- A **test result** is the final result of one test: `pass`, `fail
|
|
20
|
+
- A **test result** is the final result of one test: `pass`, `fail`, or `skip`, with its errors. The command saves test results only with a storm reporter in the config of its test runner: `stormReporter` for vitest, `@vercel/storm/playwright/reporter` for Playwright. When the command of a run exits 0 but reports no test result, the run warns `no_final_test_results`. The exit code does not change. Do the steps in its `next`: they name the config file and the code to add. Then run the same command again.
|
|
21
21
|
- **Test output** is what one test printed to the console, stdout and stderr together. storm keeps the last 8 MiB of the test output of each test. `droppedChars` counts the characters that storm did not keep.
|
|
22
22
|
- A **runner secret** is a variable in your environment that the `secrets` key of the runner recipe declares, such as an npm token for a private package. A sandboxed run reads it on the machine that starts the run. The run does not start when the variable is not set, is empty, holds a line break or has fewer than 8 characters. A step of the recipe gets the variable only when the `secrets` key of that step names it. The command does not get it. storm shows the value as `<token>` in all that it prints and writes. storm does not write the value to a file. A step can leave the value in the sandbox, and a runner snapshot then keeps it. Do not let a step leave the value.
|
|
23
23
|
- A **run log** is a log in the run directory. The **command log** (`command`) holds all the output of the command. It also holds output that no test owns: output from a `beforeAll`, a global setup, a raw `process.stdout.write`, or a child process. A **step log** (`install`, `build`, `apply`, `snapshot`) holds the output of one step of a sandboxed run.
|
|
24
24
|
|
|
25
25
|
## Commands
|
|
26
26
|
|
|
27
|
-
- `storm vitest [<vitest run args>...] [-- <vitest dash options>...]`
|
|
28
|
-
- `storm playwright [<playwright test args>...] [-- <playwright dash options>...]`
|
|
27
|
+
- `storm vitest [--count-tests] [<vitest run args>...] [-- <vitest dash options>...]` runs `vitest run` with the arguments, after it counts the test files when `storm.config.ts` sets `testPlan`. Put the dash options of vitest, such as `-t` or `--project`, after `--`. The count applies the file filters and `--project`, but not `-t`. A `-t` that matches no test does not stop the run: vitest skips every test and exits 0. Add `--count-tests` to count each test too, with or without `testPlan`. Then the run stops with `no_matching_tests` when no test matches. This count imports every test file, so it is slow for a large suite.
|
|
28
|
+
- `storm playwright [<playwright test args>...] [-- <playwright dash options>...]` runs `playwright test` with the arguments, after it counts the tests when `storm.config.ts` sets `testPlan`. Put the dash options of Playwright, such as `--project` or `--grep`, after `--`.
|
|
29
29
|
- `storm exec -- <command>` runs a different command. It does not count tests.
|
|
30
30
|
- `storm runs list --json` lists the recent runs.
|
|
31
31
|
- `storm runs show <run-id> --json` shows a run, the test plan of a `storm vitest` or `storm playwright` run, its test results, and with `--failed` or `--test` the errors and test output of tests.
|
|
@@ -34,4 +34,4 @@ commands: all
|
|
|
34
34
|
## Other skills
|
|
35
35
|
|
|
36
36
|
- To read the output and the errors of a run, run `storm skills get read-run-output`.
|
|
37
|
-
- To see all the skills, run `storm skills list`.
|
|
37
|
+
- To see all the skills, run `storm skills list`.
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: testserver-builds
|
|
3
|
-
description: Choose the Testserver build that a run uses. Run against the build of a vercel/api pull request when a change needs API code that is not merged.
|
|
4
|
-
commands: [vitest, exec]
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Testserver builds
|
|
8
|
-
|
|
9
|
-
Use this skill to choose the Testserver build of a run. Use it also when a change needs vercel/api code that is not merged.
|
|
10
|
-
|
|
11
|
-
## Concepts
|
|
12
|
-
|
|
13
|
-
- A **build** is one version of Testserver, such as `20261105T041247Z__65203e5`. Its name is a UTC time and a short commit.
|
|
14
|
-
- A **build channel** is a name that moves from build to build.
|
|
15
|
-
- `stable` is the default. A cron job in vercel/front promotes the newest main build to `stable` every 20 minutes, when the Testserver tests of vercel/front pass.
|
|
16
|
-
- `latest_main` is the newest build of the `main` branch of vercel/api.
|
|
17
|
-
- A **PR build** is a build of one vercel/api pull request. The `Testserver` workflow of vercel/api makes one for each push to the pull request. It builds the pull request merged into its base branch. In a stack, the base branch is the pull request below. Thus the PR build of the top pull request contains all the pull requests of the stack.
|
|
18
|
-
- The **head commit** of a pull request is the newest commit on its branch, such as `87343a6781b4f540893958e49e8eedaf5bb2b4ad`. Each PR build comes from the workflow run for one head commit.
|
|
19
|
-
- A **PR build reference** gives a vercel/api pull request as the build. Write it as `pr:<N>`, such as `pr:104196`, or as the URL of the pull request, such as `https://github.com/vercel/api/pull/104196`. storm changes the URL to `pr:<N>`.
|
|
20
|
-
|
|
21
|
-
A run with `pr:<N>` uses a PR build of the head commit of the pull request. If no PR build of that head commit exists, the run stops. It does not wait, and it does not use a PR build of an older head commit.
|
|
22
|
-
|
|
23
|
-
storm reads the head commit from GitHub on this machine. If the pool has a Testserver sandbox that was made for `pr:<N>` on the head commit, storm uses the PR build of the newest such Testserver sandbox. It does this only if that PR build has not expired. Then storm reads only the head commit from GitHub. If the workflow ran again on the same head commit, storm can use an older PR build of that head commit from the pool. If the pool has no usable PR build, storm reads the runs of the `Testserver` workflow and uses the newest PR build of the head commit. storm uses the first GitHub token that it finds: `GITHUB_TOKEN`, `GH_TOKEN`, or the output of `gh auth token`. The token must be able to read vercel/api and its Actions. The token stays on this machine.
|
|
24
|
-
|
|
25
|
-
## Choose a build
|
|
26
|
-
|
|
27
|
-
- Use `stable` for the required checks and in `storm.config.ts`.
|
|
28
|
-
- Use `latest_main` for vercel/api code that is merged but is not in `stable` yet.
|
|
29
|
-
- Use `pr:<N>` when the change needs vercel/api code in an open pull request.
|
|
30
|
-
- Do not write a PR build reference in `storm.config.ts`. Do not commit a PR build reference.
|
|
31
|
-
|
|
32
|
-
## Know when you need a PR build
|
|
33
|
-
|
|
34
|
-
- Tests skip with a note that a service "is not on this Testserver build". For example: `api-domains-registrar is not on this Testserver build`. The build does not have the service.
|
|
35
|
-
- Tests fail on vercel/api behavior that an open vercel/api pull request adds.
|
|
36
|
-
|
|
37
|
-
In each case, find the vercel/api pull request before you change the tests.
|
|
38
|
-
|
|
39
|
-
## Run against a vercel/api pull request
|
|
40
|
-
|
|
41
|
-
1. Find the number of the pull request. In a stack, use the top pull request. For example, run `gh pr list --repo vercel/api --author @me --json number,headRefName,baseRefName`. Or run `gh pr view <branch> --repo vercel/api --json number,headRefOid`.
|
|
42
|
-
2. Run `gh pr checks <N> --repo vercel/api`. Make sure that `Bundle & Publish` passed on the newest push.
|
|
43
|
-
3. Run `storm vitest --testserver-build pr:<N> --json`. Or run `storm exec --testserver-build pr:<N> --json -- <command>`.
|
|
44
|
-
4. Read `resources.testserverPool.facts.build` in the result. Make sure that `pullRequest.headSha` is the head commit of the pull request. `resolved` is the PR build.
|
|
45
|
-
5. After a new push to the pull request, wait for `Bundle & Publish`. Then run the same command again. The run finds the new PR build. Do not change the command.
|
|
46
|
-
|
|
47
|
-
To make one Testserver sandbox on the PR build, run `storm ext testserver pool create --build pr:<N> --ttl 10m --json`. Read `pullRequest.headSha` and `resolvedBuild`. To see the Testserver sandboxes in the pool, run `storm ext testserver pool list --json`. Their `requestedBuild` is `pr:<N>`. For the options of these two commands, run `storm ext testserver pool create --help` and `storm ext testserver pool list --help`.
|
|
48
|
-
|
|
49
|
-
With `--testserver-create=false`, a run with `pr:<N>` uses only the Testserver sandboxes in the pool on that PR build. It does not make new ones.
|
|
50
|
-
|
|
51
|
-
To make runs more reliable, for example before a demo, make the Testserver sandboxes first. Run `storm pool create --build pr:<N> --json` one time for each Testserver sandbox. Then a run with `pr:<N>` reads only the head commit from GitHub. Its line `Build: …` ends with `(from the pool)`. A Testserver sandbox lives for its TTL, 5 hours or less. After a new push to the pull request, the runs do not use these Testserver sandboxes.
|
|
52
|
-
|
|
53
|
-
## If a run stops
|
|
54
|
-
|
|
55
|
-
A run that stops on a PR build ends with the error `resource_refused`. Read `data.refusal` in the error document: it is the reason. Read the facts of the refusal in `data.data`. The `pool create` command ends with the reason itself in `reason`, and its facts in `data`.
|
|
56
|
-
|
|
57
|
-
- `pull_request_unreadable`: storm could not read the pull request from GitHub. In the facts, read `kind` and `tokenOrigin`.
|
|
58
|
-
1. Run `gh auth status`.
|
|
59
|
-
2. Run `gh auth login`, or set `GITHUB_TOKEN` to a token that can read vercel/api.
|
|
60
|
-
3. Run the command again.
|
|
61
|
-
- `pr_build_not_ready`: the newest PR build is not from the head commit. In the facts, read `headSha` and `newest`.
|
|
62
|
-
1. Run `gh pr checks <N> --repo vercel/api`.
|
|
63
|
-
2. If `Bundle & Publish` runs, wait until it passes. Then run the command again.
|
|
64
|
-
3. If `Bundle & Publish` failed, read its log, and tell the user. Do not run the command again until a PR build passes.
|
|
65
|
-
- `pr_build_expired`: the PR build is 7 days old or more. The Testserver control plane does not use it. Push to the pull request, or run its `Testserver` workflow again. Then run the command again.
|
|
66
|
-
- `pr_builds_unlisted`: storm could not read the runs of the `Testserver` workflow from GitHub. In the facts, read `failure`.
|
|
67
|
-
1. Run `gh auth status`. Make sure that the token can read vercel/api.
|
|
68
|
-
2. Run the command again one time. If it fails again, tell the user.
|
|
69
|
-
|
|
70
|
-
Do not give a build name to get past one of these errors, unless the user tells you to.
|
|
71
|
-
|
|
72
|
-
## Land the change
|
|
73
|
-
|
|
74
|
-
1. Merge the vercel/api pull request or stack.
|
|
75
|
-
2. Wait until `stable` contains the change.
|
|
76
|
-
1. Run `gh pr view <N> --repo vercel/api --json mergedAt`.
|
|
77
|
-
2. Run `storm ext testserver pool create --build stable --ttl 10m --json`, and read `resolvedBuild`.
|
|
78
|
-
3. The time at the start of `resolvedBuild` is in UTC. If it is after `mergedAt`, `stable` contains the change. If you are not sure, ask the user.
|
|
79
|
-
3. Run the required check of the client pull request again, on `stable`.
|
|
80
|
-
4. Merge the client pull request.
|
|
81
|
-
|
|
82
|
-
Do not merge the client pull request while its tests pass only on `pr:<N>`.
|