@specific.dev/spectest 0.38.0 → 0.41.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/components/k3s.js +1 -24
- package/dist/components/supabase.d.ts +87 -27
- package/dist/components/supabase.js +352 -69
- package/dist/daemon.d.ts +38 -0
- package/dist/daemon.js +405 -946
- package/dist/harness/build-context.d.ts +82 -0
- package/dist/harness/build-context.js +113 -0
- package/dist/harness/buildkit-progress.d.ts +37 -0
- package/dist/harness/buildkit-progress.js +66 -0
- package/dist/harness/container-run.d.ts +89 -0
- package/dist/harness/container-run.js +118 -0
- package/dist/harness/file-mounts.d.ts +91 -0
- package/dist/harness/file-mounts.js +119 -0
- package/dist/harness/hostmatch.d.ts +65 -0
- package/dist/harness/hostmatch.js +108 -0
- package/dist/harness/http-proxy.d.ts +62 -0
- package/dist/harness/http-proxy.js +104 -0
- package/dist/harness/ingress-table.d.ts +148 -0
- package/dist/harness/ingress-table.js +129 -0
- package/dist/harness/log-delta.d.ts +54 -0
- package/dist/harness/log-delta.js +83 -0
- package/dist/harness/main.d.ts +47 -0
- package/dist/harness/main.js +164 -0
- package/dist/harness/methods.d.ts +54 -0
- package/dist/harness/methods.js +65 -0
- package/dist/harness/names-registry.d.ts +63 -0
- package/dist/harness/names-registry.js +90 -0
- package/dist/harness/protocol.d.ts +88 -0
- package/dist/harness/protocol.js +96 -0
- package/dist/harness/ready-poll.d.ts +47 -0
- package/dist/harness/ready-poll.js +67 -0
- package/dist/harness/service-graph.d.ts +29 -0
- package/dist/harness/service-graph.js +92 -0
- package/dist/harness/volume-paths.d.ts +70 -0
- package/dist/harness/volume-paths.js +81 -0
- package/dist/index.d.ts +3 -3
- package/dist/ingress.d.ts +1 -1
- package/dist/inspect.d.ts +23 -0
- package/dist/inspect.js +65 -0
- package/dist/resolver.js +5 -8
- package/dist/vendor/rrweb-plugin-console-record.umd.js +521 -0
- package/dist/vendor/rrweb-record.min.js +5061 -0
- package/package.json +7 -1
- package/src/aws-sigv4.ts +218 -0
- package/src/browser.ts +2040 -0
- package/src/components/aws.ts +554 -0
- package/src/components/email.ts +398 -0
- package/src/components/expo.ts +167 -0
- package/src/components/index.ts +81 -0
- package/src/components/k3s.ts +2061 -0
- package/src/components/postgres.ts +132 -0
- package/src/components/replayFake.ts +1015 -0
- package/src/components/s3.ts +132 -0
- package/src/components/supabase.ts +1699 -0
- package/src/daemon.ts +5489 -0
- package/src/harness/build-context.test.ts +0 -0
- package/src/harness/build-context.ts +146 -0
- package/src/harness/buildkit-progress.test.ts +98 -0
- package/src/harness/buildkit-progress.ts +74 -0
- package/src/harness/container-run.test.ts +209 -0
- package/src/harness/container-run.ts +158 -0
- package/src/harness/file-mounts.test.ts +185 -0
- package/src/harness/file-mounts.ts +145 -0
- package/src/harness/hostmatch.test.ts +148 -0
- package/src/harness/hostmatch.ts +109 -0
- package/src/harness/http-proxy.test.ts +156 -0
- package/src/harness/http-proxy.ts +119 -0
- package/src/harness/ingress-rebind.test.ts +125 -0
- package/src/harness/ingress-table.test.ts +172 -0
- package/src/harness/ingress-table.ts +186 -0
- package/src/harness/log-delta.test.ts +125 -0
- package/src/harness/log-delta.ts +100 -0
- package/src/harness/main.test.ts +211 -0
- package/src/harness/main.ts +196 -0
- package/src/harness/methods.test.ts +63 -0
- package/src/harness/methods.ts +92 -0
- package/src/harness/names-registry.test.ts +137 -0
- package/src/harness/names-registry.ts +108 -0
- package/src/harness/protocol.test.ts +148 -0
- package/src/harness/protocol.ts +163 -0
- package/src/harness/ready-poll.test.ts +172 -0
- package/src/harness/ready-poll.ts +93 -0
- package/src/harness/service-graph.test.ts +97 -0
- package/src/harness/service-graph.ts +97 -0
- package/src/harness/volume-paths.test.ts +102 -0
- package/src/harness/volume-paths.ts +112 -0
- package/src/ids.ts +89 -0
- package/src/index.ts +2725 -0
- package/src/ingress.ts +305 -0
- package/src/inspect.ts +739 -0
- package/src/locator.ts +716 -0
- package/src/mobile.ts +133 -0
- package/src/record-secrets.ts +41 -0
- package/src/recorder.ts +846 -0
- package/src/redis.ts +202 -0
- package/src/replay-bundle.ts +108 -0
- package/src/resolver.ts +348 -0
- package/src/s3.ts +333 -0
- package/src/sql.ts +243 -0
- package/src/terminal.ts +740 -0
- package/src/url-match.ts +67 -0
- package/src/vendor/rrweb-plugin-console-record.umd.js +521 -0
- package/src/vendor/rrweb-record.min.js +5061 -0
package/dist/components/k3s.js
CHANGED
|
@@ -6,7 +6,7 @@ import { readFile, unlink } from "node:fs/promises";
|
|
|
6
6
|
import { AppsV1Api, BatchV1Api, CoreV1Api, KubeConfig, KubernetesObjectApi, PatchStrategy, ResponseContext, ServerConfiguration, createConfiguration, loadAllYaml, } from "@kubernetes/client-node";
|
|
7
7
|
import { Observable } from "@kubernetes/client-node/dist/gen/rxjsStub.js";
|
|
8
8
|
import { dnsName, provides, SELF_SERVICE_TOKEN } from "../index.js";
|
|
9
|
-
import {
|
|
9
|
+
import { deepUnwrap, readTag, wrap } from "../inspect.js";
|
|
10
10
|
import { recorderAnnotate, recorderRemove } from "../recorder.js";
|
|
11
11
|
/** Port the in-cluster registry listens on (plain HTTP). */
|
|
12
12
|
const K3S_REGISTRY_PORT = 5000;
|
|
@@ -345,29 +345,6 @@ async function doFetch(request) {
|
|
|
345
345
|
binary: async () => buf,
|
|
346
346
|
});
|
|
347
347
|
}
|
|
348
|
-
/**
|
|
349
|
-
* Recursively strip the inspector's carrier/proxy wrappers from a
|
|
350
|
-
* value. Needed for arguments flowing into the kubernetes/client-node
|
|
351
|
-
* API methods — if a wrapped pod's `metadata.name` (a primitive-carrier
|
|
352
|
-
* object) reaches a URL template, the lib stringifies it to
|
|
353
|
-
* `"[object Object]"` and the request 404s.
|
|
354
|
-
*/
|
|
355
|
-
function deepUnwrap(value) {
|
|
356
|
-
if (value === null || value === undefined)
|
|
357
|
-
return value;
|
|
358
|
-
const raw = readRaw(value);
|
|
359
|
-
if (raw !== value)
|
|
360
|
-
return deepUnwrap(raw);
|
|
361
|
-
if (typeof value !== "object")
|
|
362
|
-
return value;
|
|
363
|
-
if (Array.isArray(value))
|
|
364
|
-
return value.map(deepUnwrap);
|
|
365
|
-
const out = {};
|
|
366
|
-
for (const [k, v] of Object.entries(value)) {
|
|
367
|
-
out[k] = deepUnwrap(v);
|
|
368
|
-
}
|
|
369
|
-
return out;
|
|
370
|
-
}
|
|
371
348
|
/**
|
|
372
349
|
* Wrap a `@kubernetes/client-node` Api instance so each method call
|
|
373
350
|
* runs in its own AsyncLocalStorage slot — `doFetch` writes the HTTP
|
|
@@ -50,17 +50,19 @@ export interface SupabaseOptions {
|
|
|
50
50
|
*/
|
|
51
51
|
hostname?: string;
|
|
52
52
|
/**
|
|
53
|
-
* Capture GoTrue's outgoing mail (magic links, OTPs,
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* mail-client-style on the dashboard timeline.
|
|
53
|
+
* Capture GoTrue's outgoing mail (signup confirmations, magic links, OTPs,
|
|
54
|
+
* password recovery, invites) with the standard `email()` component. **On
|
|
55
|
+
* by default**: the stack includes the capture server (`<name>-mail`) with
|
|
56
|
+
* GoTrue's SMTP wired at it, and tests read the mailbox through the typed
|
|
57
|
+
* helpers at `ctx.svc.<name>.mail` (`lastEmail` / `emails` / `clear`), each
|
|
58
|
+
* captured message rendering mail-client-style on the dashboard timeline.
|
|
60
59
|
*
|
|
61
|
-
* Signups
|
|
62
|
-
* purely additive
|
|
63
|
-
*
|
|
60
|
+
* Signups complete in **one step** by default (`autoconfirm: true`), so
|
|
61
|
+
* the mailbox is purely additive and a suite that just needs accounts
|
|
62
|
+
* writes nothing extra. Pass `{ autoconfirm: false }` to run the real
|
|
63
|
+
* confirmation flow instead — the signup then issues no session until a
|
|
64
|
+
* test follows the emailed link out of the mailbox. Pass
|
|
65
|
+
* `{ service: "<key>" }` to point GoTrue at
|
|
64
66
|
* an `email()` service the environment already declares — keep a single
|
|
65
67
|
* mailbox per environment rather than one per component: if the app under
|
|
66
68
|
* test also sends mail, share one `email()` between it and Supabase
|
|
@@ -81,24 +83,75 @@ export interface SupabaseOptions {
|
|
|
81
83
|
serviceRole?: string[];
|
|
82
84
|
};
|
|
83
85
|
/**
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
86
|
+
* Where the project's SQL migrations live, e.g. `"supabase/migrations"`
|
|
87
|
+
* (relative to the project root, or absolute). **Nothing is applied unless
|
|
88
|
+
* you set this** — there is no assumed path, so a project whose schema
|
|
89
|
+
* arrives some other way (an app that migrates itself at boot, a dump
|
|
90
|
+
* restored in `setup`) never gets a second, surprising source of DDL.
|
|
91
|
+
*
|
|
92
|
+
* Every `*.sql` directly in the directory is applied in sorted filename
|
|
93
|
+
* order, then — the standard Supabase layout — the **`seed.sql` beside
|
|
94
|
+
* that directory**, if there is one:
|
|
95
|
+
*
|
|
96
|
+
* ```
|
|
97
|
+
* supabase/
|
|
98
|
+
* migrations/0001_init.sql ← applied, sorted
|
|
99
|
+
* migrations/0002_todos.sql
|
|
100
|
+
* seed.sql ← applied last
|
|
101
|
+
* ```
|
|
102
|
+
*
|
|
103
|
+
* It all runs **once the whole stack is up** — the same point `supabase db
|
|
104
|
+
* reset` applies migrations — so your SQL may use schema the services
|
|
105
|
+
* create when they boot (`storage.buckets`, the modern `auth.*` tables).
|
|
106
|
+
* PostgREST's schema cache is reloaded afterwards.
|
|
107
|
+
*
|
|
108
|
+
* A path that doesn't resolve is an error at env start; a silent no-op
|
|
109
|
+
* there surfaces much later as a confusing `relation … does not exist`.
|
|
92
110
|
* Because `supabase/**` is project content, editing a migration correctly
|
|
93
111
|
* forces a cold rebuild and re-apply (unlike `spectest/tests/**`).
|
|
94
112
|
*/
|
|
95
|
-
migrations?:
|
|
113
|
+
migrations?: string;
|
|
96
114
|
/**
|
|
97
|
-
*
|
|
98
|
-
* `supabase/
|
|
99
|
-
*
|
|
115
|
+
* Where the project's **edge functions** live, e.g.
|
|
116
|
+
* `"supabase/functions"` — one subdirectory per function, each with an
|
|
117
|
+
* entrypoint the runtime can serve (`supabase/functions/hello/index.ts`).
|
|
118
|
+
*
|
|
119
|
+
* **Nothing runs unless you set this.** Point at the directory and every
|
|
120
|
+
* function in it is served on the real Supabase edge runtime at
|
|
121
|
+
* `<url>/functions/v1/<name>` through the gateway — the same path
|
|
122
|
+
* `supabase.functions.invoke(...)` derives, so the app under test needs no
|
|
123
|
+
* override. Leave it unset and the runtime is left out of the stack
|
|
124
|
+
* entirely, along with the gateway's `/functions/v1` route.
|
|
125
|
+
*
|
|
126
|
+
* Function code is read straight from the repo — nothing is copied or
|
|
127
|
+
* bundled — so editing a function is an ordinary project edit.
|
|
128
|
+
*
|
|
129
|
+
* Pass an object instead of a path to turn JWT verification off, or to set
|
|
130
|
+
* the function secrets your code reads with `Deno.env.get(...)`.
|
|
100
131
|
*/
|
|
101
|
-
|
|
132
|
+
functions?: string | SupabaseFunctionsOptions;
|
|
133
|
+
}
|
|
134
|
+
/** Tuning for `SupabaseOptions.functions`. */
|
|
135
|
+
export interface SupabaseFunctionsOptions {
|
|
136
|
+
/**
|
|
137
|
+
* Directory holding one subdirectory per function, relative to the project
|
|
138
|
+
* root (or absolute). Required — there is no assumed location.
|
|
139
|
+
*/
|
|
140
|
+
dir: string;
|
|
141
|
+
/**
|
|
142
|
+
* Reject a call that carries no valid JWT, exactly as hosted Supabase
|
|
143
|
+
* does. Default `true` — so a test that forgets the `Authorization`
|
|
144
|
+
* header fails here instead of in production. Set `false` for the
|
|
145
|
+
* `--no-verify-jwt` behaviour (webhooks, public endpoints).
|
|
146
|
+
*/
|
|
147
|
+
verifyJwt?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Extra environment variables the functions read (`Deno.env.get("…")`) —
|
|
150
|
+
* the local stand-in for function secrets. `SUPABASE_URL`,
|
|
151
|
+
* `SUPABASE_ANON_KEY`, `SUPABASE_SERVICE_ROLE_KEY`, `SUPABASE_DB_URL` and
|
|
152
|
+
* `JWT_SECRET` are already set for you.
|
|
153
|
+
*/
|
|
154
|
+
env?: Record<string, string>;
|
|
102
155
|
}
|
|
103
156
|
/** Tuning for `SupabaseOptions.mail`. */
|
|
104
157
|
export interface SupabaseMailOptions {
|
|
@@ -110,10 +163,17 @@ export interface SupabaseMailOptions {
|
|
|
110
163
|
*/
|
|
111
164
|
service?: string;
|
|
112
165
|
/**
|
|
113
|
-
* Whether GoTrue
|
|
114
|
-
* in one step and send no
|
|
115
|
-
* mail
|
|
116
|
-
*
|
|
166
|
+
* Whether GoTrue confirms a signup without the emailed verification.
|
|
167
|
+
* **`true` by default**: signups complete in one step and send no
|
|
168
|
+
* confirmation mail, which keeps account creation a single call in the
|
|
169
|
+
* suites where it is setup rather than the thing under test.
|
|
170
|
+
*
|
|
171
|
+
* Set `false` to run the flow a hosted project runs: the signup issues no
|
|
172
|
+
* session, and the test follows the emailed link out of the mailbox
|
|
173
|
+
* exactly as a user would (see `examples/supabase-app`). Recovery,
|
|
174
|
+
* magic-link, OTP and invite mail is sent either way. Forced `true` when
|
|
175
|
+
* the stack has no mailbox (`mail: false`), since the confirmation would
|
|
176
|
+
* go nowhere.
|
|
117
177
|
*/
|
|
118
178
|
autoconfirm?: boolean;
|
|
119
179
|
/** Sender address GoTrue mails from. Default `admin@example.com`. */
|