@testsprite/testsprite-cli 0.15.0 → 0.17.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/README.md +53 -141
- package/dist/commands/agent.d.ts +12 -4
- package/dist/commands/agent.js +55 -65
- package/dist/commands/auth.d.ts +6 -10
- package/dist/commands/auth.js +44 -56
- package/dist/commands/ci.d.ts +23 -100
- package/dist/commands/ci.js +297 -489
- package/dist/commands/completion.js +2 -1
- package/dist/commands/conversation.d.ts +27 -0
- package/dist/commands/conversation.js +702 -0
- package/dist/commands/doctor.d.ts +5 -1
- package/dist/commands/doctor.js +130 -34
- package/dist/commands/init.d.ts +4 -45
- package/dist/commands/init.js +116 -68
- package/dist/commands/project-env.d.ts +62 -2
- package/dist/commands/project-env.js +426 -53
- package/dist/commands/project-sign-in.d.ts +0 -48
- package/dist/commands/project-sign-in.js +1 -224
- package/dist/commands/project.d.ts +15 -186
- package/dist/commands/project.js +93 -921
- package/dist/commands/result.d.ts +10 -0
- package/dist/commands/result.js +215 -0
- package/dist/commands/schedule.d.ts +0 -29
- package/dist/commands/schedule.js +47 -97
- package/dist/commands/test.d.ts +315 -1824
- package/dist/commands/test.js +1962 -13733
- package/dist/commands/testlist.d.ts +128 -5
- package/dist/commands/testlist.js +269 -329
- package/dist/commands/tunnel.d.ts +2 -2
- package/dist/commands/tunnel.js +43 -41
- package/dist/commands/usage.d.ts +12 -45
- package/dist/commands/usage.js +51 -131
- package/dist/index.js +189 -108
- package/dist/lib/agent-detect.js +9 -5
- package/dist/lib/agent-targets.d.ts +21 -2
- package/dist/lib/agent-targets.js +88 -11
- package/dist/lib/args.d.ts +13 -0
- package/dist/lib/args.js +49 -0
- package/dist/lib/basic-auth.d.ts +3 -0
- package/dist/lib/basic-auth.js +15 -0
- package/dist/lib/billing-refusal.js +4 -3
- package/dist/lib/ci-linkage.d.ts +4 -82
- package/dist/lib/ci-linkage.js +4 -157
- package/dist/lib/ci-run.js +1 -1
- package/dist/lib/client-factory.d.ts +10 -2
- package/dist/lib/client-factory.js +38 -26
- package/dist/lib/commit-signal.d.ts +65 -0
- package/dist/lib/commit-signal.js +305 -0
- package/dist/lib/concurrency-limiter.d.ts +6 -0
- package/dist/lib/concurrency-limiter.js +29 -0
- package/dist/lib/config.js +10 -5
- package/dist/lib/conflict-reason.d.ts +31 -4
- package/dist/lib/conflict-reason.js +38 -4
- package/dist/lib/conversation/answers.d.ts +9 -0
- package/dist/lib/conversation/answers.js +49 -0
- package/dist/lib/conversation/api.d.ts +71 -0
- package/dist/lib/conversation/api.js +150 -0
- package/dist/lib/conversation/change.d.ts +31 -0
- package/dist/lib/conversation/change.js +124 -0
- package/dist/lib/conversation/context.d.ts +19 -0
- package/dist/lib/conversation/context.js +70 -0
- package/dist/lib/conversation/environment.d.ts +15 -0
- package/dist/lib/conversation/environment.js +33 -0
- package/dist/lib/conversation/follow.d.ts +24 -0
- package/dist/lib/conversation/follow.js +42 -0
- package/dist/lib/conversation/render.d.ts +33 -0
- package/dist/lib/conversation/render.js +315 -0
- package/dist/lib/conversation/title.d.ts +2 -0
- package/dist/lib/conversation/title.js +18 -0
- package/dist/lib/conversation/types.d.ts +156 -0
- package/dist/lib/conversation/types.js +6 -0
- package/dist/lib/credentials.js +67 -11
- package/dist/lib/cron.d.ts +1 -1
- package/dist/lib/cron.js +2 -2
- package/dist/lib/dispatch-stop.d.ts +20 -0
- package/dist/lib/dispatch-stop.js +30 -0
- package/dist/lib/download.d.ts +71 -0
- package/dist/lib/download.js +274 -0
- package/dist/lib/dry-run/fetch.d.ts +10 -0
- package/dist/lib/dry-run/fetch.js +20 -0
- package/dist/lib/dry-run/samples.d.ts +6 -34
- package/dist/lib/dry-run/samples.js +389 -751
- package/dist/lib/environment-tunnel.d.ts +16 -26
- package/dist/lib/environment-tunnel.js +161 -157
- package/dist/lib/errors.d.ts +20 -4
- package/dist/lib/errors.js +36 -16
- package/dist/lib/facade.d.ts +7 -29
- package/dist/lib/facade.js +7 -36
- package/dist/lib/failing-fe-resolver.d.ts +13 -58
- package/dist/lib/failing-fe-resolver.js +47 -132
- package/dist/lib/first-suite-hint.d.ts +16 -22
- package/dist/lib/first-suite-hint.js +38 -47
- package/dist/lib/gh-output.d.ts +76 -21
- package/dist/lib/gh-output.js +171 -90
- package/dist/lib/git-utils.d.ts +56 -0
- package/dist/lib/git-utils.js +212 -0
- package/dist/lib/github-context.d.ts +2 -0
- package/dist/lib/github-context.js +40 -8
- package/dist/lib/history-retention.d.ts +6 -2
- package/dist/lib/history-retention.js +10 -7
- package/dist/lib/http.d.ts +58 -134
- package/dist/lib/http.js +352 -271
- package/dist/lib/interrupt.d.ts +14 -8
- package/dist/lib/interrupt.js +28 -10
- package/dist/lib/junit-report.d.ts +60 -4
- package/dist/lib/junit-report.js +209 -32
- package/dist/lib/local-target.d.ts +3 -3
- package/dist/lib/local-target.js +3 -3
- package/dist/lib/output.d.ts +0 -29
- package/dist/lib/output.js +10 -33
- package/dist/lib/pagination.d.ts +2 -5
- package/dist/lib/pagination.js +2 -5
- package/dist/lib/presigned-url.d.ts +22 -0
- package/dist/lib/presigned-url.js +90 -0
- package/dist/lib/prompt.js +36 -2
- package/dist/lib/proxy.js +2 -1
- package/dist/lib/redact.d.ts +2 -2
- package/dist/lib/redact.js +3 -4
- package/dist/lib/removed-commands.d.ts +18 -0
- package/dist/lib/removed-commands.js +154 -0
- package/dist/lib/render-error.d.ts +31 -6
- package/dist/lib/render-error.js +88 -25
- package/dist/lib/response-schemas.d.ts +38 -30
- package/dist/lib/response-schemas.js +210 -207
- package/dist/lib/result/api.d.ts +24 -0
- package/dist/lib/result/api.js +28 -0
- package/dist/lib/result/evidence.d.ts +71 -0
- package/dist/lib/result/evidence.js +420 -0
- package/dist/lib/result/render.d.ts +20 -0
- package/dist/lib/result/render.js +194 -0
- package/dist/lib/result/types.d.ts +122 -0
- package/dist/lib/result/types.js +19 -0
- package/dist/lib/run-output.d.ts +275 -0
- package/dist/lib/run-output.js +227 -0
- package/dist/lib/run-render.d.ts +101 -0
- package/dist/lib/run-render.js +183 -0
- package/dist/lib/run-wait.d.ts +192 -0
- package/dist/lib/run-wait.js +452 -0
- package/dist/lib/runs.types.d.ts +134 -367
- package/dist/lib/runs.types.js +0 -14
- package/dist/lib/secret-file.d.ts +1 -1
- package/dist/lib/secret-file.js +11 -2
- package/dist/lib/skill-nudge.d.ts +7 -27
- package/dist/lib/skill-nudge.js +9 -37
- package/dist/lib/target-path.d.ts +15 -0
- package/dist/lib/target-path.js +35 -0
- package/dist/lib/target-url-advisory.d.ts +19 -0
- package/dist/lib/target-url-advisory.js +31 -0
- package/dist/lib/target-url-preflight.d.ts +9 -0
- package/dist/lib/target-url-preflight.js +214 -106
- package/dist/lib/target-url.d.ts +1 -1
- package/dist/lib/target-url.js +6 -16
- package/dist/lib/telemetry.d.ts +32 -12
- package/dist/lib/telemetry.js +39 -8
- package/dist/lib/terminal-text.d.ts +41 -0
- package/dist/lib/terminal-text.js +127 -0
- package/dist/lib/testlist.types.d.ts +16 -8
- package/dist/lib/testlist.types.js +1 -1
- package/dist/lib/text-equality.d.ts +2 -0
- package/dist/lib/text-equality.js +5 -0
- package/dist/lib/text-file.d.ts +16 -0
- package/dist/lib/text-file.js +41 -0
- package/dist/lib/text-table.d.ts +46 -0
- package/dist/lib/text-table.js +72 -4
- package/dist/lib/ticker.d.ts +9 -2
- package/dist/lib/ticker.js +16 -3
- package/dist/lib/transport-failure.d.ts +22 -0
- package/dist/lib/transport-failure.js +126 -0
- package/dist/lib/tunnel-session.d.ts +7 -1
- package/dist/lib/tunnel-session.js +22 -9
- package/dist/lib/update-check.js +3 -2
- package/dist/lib/url-template.d.ts +43 -0
- package/dist/lib/url-template.js +151 -0
- package/dist/lib/validate.d.ts +0 -64
- package/dist/lib/validate.js +2 -131
- package/dist/lib/version-notice.js +4 -3
- package/dist/lib/wait-exit.d.ts +37 -2
- package/dist/lib/wait-exit.js +88 -30
- package/dist/lib/workspace-status.js +10 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -4
- package/skills/testsprite-ci.skill.md +48 -18
- package/skills/testsprite-onboard.skill.md +66 -151
- package/skills/testsprite-verify.codex.md +54 -56
- package/skills/testsprite-verify.skill.md +194 -358
- package/dist/lib/browser.d.ts +0 -6
- package/dist/lib/browser.js +0 -54
- package/dist/lib/bundle.d.ts +0 -234
- package/dist/lib/bundle.js +0 -781
- package/dist/lib/deprecate.d.ts +0 -10
- package/dist/lib/deprecate.js +0 -13
- package/dist/lib/flaky.d.ts +0 -91
- package/dist/lib/flaky.js +0 -71
- package/dist/lib/plan-poll.d.ts +0 -171
- package/dist/lib/plan-poll.js +0 -441
- package/dist/lib/plans.types.d.ts +0 -130
- package/dist/lib/plans.types.js +0 -31
- package/dist/lib/poll.d.ts +0 -100
- package/dist/lib/poll.js +0 -290
- package/dist/lib/rate-throttle.d.ts +0 -49
- package/dist/lib/rate-throttle.js +0 -75
- package/dist/lib/run-progress.d.ts +0 -41
- package/dist/lib/run-progress.js +0 -56
- package/dist/lib/v3-advisory.d.ts +0 -55
- package/dist/lib/v3-advisory.js +0 -74
- package/schemas/plan.schema.json +0 -61
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* "You have a project, but no tests yet" signposts.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* Tests are written by the project's agent: `testsprite plan` asks it for
|
|
5
|
+
* tests and `testsprite apply` saves what it proposes. A user who is not
|
|
6
|
+
* driving a coding agent otherwise never learns that: `project create` would
|
|
7
|
+
* print the record and stop, and the empty-project outputs would say only
|
|
8
|
+
* "No tests."
|
|
9
9
|
*
|
|
10
10
|
* Text mode only at every call site: a JSON caller already holds the project
|
|
11
11
|
* id, and stdout and the JSON error envelope must stay unchanged. Never under
|
|
12
12
|
* --dry-run (the id there is the canned sample). Printing a hint runs and
|
|
13
|
-
* charges nothing
|
|
13
|
+
* charges nothing.
|
|
14
14
|
*
|
|
15
15
|
* Zero requests: each call site branches only on what it already knows.
|
|
16
|
-
* `project create` knows the type
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* and leaves a local project to the backend's own pre-charge refusal, which
|
|
20
|
-
* carries the same hand-written-plan next step.
|
|
16
|
+
* `project create` knows the type; `run --project --local` knows the app is
|
|
17
|
+
* on this machine. `test list` and a cloud `run --project` know neither, so
|
|
18
|
+
* their sentence names the backend API spec as a clause.
|
|
21
19
|
*/
|
|
22
20
|
import { quoteEnvironmentName } from './environment-tunnel.js';
|
|
23
21
|
import { DEFAULT_LOCAL_HOST } from './local-target.js';
|
|
24
|
-
|
|
22
|
+
import { terminalSafeLine } from './terminal-text.js';
|
|
25
23
|
/**
|
|
26
|
-
* `
|
|
27
|
-
* `
|
|
24
|
+
* `run <test-id>` with the target flags the empty run was given. A bare
|
|
25
|
+
* `run` would resolve the project's DEFAULT environment, which may be a
|
|
28
26
|
* deployed site rather than the app on this machine, so the environment is
|
|
29
27
|
* always named when one was used. `--local-host` is carried whenever the host
|
|
30
28
|
* is not the default: without it a `::1` or `localhost` app would be run
|
|
@@ -42,57 +40,50 @@ function localRunCommand(local) {
|
|
|
42
40
|
}
|
|
43
41
|
if (local.environment !== undefined)
|
|
44
42
|
flags.push(`--env ${quoteEnvironmentName(local.environment)}`);
|
|
45
|
-
return ['testsprite
|
|
43
|
+
return ['testsprite run <test-id>', ...flags].join(' ');
|
|
46
44
|
}
|
|
47
45
|
/** A URL as one shell word: as typed when it is plain, single-quoted otherwise. */
|
|
48
46
|
function shellWord(value) {
|
|
49
47
|
return /^[\w.:/@%+=,~-]+$/.test(value) ? value : quoteEnvironmentName(value);
|
|
50
48
|
}
|
|
51
49
|
/**
|
|
52
|
-
* Multi-line `[hint]` block for stderr after a real `project create`
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* generation explores from the cloud with no tunnel, and the backend refuses
|
|
56
|
-
* it for a local-origin project before any charge), and two "Next" blocks
|
|
57
|
-
* would disagree.
|
|
50
|
+
* Multi-line `[hint]` block for stderr after a real `project create` (text
|
|
51
|
+
* mode): a new project has no environment and no tests, so it names both
|
|
52
|
+
* steps.
|
|
58
53
|
*/
|
|
59
|
-
export function firstSuiteNextSteps(
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
?
|
|
63
|
-
:
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
`testsprite
|
|
67
|
-
`testsprite test plan accept --project ${projectId}`,
|
|
68
|
-
];
|
|
54
|
+
export function firstSuiteNextSteps(wireProjectId, type) {
|
|
55
|
+
const projectId = terminalSafeLine(wireProjectId);
|
|
56
|
+
const env = type === 'backend'
|
|
57
|
+
? `testsprite project env create ${projectId} --name default --url https://api.example.com`
|
|
58
|
+
: `testsprite project env create ${projectId} --name default --url https://app.example.com`;
|
|
59
|
+
const plan = type === 'backend'
|
|
60
|
+
? `testsprite plan --project ${projectId} --file <api-spec.yaml>`
|
|
61
|
+
: `testsprite plan --project ${projectId}`;
|
|
69
62
|
return [
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
`
|
|
63
|
+
'[hint] Next: give the project an environment, then ask its agent for your first tests and apply them:',
|
|
64
|
+
` ${env}`,
|
|
65
|
+
` ${plan}`,
|
|
66
|
+
' testsprite apply',
|
|
73
67
|
].join('\n');
|
|
74
68
|
}
|
|
75
69
|
/**
|
|
76
70
|
* One sentence for an EMPTY project; folded into an error message or a hint.
|
|
77
71
|
*
|
|
78
72
|
* Pass `local` only where the caller knows the project runs on this machine
|
|
79
|
-
* (`
|
|
73
|
+
* (`run --project --local`); see the module comment for why the other
|
|
80
74
|
* callers cannot.
|
|
81
75
|
*/
|
|
82
|
-
export function emptyProjectNextStep(
|
|
76
|
+
export function emptyProjectNextStep(wireProjectId, local) {
|
|
77
|
+
const projectId = terminalSafeLine(wireProjectId);
|
|
83
78
|
if (local) {
|
|
84
|
-
return (`This project has no tests yet
|
|
85
|
-
`
|
|
86
|
-
`
|
|
87
|
-
`
|
|
88
|
-
`then run it with ${localRunCommand(local)}`);
|
|
79
|
+
return (`This project has no tests yet. Ask the project's agent for a first set; its browser ` +
|
|
80
|
+
`can't open an app on your machine, so attach your change: ` +
|
|
81
|
+
`testsprite plan --project ${projectId} --diff, then testsprite apply, ` +
|
|
82
|
+
`then run them with ${localRunCommand(local)}`);
|
|
89
83
|
}
|
|
90
|
-
return (`This project has no tests yet.
|
|
91
|
-
`testsprite
|
|
92
|
-
`
|
|
93
|
-
`(generation uses credits; a backend project needs its API spec uploaded first: ` +
|
|
94
|
-
`testsprite project docs upload <spec> --project ${projectId}). ` +
|
|
95
|
-
`Or write one yourself: ${FIRST_SUITE_FALLBACK}`);
|
|
84
|
+
return (`This project has no tests yet. Ask the project's agent for a first set: ` +
|
|
85
|
+
`testsprite plan --project ${projectId}, then testsprite apply ` +
|
|
86
|
+
`(a backend project: attach its API spec with --file <spec>)`);
|
|
96
87
|
}
|
|
97
88
|
/** The same sentence as a stderr `[hint]` line. */
|
|
98
89
|
export function emptyProjectHint(projectId, local) {
|
package/dist/lib/gh-output.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ import type { ExecutionReport } from './runs.types.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* CI-native output layer for the run path (issue #99, reshaped from
|
|
4
4
|
* the withdrawn top-level `ci` command per the #264 review). Covers both a
|
|
5
|
-
* single `
|
|
5
|
+
* single `run <test-id> --wait` and the `run --project --wait` batch.
|
|
6
6
|
*
|
|
7
7
|
* A `--wait` run presents its result in the formats CI consumes:
|
|
8
|
-
* (a) a stable machine summary `{total, passed, failed, skipped, timedOut,
|
|
9
|
-
*
|
|
8
|
+
* (a) a stable machine summary `{total, passed, failed, blocked?, skipped, timedOut,
|
|
9
|
+
* results[]}` written to `--summary-file <path>` when requested,
|
|
10
10
|
* (b) a Markdown results table appended to `$GITHUB_STEP_SUMMARY` when
|
|
11
11
|
* running under GitHub Actions,
|
|
12
12
|
* (c) one workflow-command line per non-passed run so it annotates the PR
|
|
@@ -18,14 +18,24 @@ import type { ExecutionReport } from './runs.types.js';
|
|
|
18
18
|
* summary file must never mask the batch gate's exit code.
|
|
19
19
|
*/
|
|
20
20
|
export interface CiRunRow {
|
|
21
|
-
|
|
21
|
+
/** Absent for an execution diagnostic or a result without a case key. */
|
|
22
|
+
testId?: string;
|
|
22
23
|
/** Human title for the Test column; falls back to `testId` when absent. */
|
|
23
24
|
title?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The result id (wire name), written out as `resultId`. On a row that never
|
|
27
|
+
* dispatched because the test was already running, it is that run's result.
|
|
28
|
+
*/
|
|
29
|
+
resultId?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The launch the result belongs to (wire name), written out as `runId`.
|
|
32
|
+
* Absent on an older backend.
|
|
33
|
+
*/
|
|
24
34
|
runId?: string;
|
|
25
35
|
status: string;
|
|
26
36
|
/** Test-case page link — anchors the Test column title. */
|
|
27
37
|
dashboardUrl?: string;
|
|
28
|
-
/** This
|
|
38
|
+
/** This result's own page link — anchors the Result column. */
|
|
29
39
|
executionUrl?: string;
|
|
30
40
|
error?: string;
|
|
31
41
|
}
|
|
@@ -33,22 +43,39 @@ export interface CiSummary {
|
|
|
33
43
|
total: number;
|
|
34
44
|
passed: number;
|
|
35
45
|
failed: number;
|
|
46
|
+
/** Disjoint from failed. Absent when no test was blocked. */
|
|
47
|
+
blocked?: number;
|
|
48
|
+
cancelled?: number;
|
|
49
|
+
/** Result-level read errors or unknown verdicts. */
|
|
50
|
+
errors?: number;
|
|
36
51
|
/**
|
|
37
52
|
* Requested tests that never dispatched (deferred / conflict / not_found /
|
|
38
53
|
* skipped / no_tests rows). Kept OUT of `failed`: `failed` claiming
|
|
39
54
|
* a test failed while the exit code says otherwise is the artifacts-disagree
|
|
40
55
|
* bug this field fixes. Non-dispatch still gates the exit where it should
|
|
41
|
-
* (deferred → 7, all-conflict → 6,
|
|
56
|
+
* (deferred → 7, all-conflict → 6, not-found → 4, zero-dispatch → 5).
|
|
42
57
|
*/
|
|
43
58
|
skipped: number;
|
|
44
59
|
timedOut: number;
|
|
45
|
-
|
|
60
|
+
/** Present when a wait ends with dispatched tests still running. */
|
|
61
|
+
running?: number;
|
|
62
|
+
/**
|
|
63
|
+
* One row per requested test. Not `runs`: in what the CLI prints, `runs[]`
|
|
64
|
+
* is the launches, each with its results.
|
|
65
|
+
*/
|
|
66
|
+
results: CiRunRow[];
|
|
46
67
|
/**
|
|
47
68
|
* The server's execution report (the GitHub App comment content) when the
|
|
48
|
-
* backend could provide one for this batch
|
|
49
|
-
*
|
|
69
|
+
* backend could provide one for this batch: absent, never null, on an older
|
|
70
|
+
* backend or when no report arrived in time.
|
|
50
71
|
*/
|
|
51
72
|
executionReport?: ExecutionReport;
|
|
73
|
+
/** Execution-level failures that cannot be inferred from individual result verdicts. */
|
|
74
|
+
runFailures?: Array<{
|
|
75
|
+
runId: string;
|
|
76
|
+
status: 'cancelled' | 'error' | 'timeout';
|
|
77
|
+
message: string;
|
|
78
|
+
}>;
|
|
52
79
|
}
|
|
53
80
|
export declare function isNonDispatchedStatus(status: string): boolean;
|
|
54
81
|
/**
|
|
@@ -64,18 +91,27 @@ export declare function isNonDispatchedStatus(status: string): boolean;
|
|
|
64
91
|
* gates' call, and a `failed` count the gates disagree with is exactly the
|
|
65
92
|
* artifacts-contradict-the-exit bug.
|
|
66
93
|
*
|
|
67
|
-
* `
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* default would silently change its artifacts.
|
|
94
|
+
* `foldSkippedBuckets` (the `ci run` contract) keeps a `not_found` conflict's
|
|
95
|
+
* own status so the `ci run` gate can exit 4 for it. Default off — for
|
|
96
|
+
* `run --project` it stays a conflict row, and changing that default would
|
|
97
|
+
* silently change its artifacts.
|
|
72
98
|
*/
|
|
73
99
|
export declare function summarizeAcceptedPayload(capturedJson: string, opts?: {
|
|
74
100
|
notFoundNote?: string;
|
|
75
101
|
foldSkippedBuckets?: boolean;
|
|
76
102
|
}): CiSummary;
|
|
103
|
+
/** Summarize the known results together with members the server did not dispatch. */
|
|
104
|
+
export declare function summarizeRunRows(results: CiRunRow[], payload?: {
|
|
105
|
+
conflicts?: unknown;
|
|
106
|
+
skipped?: unknown;
|
|
107
|
+
deferred?: unknown;
|
|
108
|
+
notFound?: unknown;
|
|
109
|
+
}, opts?: {
|
|
110
|
+
notFoundNote?: string;
|
|
111
|
+
foldSkippedBuckets?: boolean;
|
|
112
|
+
}): CiSummary;
|
|
77
113
|
/**
|
|
78
|
-
* Reduce a single `
|
|
114
|
+
* Reduce a single `run <test-id> --wait` result into the same CI summary
|
|
79
115
|
* shape as the batch path, so `--gh-output` / `--summary-file` behave
|
|
80
116
|
* identically for a one-test CI job. Unlike the batch envelope, a single
|
|
81
117
|
* RunResponse carries `error` as a raw string (not `{ message }`) and
|
|
@@ -84,14 +120,32 @@ export declare function summarizeAcceptedPayload(capturedJson: string, opts?: {
|
|
|
84
120
|
export declare function summarizeSingleRun(run: {
|
|
85
121
|
testId?: string;
|
|
86
122
|
testTitle?: string | null;
|
|
123
|
+
resultId?: string;
|
|
87
124
|
runId?: string;
|
|
88
125
|
status?: string;
|
|
89
126
|
dashboardUrl?: string | null;
|
|
90
127
|
executionUrl?: string | null;
|
|
91
128
|
error?: string | null;
|
|
92
129
|
}): CiSummary;
|
|
93
|
-
|
|
130
|
+
export declare function formatFailureCounts(summary: CiSummary): string;
|
|
131
|
+
/**
|
|
132
|
+
* Markdown table for the GitHub job summary: the launch (or launches) the
|
|
133
|
+
* dispatched tests belong to on a line of its own when the backend named one,
|
|
134
|
+
* then one row per test with its result. A test that never dispatched because
|
|
135
|
+
* it was already running names that other run's result, whose launch is not
|
|
136
|
+
* this run and is left off the line.
|
|
137
|
+
*/
|
|
94
138
|
export declare function renderJobSummaryMarkdown(summary: CiSummary): string;
|
|
139
|
+
/**
|
|
140
|
+
* Escape a value destined for the DATA half of a workflow command (the text
|
|
141
|
+
* after `::`). Per GitHub's rules, `%`, CR and LF are percent-encoded so a raw
|
|
142
|
+
* multiline run error can never introduce a newline that starts a second
|
|
143
|
+
* `::command::` line in the Actions output stream (`%` first, so the encodings
|
|
144
|
+
* we add are not themselves re-encoded). The line is printed to a log a
|
|
145
|
+
* terminal or the Actions viewer shows, so the server's text loses its escape
|
|
146
|
+
* sequences and control characters ({@link terminalSafe}) once CR is encoded.
|
|
147
|
+
*/
|
|
148
|
+
export declare function escapeCommandData(value: string): string;
|
|
95
149
|
/**
|
|
96
150
|
* Emit the GitHub-native surfaces. Self-gating on the standard env vars:
|
|
97
151
|
* `$GITHUB_STEP_SUMMARY` (a file path Actions provides) receives the Markdown
|
|
@@ -128,13 +182,13 @@ export declare function emitGithubOutputs(summary: CiSummary, env: NodeJS.Proces
|
|
|
128
182
|
* Emit the CI artifacts for a `--wait` run: the machine summary file (when
|
|
129
183
|
* `--summary-file` is set) and the GitHub-native annotations + job-summary table
|
|
130
184
|
* (when `--gh-output` or `GITHUB_ACTIONS=true`). One shared implementation for
|
|
131
|
-
* every `--wait` command — `
|
|
132
|
-
*
|
|
185
|
+
* every `--wait` command — `run` (single + `--all`) and `run --testlist` —
|
|
186
|
+
* so the copies of this block can no longer drift (a
|
|
133
187
|
* per-copy fix like the `notFound` fold reaching only one of them is what this
|
|
134
188
|
* consolidates away). The caller reduces its own envelope to a `CiSummary` first
|
|
135
189
|
* (`summarizeAcceptedPayload` for a batch, `summarizeSingleRun` for one run);
|
|
136
190
|
* this owns only the two sinks and their best-effort writes. `label` names the
|
|
137
|
-
* command in the failure messages (`[run]` / `[
|
|
191
|
+
* command in the failure messages (`[run]` / `[ci run]` / `[testlist]`).
|
|
138
192
|
* Both writes are best-effort — a sink throwing must never change the exit code.
|
|
139
193
|
*/
|
|
140
194
|
export declare function emitCiArtifacts(summary: CiSummary, opts: {
|
|
@@ -152,6 +206,7 @@ export declare function emitCiArtifacts(summary: CiSummary, opts: {
|
|
|
152
206
|
* Hand the execution report to later steps: its JSON and Markdown are written
|
|
153
207
|
* under `$RUNNER_TEMP` (else the OS temp dir) and their paths appended to
|
|
154
208
|
* `$GITHUB_OUTPUT` as `execution-report-file` / `execution-report-markdown-file`.
|
|
209
|
+
* The JSON names the launch the report describes `runId`, as the summary does.
|
|
155
210
|
* Paths, not bodies — a step output is capped at 1 MiB and multi-line values
|
|
156
211
|
* need heredoc escaping. No-op without `GITHUB_OUTPUT` (nothing can consume
|
|
157
212
|
* them). Best-effort: a write failure is reported and never masks the gate.
|
|
@@ -169,7 +224,7 @@ export declare function emitExecutionReportOutputs(ready: {
|
|
|
169
224
|
/**
|
|
170
225
|
* The job-summary Markdown for a batch that has a server execution report.
|
|
171
226
|
*
|
|
172
|
-
* The exit code comes from the CLI's own
|
|
227
|
+
* The exit code comes from the CLI's own execution waits plus whatever did
|
|
173
228
|
* not dispatch; the report describes only the execution. Usually they agree
|
|
174
229
|
* and the summary is the report, byte for byte the App's comment. When they
|
|
175
230
|
* do not — a run the CLI could not read or that timed out, a test refused
|
|
@@ -182,7 +237,7 @@ export declare function reconcileExecutionReportMarkdown(summary: CiSummary, rea
|
|
|
182
237
|
report: ExecutionReport;
|
|
183
238
|
markdown: string;
|
|
184
239
|
}): string;
|
|
185
|
-
/**
|
|
240
|
+
/** Keep the historical failed step output for existing Actions gates. */
|
|
186
241
|
export declare function emitCiStepOutputs(summary: CiSummary, io: {
|
|
187
242
|
env: NodeJS.ProcessEnv;
|
|
188
243
|
stderr: (line: string) => void;
|