@mark1russell7/harness 0.16.20 → 0.16.21

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.
@@ -1313,17 +1313,24 @@ const planOf = (source) => {
1313
1313
  };
1314
1314
  /** These counts are how many lines of the output of a failed build its error holds: its error lines, then its last lines. */
1315
1315
  const BUILD_ERRORS = 10;
1316
+ const BUILD_PANICS = 4;
1317
+ const ERROR_LINE = /\berror\b/i;
1318
+ /** A failed Rust test writes "thread '<test>' panicked at <file>:<line>:<column>:", and its message on the next line. */
1319
+ const PANIC_LINE = /\bpanicked at\b/;
1316
1320
  /**
1317
- * This function gives the lines of the output of a failed build that its error holds. They are each
1318
- * line that names an error, for example the diagnostic of a compiler, then the last lines.
1321
+ * This function gives the lines of the output of a failed build that its error holds. It keeps each
1322
+ * line that names an error, for example a compiler diagnostic, and each panic of a test with its
1323
+ * message. Then it keeps the last lines. The tail of BuildKit holds the summary of a failed test, not its panic (SYS-146).
1319
1324
  */
1320
1325
  const buildFailure = (output) => {
1321
1326
  const lines = output.trim().split(/\r?\n/);
1322
1327
  const tail = lines.slice(-15);
1323
- const errors = lines.slice(0, -15).filter((line) => /\berror\b/i.test(line)).slice(0, BUILD_ERRORS);
1328
+ const head = lines.slice(0, -15);
1329
+ const indexesOf = (pattern, limit) => head.flatMap((line, index) => pattern.test(line) ? [index] : []).slice(0, limit);
1330
+ const kept = [.../* @__PURE__ */ new Set([...indexesOf(ERROR_LINE, BUILD_ERRORS), ...indexesOf(PANIC_LINE, BUILD_PANICS).flatMap((index) => [index, index + 1])])].filter((index) => index < head.length).sort((left, right) => left - right).map((index) => head[index]);
1324
1331
  return [
1325
- ...errors,
1326
- ...errors.length > 0 ? ["..."] : [],
1332
+ ...kept,
1333
+ ...kept.length > 0 ? ["..."] : [],
1327
1334
  ...tail
1328
1335
  ].join("\n");
1329
1336
  };
@@ -1446,4 +1453,4 @@ const targetSourceOf = (target) => target.subject ?? target.image;
1446
1453
  const targetImageOf = (target) => imageOf(targetSourceOf(target));
1447
1454
  export { hostLimitsOf as $, targetSourceOf as A, versionsOf as B, programOf as C, subjectClient as D, sources as E, goVersions as F, requestFirst as G, environmentProblems as H, jarVersions as I, cgroupKeyed as J, RESOURCES_EVENT as K, locksOf as L, unpinnedBases as M, LOCK_NAMES as N, subjectProblems as O, cargoVersions as P, cpuStatOf as Q, npmDrift as R, planOf as S, shippedSource as T, isHopPlace as U, CLIENT_CAPABILITIES as V, latestEndOf as W, cgroupNumber as X, cgroupLimit as Y, cpuMaxOf as Z, kafkaClientImage as _, loadPlanOf as _t, SHIPPED_NAMES as a, resourceReadingIn as at, nodeHttpImage as b, streamsLoadOf as bt, buildRecordOf as c, LOAD_FORMAT as ct, harnessImage as d, SCHEDULE_PATH as dt, limitsProblems as et, harnessVersion as f, connectionsProblems as ft, inContext as g, loadOf as gt, imageProblems as h, loadEnds as ht, SHIPPED_CLIENTS as i, resourceChange as it, unlockedManifests as j, targetImageOf as k, goHttpImage as l, LOAD_PATH as lt, imageOf as m, estimateVerdict as mt, PINNED as n, networkOf as nt, amqpClientImage as o, resourceReadingOf as ot, hikariClientImage as p, estimateOf as pt, RESOURCES_PROGRAM as q, REPOSITORY as r, resourceArgs as rt, basesOf as s, CLOSED_TOLERANCE as st, CLIENT_NAMES as t, memoryStatOf as tt, grpcClientImage as u, LOAD_POOL_LIMIT as ut, mongoClientImage as v, loadVerdict as vt, routerImage as w, pgClientImage as x, nodeClientImage as y, poolOf as yt, npmVersions as z };
1448
1455
 
1449
- //# sourceMappingURL=image-38hbUAcd.js.map
1456
+ //# sourceMappingURL=image-Dzofp1ab.js.map