@norskvideo/ctl-test-harness 0.1.45 → 0.1.46

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/container-logs.js CHANGED
@@ -125,14 +125,28 @@ export function preserveEngineLogs(runtimeRoot, dest) {
125
125
  continue;
126
126
  }
127
127
  if (name === "logs") {
128
- // Copy the whole tree wholesale; don't descend further.
128
+ // Copy the tree, but CHILD BY CHILD: a root-owned sibling (e.g. studio
129
+ // logs when studio runs as root) must not abort the copy of the media
130
+ // logs we came for. Don't descend further past a logs/ dir.
131
+ let children;
129
132
  try {
130
- cpSync(p, join(dest, relative(runtimeRoot, p)), { recursive: true });
131
- copied += 1;
133
+ children = readdirSync(p);
132
134
  }
133
135
  catch {
134
- /* best-effort */
136
+ continue;
135
137
  }
138
+ let any = false;
139
+ for (const child of children) {
140
+ try {
141
+ cpSync(join(p, child), join(dest, relative(runtimeRoot, p), child), { recursive: true });
142
+ any = true;
143
+ }
144
+ catch {
145
+ /* best-effort per child */
146
+ }
147
+ }
148
+ if (any)
149
+ copied += 1;
136
150
  }
137
151
  else {
138
152
  walk(p);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-test-harness",
3
- "version": "0.1.45",
3
+ "version": "0.1.46",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
package/smoke.js CHANGED
@@ -392,14 +392,17 @@ export async function runProductSmoke(slug, spec, deps = defaultSmokeDeps) {
392
392
  journeyError = e;
393
393
  }
394
394
  // Preserve the engine logs BEFORE anything tears the store down. norsk-ctl
395
- // bind-mounts each media container's /var/log/norsk to the store, so the full
396
- // structured debug.json is on disk here -- but `product remove`,
397
- // `instance delete --purge`, cleanup and the root nuke below all destroy it.
398
- // We pretty much always want the Norsk logs from a smoke run; when a CI log
399
- // dir is set, copy every logs/ tree out first so the workflow can upload it.
395
+ // bind-mounts each media container's /var/log/norsk to <runnerDir>/logs/media,
396
+ // and runnerDir is <storeDir>/product-instances/<id> -- a SIBLING of the
397
+ // workdir (:/data, under <storeDir>/norsk-runtime), NOT under it. So walk the
398
+ // whole storeDir, not just norsk-runtime, or the logs/ tree is never found
399
+ // (this is why it preserved 0). `product remove`, `instance delete --purge`,
400
+ // cleanup and the root nuke below all destroy it, and we pretty much always
401
+ // want the Norsk logs from a smoke run; when a CI log dir is set, copy every
402
+ // logs/ tree out first so the workflow can upload it.
400
403
  const ciLogDir = process.env.NORSK_CI_LOG_DIR;
401
404
  if (ciLogDir) {
402
- const n = preserveEngineLogs(join(storeDir, "norsk-runtime"), join(ciLogDir, slug));
405
+ const n = preserveEngineLogs(storeDir, join(ciLogDir, slug));
403
406
  deps.log(`${slug}: preserved ${n} engine log tree(s) -> ${join(ciLogDir, slug)}`);
404
407
  }
405
408
  if (handles.length)