@norskvideo/ctl-test-harness 0.1.39 → 0.1.40

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/demo/harness.d.ts CHANGED
@@ -29,6 +29,11 @@ export interface ProductHarnessOptions {
29
29
  daemonEnv?: Record<string, string>;
30
30
  /** Containers teardown must also wait out — an overridden proxy's pair. */
31
31
  extraContainers?: string[];
32
+ /** File every launched instance id is written to, one per line, BEFORE the
33
+ * launch — what the convention integration.yml's reap step reads after a
34
+ * cancelled run, when teardown never ran. Default `$NORSK_LAUNCHED_MANIFEST`;
35
+ * unset (local dev) writes nothing. */
36
+ launchedManifest?: string;
32
37
  }
33
38
  export interface LaunchOverrides {
34
39
  /** Default `demo-<slug>`. */
@@ -70,6 +75,7 @@ export declare class ProductHarness {
70
75
  private readonly launchedIds;
71
76
  private handles;
72
77
  private readonly deps;
78
+ private readonly launchedManifest;
73
79
  constructor(spec: DemoSpec, opts: ProductHarnessOptions);
74
80
  /** Every CLI step this fixture ran, as a reader would type it, with its output. */
75
81
  get transcript(): readonly CliStep[];
package/demo/harness.js CHANGED
@@ -32,6 +32,7 @@ export class ProductHarness {
32
32
  launchedIds = [];
33
33
  handles = [];
34
34
  deps;
35
+ launchedManifest;
35
36
  constructor(spec, opts) {
36
37
  const mode = opts.mode ?? spec.mode ?? "dev";
37
38
  if (mode === "image" && !spec.image) {
@@ -41,6 +42,7 @@ export class ProductHarness {
41
42
  this.slug = opts.slug ?? demoSlug(spec.product);
42
43
  this.action = opts.action ?? "check";
43
44
  this.deps = opts.deps ?? defaultDemoDeps(opts.cwd);
45
+ this.launchedManifest = opts.launchedManifest ?? process.env.NORSK_LAUNCHED_MANIFEST;
44
46
  this.session = new DemoSession(spec, this.slug, opts.cwd, this.deps, {
45
47
  mode,
46
48
  daemon: opts.daemon ?? "private",
@@ -146,6 +148,10 @@ export class ProductHarness {
146
148
  launchArgv.push("--internal-only");
147
149
  if (!this.launchedIds.includes(instanceId))
148
150
  this.launchedIds.push(instanceId);
151
+ // The whole list each time, not an append: idempotent, and readable by
152
+ // the reap step whether or not this process lives to teardown.
153
+ if (this.launchedManifest)
154
+ this.deps.writeFile(this.launchedManifest, `${this.launchedIds.join("\n")}\n`);
149
155
  await s.cliOk(launchArgv);
150
156
  await s.waitRunning(instanceId);
151
157
  const rows = await s.ingestPorts(instanceId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-test-harness",
3
- "version": "0.1.39",
3
+ "version": "0.1.40",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {