@norskvideo/ctl-test-harness 0.1.14 → 0.1.15
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/package.json +1 -1
- package/smoke.d.ts +6 -2
- package/smoke.js +7 -4
package/package.json
CHANGED
package/smoke.d.ts
CHANGED
|
@@ -87,7 +87,7 @@ export interface SmokeSpec {
|
|
|
87
87
|
clearedMs?: number;
|
|
88
88
|
};
|
|
89
89
|
/** Override the banded ports (see smokePorts). */
|
|
90
|
-
ports?: Partial<
|
|
90
|
+
ports?: Partial<SmokePorts>;
|
|
91
91
|
}
|
|
92
92
|
/** What the observation kinds read. Injected so the phase rule is tested
|
|
93
93
|
* without Studio; defaults are studio-state's fetchers. */
|
|
@@ -133,7 +133,11 @@ export interface SmokeDeps {
|
|
|
133
133
|
/** Per-slug port band, above the product integration harnesses' own bands:
|
|
134
134
|
* daemon, dev backend, published Studio port and an instance base, twenty
|
|
135
135
|
* apart per slug. */
|
|
136
|
-
export
|
|
136
|
+
export interface SmokePorts extends BaseHarnessPorts {
|
|
137
|
+
/** The daemon's oauth2 proxy; banded so co-located runs never meet on :9443. */
|
|
138
|
+
proxyPort: number;
|
|
139
|
+
}
|
|
140
|
+
export declare function smokePorts(slug: string, overrides?: Partial<SmokePorts>): SmokePorts;
|
|
137
141
|
export declare const defaultSmokeDeps: SmokeDeps;
|
|
138
142
|
/** Whether an observation depends on a source being pumped. Structural ones
|
|
139
143
|
* run the satisfied phase only. */
|
package/smoke.js
CHANGED
|
@@ -33,15 +33,13 @@ const SMOKE_BAND_WIDTH = 20;
|
|
|
33
33
|
const SMOKE_BANDS = 50;
|
|
34
34
|
const STUDIO_HOST_PORT_PARAM = "STUDIO_HOST_PORT";
|
|
35
35
|
const NUKE_IMAGE = "alpine:3";
|
|
36
|
-
/** Per-slug port band, above the product integration harnesses' own bands:
|
|
37
|
-
* daemon, dev backend, published Studio port and an instance base, twenty
|
|
38
|
-
* apart per slug. */
|
|
39
36
|
export function smokePorts(slug, overrides = {}) {
|
|
40
37
|
const daemonPort = SMOKE_PORT_BASE + hashSlot(`smoke:${slug}`, SMOKE_BANDS) * SMOKE_BAND_WIDTH;
|
|
41
38
|
return {
|
|
42
39
|
daemonPort,
|
|
43
40
|
backendPort: daemonPort + 1,
|
|
44
41
|
studioHostPort: daemonPort + 2,
|
|
42
|
+
proxyPort: daemonPort + 3,
|
|
45
43
|
instancePortBase: daemonPort + 10,
|
|
46
44
|
...overrides,
|
|
47
45
|
};
|
|
@@ -189,13 +187,18 @@ export async function runProductSmoke(slug, spec, deps = defaultSmokeDeps) {
|
|
|
189
187
|
let launched = false;
|
|
190
188
|
let handles = [];
|
|
191
189
|
try {
|
|
192
|
-
// The same zero point as the guides: `init` on a virgin store, not a seeded
|
|
190
|
+
// The same zero point as the guides: `init` on a virgin store, not a seeded
|
|
191
|
+
// config.yaml. No http redirect (port 80 needs root) and a banded proxy port
|
|
192
|
+
// (the default :9443 would meet a co-located integration run).
|
|
193
193
|
await cliOk([
|
|
194
194
|
"init",
|
|
195
195
|
"--network-mode",
|
|
196
196
|
spec.networkMode ?? "docker",
|
|
197
197
|
"--working-directory",
|
|
198
198
|
join(storeDir, "norsk-runtime"),
|
|
199
|
+
"--proxy-port",
|
|
200
|
+
String(ports.proxyPort),
|
|
201
|
+
"--no-http-redirect",
|
|
199
202
|
"--no-start-server",
|
|
200
203
|
]);
|
|
201
204
|
const started = deps.startDaemon(storeDir, { port: ports.daemonPort, seedConfig: false });
|