@plune-ai/cli 0.32.0 → 0.32.1

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/README.md CHANGED
@@ -372,9 +372,9 @@ Every `*.xml` in the folder that is a JUnit report is read, in the order of the
372
372
  one run. The folder's other files and its subfolders (Gradle's `binary/`) are not opened; an `*.xml` that is not a
373
373
  JUnit report is skipped with a line in the output. Each test arrives with its class and name as the key
374
374
  (`cart.CartTest#addsAnItem` from Surefire; Gradle keeps the brackets, `cart.CartTest#addsAnItem()`), its status
375
- (`pass`, `failure`, `error`, `skipped`), the failure's message, type and stack trace, and its duration when the suite
376
- has a `timestamp`. Gradle writes one; Surefire's report has none, so Maven tests arrive without a duration for now
377
- (plune-ai/plune#2310). A file reaches a test only
375
+ (`pass`, `failure`, `error`, `skipped`), the failure's message, type and stack trace, and its duration. Gradle writes
376
+ a `timestamp` on the suite, and a test's span starts there; Surefire writes none, so a Maven test's span ends when the
377
+ import reads the report (plune-ai/plune#2310). A file reaches a test only
378
378
  through a `[[ATTACHMENT|path]]` line in its own output, [as above](#files-from-a-junit-report), the path counted from
379
379
  the folder the XML file is in. Gradle puts that output in the test's testcase only with
380
380
  `reports.junitXml.outputPerTestCase = true` (by default it writes it once per suite).
package/dist/cli.cjs CHANGED
@@ -5406,23 +5406,28 @@ function specRefOf(test, suite, classname) {
5406
5406
  }
5407
5407
  return classname === "" ? void 0 : classname;
5408
5408
  }
5409
- function executionOf(test, suite) {
5410
- const stamp = suite?.attrs["timestamp"];
5411
- if (stamp === void 0 || stamp === "") return void 0;
5412
- const started = new Date(stamp);
5413
- if (Number.isNaN(started.getTime())) return void 0;
5409
+ function executionOf(test, suite, now) {
5414
5410
  const seconds = Number.parseFloat(test.attrs["time"] ?? "");
5415
- const durationMs = Number.isFinite(seconds) && seconds >= 0 ? Math.round(seconds * 1e3) : 0;
5411
+ const timed = Number.isFinite(seconds) && seconds >= 0;
5412
+ const durationMs = timed ? Math.round(seconds * 1e3) : 0;
5413
+ const stamp = suite?.attrs["timestamp"];
5414
+ const dated = stamp === void 0 || stamp === "" ? void 0 : new Date(stamp);
5415
+ let started;
5416
+ if (dated !== void 0 && !Number.isNaN(dated.getTime())) started = dated;
5417
+ else if (timed) started = new Date(now.getTime() - durationMs);
5418
+ else return void 0;
5419
+ const finished = new Date(started.getTime() + durationMs);
5420
+ if (Number.isNaN(started.getTime()) || Number.isNaN(finished.getTime())) return void 0;
5416
5421
  return {
5417
5422
  startedAt: started.toISOString(),
5418
- finishedAt: new Date(started.getTime() + durationMs).toISOString(),
5423
+ finishedAt: finished.toISOString(),
5419
5424
  durationMs,
5420
5425
  // The base format has no reruns. Surefire's `<rerunFailure>` does, and reading it is work for
5421
5426
  // the day somebody asks; reporting 0 says «first attempt», which is true of every case here.
5422
5427
  retry: 0
5423
5428
  };
5424
5429
  }
5425
- function readJUnit(source, file, missing = [], notes = []) {
5430
+ function readJUnit(source, file, missing = [], notes = [], now = /* @__PURE__ */ new Date()) {
5426
5431
  const doc = parseXml(source, file);
5427
5432
  const { lexical, real: folder } = reportFolders(file);
5428
5433
  const found = [];
@@ -5436,7 +5441,7 @@ function readJUnit(source, file, missing = [], notes = []) {
5436
5441
  const stated = TOKEN2.exec(playwright?.titles.at(-1) ?? name)?.[1];
5437
5442
  const specRef = specRefOf(test, suite, classname);
5438
5443
  const errorContext = errorTextOf(detail);
5439
- const execution = executionOf(test, suite);
5444
+ const execution = executionOf(test, suite, now);
5440
5445
  const title = titleOf(classname, name);
5441
5446
  const rkey = resultKey(key.value, 0);
5442
5447
  const files = filesOfTest(test, folder, title, missing, { lexical, resultKey: rkey, notes });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plune-ai/cli",
3
- "version": "0.32.0",
3
+ "version": "0.32.1",
4
4
  "description": "AI-powered assertion testing for LLM apps — write assertions, run them against any provider, get a pass/fail report (local, CI, or diff).",
5
5
  "keywords": [
6
6
  "ai",