@lizard-build/cli 4.0.121 → 4.0.123
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/README.md +1 -1
- package/dist/commands/sandbox.js +8 -6
- package/dist/commands/sandbox.js.map +1 -1
- package/dist/commands/up.d.ts +15 -0
- package/dist/commands/up.js +7 -5
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/volume.js +3 -2
- package/dist/commands/volume.js.map +1 -1
- package/dist/lib/skills-data.generated.js +3 -3
- package/dist/lib/skills-data.generated.js.map +1 -1
- package/dist/lib/updater.d.ts +1 -1
- package/dist/lib/updater.js +1 -1
- package/package.json +1 -1
- package/skill-data/core/SKILL.md +4 -4
- package/skill-data/core/references/deploys.md +2 -1
- package/skill-data/core/references/sandboxes.md +7 -4
- package/src/commands/sandbox.ts +8 -6
- package/src/commands/up.ts +6 -3
- package/src/commands/volume.ts +3 -2
- package/src/lib/updater.ts +1 -1
- package/test/unit/sandbox.test.ts +6 -5
- package/test/unit/up-region.test.ts +58 -0
- package/test/unit/volume-size.test.ts +1 -1
|
@@ -104,6 +104,7 @@ lizard up --json
|
|
|
104
104
|
- Streams build logs; ends with `{ event: "deployed", status: "running", url }`. A failed build ends with `{ event: "error", message }` and exit 1; no `deployed` event means the service isn't running yet (see the core guide).
|
|
105
105
|
- With no linked service, `up` deploys into the service named like `package.json` `name` (else the folder), and switches it to an upload even if it was git-backed. `--service <name>` deploys to that service, creating it when none has the name; a folder linked to an addon (after `lizard add postgres`) is treated as unlinked.
|
|
106
106
|
- Flags: `--project`, `--service`, `--region`, `--build-command`, `--start-command`, `--pre-deploy-command`, `--port`, `--detach`, `--ci`.
|
|
107
|
+
- A new service goes to `us-east-1` unless `--region` names another (`lizard regions`). The region of an existing service never changes.
|
|
107
108
|
- If cwd isn't linked and no `--project` is given, it links the folder to the default project (see the core guide) and deploys there as a new service. `--project <name>` uses that project, or creates it if none matches. It never creates a project from the folder name on its own.
|
|
108
109
|
- `lizard up` always switches the service to `sourceType=upload`. Do not use it to update a git-backed service — use `lizard redeploy` or push to the remote.
|
|
109
110
|
|
|
@@ -166,7 +167,7 @@ Rules:
|
|
|
166
167
|
|
|
167
168
|
Provision with `lizard add <type>`. Each addon exposes a fixed env-var set; reference by name from a consumer service via `${{<addon-name>.KEY}}`. The first addon of a given type gets the bare type as its name (so use `postgres` in the reference for the first Managed Postgres instance); subsequent ones get `{type}-{adjective}-{noun}` like `postgres-autumn-bear`. There's no type-alias fallback — a ref must use the addon's actual name. Refs match the addon's current name, so renaming it breaks existing refs: update them after a rename. Every running Postgres and Redis addon's `DATABASE_URL` / `REDIS_URL` also reaches every service in the project at the lowest precedence; a value set on the consumer overrides it.
|
|
168
169
|
|
|
169
|
-
- `postgres` — two connection URLs: prefer `DATABASE_PRIVATE_URL` when available and reachable within the same project and region (no ingress/egress charges); use `DATABASE_URL` for public access, such as local clients or external CI (network charges may apply). Private URLs resolve only in the addon's region
|
|
170
|
+
- `postgres` — two connection URLs: prefer `DATABASE_PRIVATE_URL` when available and reachable within the same project and region (no ingress/egress charges); use `DATABASE_URL` for public access, such as local clients or external CI (network charges may apply). Private URLs resolve only in the addon's region; `lizard up` and `lizard add` both default to `us-east-1`. Also exposes `PGHOST`, `PGPORT` (the public endpoint), `PGUSER`, `PGPASSWORD`, `PGDATABASE`, `POSTGRES_USER`, `POSTGRES_DB`, `POSTGRES_PASSWORD`.
|
|
170
171
|
- `redis` — `REDIS_URL`; services in the same project should use `REDIS_PRIVATE_URL`. No eviction policy and no append-only file are configured: if it runs out of memory, the instance restarts and recent writes can be lost. Keep data you cannot lose in Postgres.
|
|
171
172
|
- `s3` — `S3_ENDPOINT`, `S3_DEFAULT_BUCKET`, `S3_ACCESS_KEY_ID`, `S3_SECRET_ACCESS_KEY`, `S3_REGION`. Auto-creates a private bucket named `default`; each S3 addon stores up to 16 GiB. Make a bucket public from the dashboard's S3 browser; objects in a public bucket are served without auth two ways: the gateway URL the dashboard shows, `https://s3-<region>.onlizard.com/<addonId>/<bucket>/<key>`, or the platform proxy `<dashboard-host>/api/s3/<addonId>/public/<bucket>/<key>` (the host `lizard open` launches; long-lived immutable cache headers). For AWS SDK use, set `forcePathStyle: true`. ACL flips aren't on the CLI yet, so point users at the dashboard. To push a local file into a bucket directly (no AWS SDK needed), use `lizard s3 upload <file> [--addon <name>] [--bucket <name>] [--key <key>] [--content-type <type>]` — auto-resolves the project's only S3 addon and bucket `default` if omitted; prints `{key, etag, size, url}` (`url` is `null` unless the bucket is public). `lizard s3 list|ls [--bucket <name>] [--prefix <p>]` lists objects in a bucket. `lizard s3 url <key> [--expires <seconds>]` prints a presigned link (default 1 hour, at most 7 days) that downloads a private object without credentials. The CLI has no ACL command: make a bucket public in the dashboard, or with an S3 `PutBucketAcl` (`public-read`) call using the addon's credentials.
|
|
172
173
|
|
|
@@ -72,10 +72,11 @@ lizard sandbox files rm <id> <path>
|
|
|
72
72
|
|
|
73
73
|
## Size and pricing
|
|
74
74
|
|
|
75
|
-
`lizard sandbox create -s/--size mini|small|medium|large` picks the machine; the default is `medium`. The Pro trial runs 1 Small and 2
|
|
75
|
+
`lizard sandbox create -s/--size nano|mini|small|medium|large` picks the machine; the default is `medium`. The Pro trial runs 1 Small, 2 Mini and 2 Nano at a time, in US regions only (no size = small); Medium and Large unlock after the first payment. Medium or Large answers 403 `TRIAL_SANDBOX_SIZE` (`allowedSizes: ["small", "mini", "nano"]`), another region 403 `TRIAL_SANDBOX_REGION`, and a second Small or a third Mini or Nano 403 `TRIAL_SIZE_RUNNING` (`size`, `sizeLimit`, `sizeLimits: {"small": 1, "mini": 2, "nano": 2}`): pause or delete one. Trial sandboxes are deleted 1 hour after they start at the latest (a longer `--timeout` answers 403 `TRIAL_SANDBOX_LIFETIME`, see [Lifetime](#lifetime)). `lizard billing start-now` lifts these limits. There are exactly five sizes:
|
|
76
76
|
|
|
77
77
|
| Size | vCPU | RAM | Disk | Price |
|
|
78
78
|
|---|---|---|---|---|
|
|
79
|
+
| `nano` | 0.5 | 1 GiB | 5 GB | $0.00405/h |
|
|
79
80
|
| `mini` | 1 | 2 GiB | 5 GB | $0.0081/h |
|
|
80
81
|
| `small` | 2 | 4 GiB | 20 GB | $0.0162/h |
|
|
81
82
|
| `medium` (default) | 4 | 8 GiB | 40 GB | $0.0324/h |
|
|
@@ -83,13 +84,15 @@ lizard sandbox files rm <id> <path>
|
|
|
83
84
|
|
|
84
85
|
Mini has no warm pool, so it starts only from templates with a disk-only build: `base`, `claude`, `codex` and `interpreter`. Any other template answers 400 `SANDBOX_SIZE_NOT_ALLOWED`; use `small` or larger for it.
|
|
85
86
|
|
|
86
|
-
|
|
87
|
+
Nano is half a vCPU: the sandbox sees 1 CPU (`nproc` says 1) but gets at most half a core of time, so CPU-bound work takes about twice as long as on Mini (the rest shows as steal time). It suits an idle shell or a coding agent waiting on a model. Nano starts only from `base`, `claude` and `codex`; any other template answers 400 `SANDBOX_SIZE_NOT_ALLOWED` with `templates`.
|
|
88
|
+
|
|
89
|
+
Disk is the sandbox's root file system (`/`): its home directory, `/workspace` and everything it installs share it (a volume, if attached, mounts over `/workspace`). `df -h` prints GiB, so it shows about 4.7G / 4.7G / 18.8G / 37.6G / 75.2G for `nano` / `mini` / `small` / `medium` / `large`. A sandbox restored from a snapshot keeps at least its snapshot's disk.
|
|
87
90
|
|
|
88
91
|
Prices are per hour, billed per second while the sandbox runs, flat by size: measured CPU/RAM is not charged, and disk and egress are included. A paused sandbox costs nothing. Attached volumes bill separately. `--size` cannot be combined with `--snapshot`: a snapshot restores at the size it was captured at (see [private snapshots](#snapshots-and-pauseresume)).
|
|
89
92
|
|
|
90
93
|
Lizard Sandboxes run as Firecracker microVMs, each with its own kernel. If a sandbox cannot start, creation fails with an error.
|
|
91
94
|
|
|
92
|
-
An account's limit counts vCPU of running sandboxes (Mini 1, Small 2, Medium 4, Large 8; paused ones don't count), across all of the owner's workspaces: 1 Small and 2
|
|
95
|
+
An account's limit counts vCPU of running sandboxes (Nano 1, Mini 1, Small 2, Medium 4, Large 8; paused ones don't count), across all of the owner's workspaces: 1 Small, 2 Mini and 2 Nano at a time on the trial (counted by size, not vCPU), 40 vCPU on Pro, 220 on Pro 5x and 1,200 on Pro 20x. Starts are limited only on the trial (6 a minute, 30 an hour, 100 a day); Pro, Pro 5x and Pro 20x have unlimited starts. Enterprise has no fixed limit on sandboxes running at once: each customer's agreement sets the limit per workspace, and running, paused and crashed sandboxes all count toward it. Over a limit the API answers 429 `SANDBOX_LIMIT_REACHED` (with `unit: "vcpu"`, `limit`, `running` and `needed`, all in vCPU) or `SANDBOX_RATE_LIMITED` (with `retryAfterS`).
|
|
93
96
|
|
|
94
97
|
## Interactive shell
|
|
95
98
|
|
|
@@ -187,7 +190,7 @@ Use `lizard volume create <name> --size <gb> --project <project>` for persistent
|
|
|
187
190
|
Persistent volumes for sandboxes. A volume's name is its key within the project; every command takes a name or ID.
|
|
188
191
|
|
|
189
192
|
```
|
|
190
|
-
lizard volume create <name> [--size <gb>] [--region <code>] # default 5 GB; a sandbox with --volume starts in its region
|
|
193
|
+
lizard volume create <name> [--size <gb>] [--region <code>] # default 5 GB in us-east-1; a sandbox with --volume starts in its region
|
|
191
194
|
lizard volume list --json # name, sizeGb, status, attachedTo
|
|
192
195
|
lizard volume resize <name> --size <gb> # grow in place
|
|
193
196
|
lizard volume rm <name> [-y] # refused while attached; delete the sandbox first
|
package/src/commands/sandbox.ts
CHANGED
|
@@ -24,13 +24,15 @@ import { success, info, warn, error, isJSONMode, printJSON, table, statusColor,
|
|
|
24
24
|
// so let it.
|
|
25
25
|
const TEMPLATE_HINT = "base, interpreter, codex, claude, opencode, pi, prime, desktop";
|
|
26
26
|
|
|
27
|
-
// The
|
|
27
|
+
// The five machines a sandbox can be, each priced per hour, billed per second by the server. The
|
|
28
28
|
// platform rejects anything else, so the CLI offers exactly these. Mini has no warm pool, so it
|
|
29
|
-
// starts only from templates with a disk-only build (MINI_TEMPLATES);
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
const
|
|
29
|
+
// starts only from templates with a disk-only build (MINI_TEMPLATES); Nano (half a vCPU: 1 vCPU
|
|
30
|
+
// held to 50% of a core) only from NANO_TEMPLATES. The server answers SANDBOX_SIZE_NOT_ALLOWED
|
|
31
|
+
// for any other template.
|
|
32
|
+
const SANDBOX_SIZES = ["nano", "mini", "small", "medium", "large"] as const;
|
|
33
|
+
const SIZE_HINT = "nano 0.5 vCPU/1 GB RAM/5 GB disk, mini 1/2/5, small 2/4/20, medium 4/8/40, large 8/16/80";
|
|
33
34
|
const MINI_TEMPLATES = "base, claude, codex and interpreter";
|
|
35
|
+
const NANO_TEMPLATES = "base, claude and codex";
|
|
34
36
|
|
|
35
37
|
interface SandboxRecord {
|
|
36
38
|
sandboxId: string;
|
|
@@ -174,7 +176,7 @@ export function registerSandbox(program: Command) {
|
|
|
174
176
|
sb.command("create")
|
|
175
177
|
.description("Create a sandbox")
|
|
176
178
|
.option("-t, --template <name>", `Template (${TEMPLATE_HINT}; server validates)`, "base")
|
|
177
|
-
.addOption(new Option("-s, --size <size>", `Machine size (${SIZE_HINT}); default medium, small on the Pro trial (1 Small and 2
|
|
179
|
+
.addOption(new Option("-s, --size <size>", `Machine size (${SIZE_HINT}); default medium, small on the Pro trial (1 Small, 2 Mini and 2 Nano at a time, US regions only; Medium and Large unlock after the first payment). Mini works only with the ${MINI_TEMPLATES} templates, Nano only with ${NANO_TEMPLATES}`).choices(SANDBOX_SIZES))
|
|
178
180
|
.option("--timeout <ms>", "Lifetime in milliseconds; 0 disables expiration (Pro trial: at most 3600000 = 1 hour, and 0 means 1 hour)", parseTimeoutOption, 300_000)
|
|
179
181
|
.option("--region <code>", `Region to create the sandbox in (default ${DEFAULT_REGION}; with --volume or --snapshot, theirs)`)
|
|
180
182
|
.option("--snapshot <id>", "Create from a private saved snapshot, at the size it was taken at")
|
package/src/commands/up.ts
CHANGED
|
@@ -48,7 +48,7 @@ export function registerUp(program: Command) {
|
|
|
48
48
|
.option("-s, --service <name>", "Service to deploy to (defaults to linked)")
|
|
49
49
|
.option("-p, --project <id>", "Project name, slug, or ID")
|
|
50
50
|
.option("--no-gitignore", "Don't ignore paths from .gitignore")
|
|
51
|
-
.option("--region <code>",
|
|
51
|
+
.option("--region <code>", `Region to create the service in (default ${DEFAULT_REGION}; new services only)`)
|
|
52
52
|
.option("--build-command <cmd>", "Build command to run (e.g. 'npm run build')")
|
|
53
53
|
.option("--start-command <cmd>", "Start command to run (e.g. 'node dist/index.js')")
|
|
54
54
|
.option("--pre-deploy-command <cmd>", "Pre-deploy command (e.g. 'node dist/migrate.js')")
|
|
@@ -125,7 +125,7 @@ export function registerUp(program: Command) {
|
|
|
125
125
|
|
|
126
126
|
// ── deploy strategies ────────────────────────────────────────────────────────
|
|
127
127
|
|
|
128
|
-
async function deployFromLocal(args: {
|
|
128
|
+
export async function deployFromLocal(args: {
|
|
129
129
|
projectId: string;
|
|
130
130
|
scope: ResourceScope;
|
|
131
131
|
targetPath: string;
|
|
@@ -174,7 +174,10 @@ async function deployFromLocal(args: {
|
|
|
174
174
|
if (resolvedPort !== undefined) qs.set("port", String(resolvedPort));
|
|
175
175
|
if (!args.existingServiceId) {
|
|
176
176
|
qs.set("name", appName);
|
|
177
|
-
|
|
177
|
+
// No --region: us-east-1, like sandbox create and add. Leaving it out let the
|
|
178
|
+
// platform pick the region of whichever server answered, and DNS sends
|
|
179
|
+
// European users to the EU one.
|
|
180
|
+
qs.set("region", args.region || DEFAULT_REGION);
|
|
178
181
|
// New services with no detected port default to 3000
|
|
179
182
|
if (resolvedPort === undefined) qs.set("port", "3000");
|
|
180
183
|
}
|
package/src/commands/volume.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as p from "@clack/prompts";
|
|
|
3
3
|
import { Command } from "commander";
|
|
4
4
|
import { api, withScope, type ResourceScope } from "../lib/api.js";
|
|
5
5
|
import { assertValidVolumeName, resolveVolume, type VolumeRecord } from "../lib/volume.js";
|
|
6
|
+
import { DEFAULT_REGION } from "../lib/config.js";
|
|
6
7
|
import { resolveProjectScope, resolveService } from "../lib/resolve.js";
|
|
7
8
|
import { success, info, warn, isJSONMode, printJSON, table, isTTY } from "../lib/format.js";
|
|
8
9
|
|
|
@@ -82,7 +83,7 @@ export function registerVolume(program: Command) {
|
|
|
82
83
|
.argument("<name>", "Volume name")
|
|
83
84
|
.description("Create a persistent volume for sandboxes, or create one and attach it to a service with --service")
|
|
84
85
|
.option("--size <gb>", "Size in GB (server limits apply; default 5)", parseIntOption)
|
|
85
|
-
.option("--region <code>",
|
|
86
|
+
.option("--region <code>", `Region to place the volume in (default ${DEFAULT_REGION}; must match the sandbox that will attach it)`)
|
|
86
87
|
.option("-s, --service <name>", "Attach it to this service instead (one volume per service; files there survive restarts and redeploys)")
|
|
87
88
|
.option("--mount-path <path>", "With --service: where the service sees it (default /data)")
|
|
88
89
|
.option("-p, --project <id>", "Project name, slug, or ID")
|
|
@@ -111,7 +112,7 @@ export function registerVolume(program: Command) {
|
|
|
111
112
|
if (!isJSONMode()) info(`Creating volume ${chalk.cyan(name)}...`);
|
|
112
113
|
const created = await api.post<VolumeRecord>(
|
|
113
114
|
withScope(`/api/projects/${projectId}/volumes`, scope),
|
|
114
|
-
{ name, sizeGb, region: opts.region },
|
|
115
|
+
{ name, sizeGb, region: opts.region || DEFAULT_REGION },
|
|
115
116
|
);
|
|
116
117
|
|
|
117
118
|
if (isJSONMode()) {
|
package/src/lib/updater.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { join, dirname } from "node:path";
|
|
|
5
5
|
import os from "node:os";
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
7
7
|
|
|
8
|
-
export const CURRENT_VERSION = "4.0.
|
|
8
|
+
export const CURRENT_VERSION = "4.0.123";
|
|
9
9
|
const RELEASES_API = "https://api.github.com/repos/lizard-build/lizard-cli/releases/latest";
|
|
10
10
|
const RELEASE_BASE = "https://github.com/lizard-build/lizard-cli/releases/latest/download";
|
|
11
11
|
|
|
@@ -55,24 +55,25 @@ describe("sandbox create size", () => {
|
|
|
55
55
|
vi.mocked(api.post).mockResolvedValue({ id: "sandbox-test" });
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
-
it.each(["mini", "small", "medium", "large"])("sends --size %s to the API", async (size) => {
|
|
58
|
+
it.each(["nano", "mini", "small", "medium", "large"])("sends --size %s to the API", async (size) => {
|
|
59
59
|
await create(["--size", size]);
|
|
60
60
|
expect(api.post).toHaveBeenCalledWith("/api/sandboxes", expect.objectContaining({ size }));
|
|
61
61
|
});
|
|
62
62
|
|
|
63
63
|
it("rejects an unknown size before making a request", async () => {
|
|
64
|
-
await expect(create(["--size", "tiny"])).rejects.toThrow(/mini, small, medium, large|"mini", "small", "medium", "large"/);
|
|
64
|
+
await expect(create(["--size", "tiny"])).rejects.toThrow(/nano, mini, small, medium, large|"nano", "mini", "small", "medium", "large"/);
|
|
65
65
|
expect(api.post).not.toHaveBeenCalled();
|
|
66
66
|
});
|
|
67
67
|
|
|
68
|
-
it("lists every size, Mini included, in the help", () => {
|
|
68
|
+
it("lists every size, Nano and Mini included, in the help", () => {
|
|
69
69
|
const program = new Command();
|
|
70
70
|
registerSandbox(program);
|
|
71
71
|
const createCmd = program.commands.find((c) => c.name() === "sandbox")!.commands.find((c) => c.name() === "create")!;
|
|
72
72
|
const help = createCmd.helpInformation().replace(/\s+/g, " ");
|
|
73
|
-
expect(help).toContain("
|
|
73
|
+
expect(help).toContain("nano 0.5 vCPU/1 GB RAM/5 GB disk, mini 1/2/5, small 2/4/20, medium 4/8/40, large 8/16/80");
|
|
74
|
+
expect(help).toContain("Nano only with base, claude and codex");
|
|
74
75
|
expect(help).toContain("Mini works only with the base, claude, codex and interpreter templates");
|
|
75
|
-
expect(help).toContain('(choices: "mini", "small", "medium", "large")');
|
|
76
|
+
expect(help).toContain('(choices: "nano", "mini", "small", "medium", "large")');
|
|
76
77
|
});
|
|
77
78
|
});
|
|
78
79
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
|
+
|
|
6
|
+
vi.mock("../../src/lib/auth.js", async (importOriginal) => {
|
|
7
|
+
const actual = await importOriginal<typeof import("../../src/lib/auth.js")>();
|
|
8
|
+
return { ...actual, getToken: () => "token" };
|
|
9
|
+
});
|
|
10
|
+
import { deployFromLocal } from "../../src/commands/up.js";
|
|
11
|
+
import { setJSONMode } from "../../src/lib/format.js";
|
|
12
|
+
|
|
13
|
+
describe("up region", () => {
|
|
14
|
+
let dir: string;
|
|
15
|
+
let urls: URL[];
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
dir = fs.mkdtempSync(path.join(os.tmpdir(), "lz-up-"));
|
|
18
|
+
fs.writeFileSync(path.join(dir, "index.js"), "console.log(1)\n");
|
|
19
|
+
process.env.LIZARD_HOME = dir;
|
|
20
|
+
urls = [];
|
|
21
|
+
vi.stubGlobal("fetch", vi.fn(async (url: string) => {
|
|
22
|
+
urls.push(new URL(url));
|
|
23
|
+
return new Response(JSON.stringify({ id: "a1", name: "svc" }), { status: 201 });
|
|
24
|
+
}));
|
|
25
|
+
setJSONMode(true);
|
|
26
|
+
vi.spyOn(process.stdout, "write").mockImplementation(() => true);
|
|
27
|
+
});
|
|
28
|
+
afterEach(() => {
|
|
29
|
+
vi.unstubAllGlobals();
|
|
30
|
+
vi.restoreAllMocks();
|
|
31
|
+
setJSONMode(false);
|
|
32
|
+
delete process.env.LIZARD_HOME;
|
|
33
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const deploy = (extra: { region?: string; existingServiceId?: string }) =>
|
|
37
|
+
deployFromLocal({
|
|
38
|
+
projectId: "p1", scope: {}, targetPath: dir, useGitignore: false, serviceFlag: "svc",
|
|
39
|
+
existingServiceId: undefined, region: undefined, opts: { detach: true }, ...extra,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("creates a new service in us-east-1 when no --region is given", async () => {
|
|
43
|
+
await deploy({});
|
|
44
|
+
expect(urls[0].pathname).toBe("/api/projects/p1/apps/upload");
|
|
45
|
+
expect(urls[0].searchParams.get("region")).toBe("us-east-1");
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it("keeps an explicit --region", async () => {
|
|
49
|
+
await deploy({ region: "eu-west-lim-a" });
|
|
50
|
+
expect(urls[0].searchParams.get("region")).toBe("eu-west-lim-a");
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("sends no region when uploading to an existing service", async () => {
|
|
54
|
+
await deploy({ existingServiceId: "a1" });
|
|
55
|
+
expect(urls[0].searchParams.get("appId")).toBe("a1");
|
|
56
|
+
expect(urls[0].searchParams.has("region")).toBe(false);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
@@ -35,7 +35,7 @@ describe('volume create size', () => {
|
|
|
35
35
|
it('uses server defaults and workspace scope', async () => {
|
|
36
36
|
await create();
|
|
37
37
|
expect(api.get).toHaveBeenCalledWith('/api/projects/p1/volume-limits?workspaceId=w1');
|
|
38
|
-
expect(api.post).toHaveBeenCalledWith('/api/projects/p1/volumes?workspaceId=w1', { name: 'cache', sizeGb: 5, region:
|
|
38
|
+
expect(api.post).toHaveBeenCalledWith('/api/projects/p1/volumes?workspaceId=w1', { name: 'cache', sizeGb: 5, region: 'us-east-1' });
|
|
39
39
|
});
|
|
40
40
|
it('accepts the boundary and follows a changed limit', async () => {
|
|
41
41
|
await create('50');
|