@beryl-so/cli 0.42.0 → 0.43.0
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/dist/commands/runs.js +60 -3
- package/package.json +1 -1
package/dist/commands/runs.js
CHANGED
|
@@ -552,8 +552,13 @@ export const runCommands = [
|
|
|
552
552
|
description: "Over MCP the failure screenshots come back as viewable image content, so an agent can " +
|
|
553
553
|
"look at the page that broke instead of guessing from the error string. Set screenshots " +
|
|
554
554
|
"to false to skip fetching them. Ignored outside MCP (the terminal cannot show an image). " +
|
|
555
|
-
"Returns the run row with
|
|
556
|
-
"
|
|
555
|
+
"Returns the run row with every per-test result unless --page is given; pass --page to " +
|
|
556
|
+
"read a large run a slice at a time, optionally narrowed by --status, --group or --q, " +
|
|
557
|
+
"which keeps the output readable rather than saving a round trip. With --page the " +
|
|
558
|
+
"match total and page counts come back under results_page. Paged results are the run's " +
|
|
559
|
+
"settled tests only: anything still running, healing or queued is left out. " +
|
|
560
|
+
"`runs report` returns the generated report document, `runs explain` an AI explanation " +
|
|
561
|
+
"of one failed result.",
|
|
557
562
|
scope: "project",
|
|
558
563
|
args: [{ name: "run-id", description: "Run id", required: true }],
|
|
559
564
|
flags: [
|
|
@@ -563,10 +568,62 @@ export const runCommands = [
|
|
|
563
568
|
default: true,
|
|
564
569
|
description: "Attach failure screenshots as image content (MCP only; default true)",
|
|
565
570
|
},
|
|
571
|
+
{
|
|
572
|
+
name: "page",
|
|
573
|
+
type: "number",
|
|
574
|
+
description: "Return only this 1-indexed page of results instead of every result",
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
name: "page-size",
|
|
578
|
+
type: "number",
|
|
579
|
+
description: "Results per page when --page is given (default 20, max 100)",
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
name: "status",
|
|
583
|
+
type: "string",
|
|
584
|
+
description: "With --page, show only this bucket: passed, failed, errored, cancelled, or " +
|
|
585
|
+
"quarantined",
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
name: "group",
|
|
589
|
+
type: "string",
|
|
590
|
+
description: "With --page, show only results whose test is in this group (by name; see " +
|
|
591
|
+
"`beryl groups list`)",
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
name: "ungrouped",
|
|
595
|
+
type: "boolean",
|
|
596
|
+
description: "With --page, show only results whose test carries no group",
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
name: "q",
|
|
600
|
+
type: "string",
|
|
601
|
+
description: "With --page, show only results whose test title contains this text " +
|
|
602
|
+
"(case-insensitive)",
|
|
603
|
+
},
|
|
566
604
|
],
|
|
567
605
|
async run(ctx, input) {
|
|
568
606
|
const { workspaceId, projectId } = await ctx.requireProject(input);
|
|
569
|
-
const
|
|
607
|
+
const runPath = `${projectPath(workspaceId, projectId)}/runs/${arg(input, "run-id")}`;
|
|
608
|
+
const page = flagNum(input, "page");
|
|
609
|
+
// The run row (header, counters) only exists on the unpaged route, so --page still
|
|
610
|
+
// fetches it and then swaps test_results for the requested slice. This trims what
|
|
611
|
+
// the caller has to read, not what the api has to send.
|
|
612
|
+
const data = (await ctx.client.get(runPath));
|
|
613
|
+
if (page !== undefined) {
|
|
614
|
+
const { items, ...meta } = (await ctx.client.get(`${runPath}/results/page`, {
|
|
615
|
+
page,
|
|
616
|
+
page_size: flagNum(input, "page-size"),
|
|
617
|
+
status: flagStr(input, "status"),
|
|
618
|
+
group: flagBool(input, "ungrouped") ? "__ungrouped__" : flagStr(input, "group"),
|
|
619
|
+
q: flagStr(input, "q"),
|
|
620
|
+
}));
|
|
621
|
+
const paged = data;
|
|
622
|
+
paged.test_results = items;
|
|
623
|
+
// total / page / page_size / status_totals / group_counts ride along: without
|
|
624
|
+
// them a caller cannot tell whether another page exists short of asking for it.
|
|
625
|
+
paged.results_page = meta;
|
|
626
|
+
}
|
|
570
627
|
// Only the MCP adapter renders images; fetching bytes for a plain CLI run
|
|
571
628
|
// would be wasted network.
|
|
572
629
|
if (!ctx.mcp || input.flags.screenshots === false)
|
package/package.json
CHANGED