Skip to content

Commit f872470

Browse files
fix(ci): prettier formatting and help snapshot alignment for report flags
1 parent 65f21ad commit f872470

5 files changed

Lines changed: 71 additions & 64 deletions

File tree

src/commands/test.run.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3655,7 +3655,12 @@ describe('runTestRunAll — JUnit report export', () => {
36553655
failureKind: null,
36563656
error: null,
36573657
videoUrl: null,
3658-
stepSummary: { total: 3, completed: 3, passedCount: status === 'passed' ? 3 : 0, failedCount: 0 },
3658+
stepSummary: {
3659+
total: 3,
3660+
completed: 3,
3661+
passedCount: status === 'passed' ? 3 : 0,
3662+
failedCount: 0,
3663+
},
36593664
};
36603665
}
36613666

src/commands/test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6767,10 +6767,7 @@ export async function runTestRerun(
67676767
};
67686768
out.print(jsonPayload);
67696769
const reportProjectId = opts.projectId ?? 'batch';
6770-
await writeBatchJUnitReportIfRequested(
6771-
{ ...opts, projectId: reportProjectId },
6772-
rerunResults,
6773-
);
6770+
await writeBatchJUnitReportIfRequested({ ...opts, projectId: reportProjectId }, rerunResults);
67746771

67756772
// Determine exit code: timeout (deferred or any timeout) → 7; any fail → 1; all pass → 0
67766773
if (deferred.length > 0 || timedOut > 0) {

src/lib/junit-report.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ describe('parseJUnitReportFormat', () => {
5252

5353
describe('assertJUnitReportOptions', () => {
5454
it('allows absent report flags', () => {
55-
expect(() =>
56-
assertJUnitReportOptions({ wait: false, batchPath: true }),
57-
).not.toThrow();
55+
expect(() => assertJUnitReportOptions({ wait: false, batchPath: true })).not.toThrow();
5856
});
5957

6058
it('rejects report-file without report', () => {
@@ -99,7 +97,9 @@ describe('buildJUnitReport', () => {
9997
classname: 'proj_empty',
10098
results: [],
10199
});
102-
expect(xml).toContain('<testsuite name="Dry suite" tests="0" failures="0" errors="0" skipped="0"');
100+
expect(xml).toContain(
101+
'<testsuite name="Dry suite" tests="0" failures="0" errors="0" skipped="0"',
102+
);
103103
expect(xml).toContain('</testsuites>');
104104
});
105105

@@ -296,4 +296,4 @@ describe('writeJUnitReportFile', () => {
296296
});
297297
rmSync(dir, { recursive: true, force: true });
298298
});
299-
});
299+
});

src/lib/junit-report.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@ export async function writeJUnitReportFile(rawPath: string, xml: string): Promis
221221
stream.end(() => {
222222
if (streamError) {
223223
unlink(tmpPath).catch(() => undefined);
224-
reject(new TransportError(`Failed to write --report-file ${resolved}: ${streamError.message}`));
224+
reject(
225+
new TransportError(`Failed to write --report-file ${resolved}: ${streamError.message}`),
226+
);
225227
return;
226228
}
227229
rename(tmpPath, resolved)
@@ -237,4 +239,4 @@ export async function writeJUnitReportFile(rawPath: string, xml: string): Promis
237239
});
238240
});
239241
});
240-
}
242+
}

test/__snapshots__/help.snapshot.test.ts.snap

Lines changed: 55 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -392,37 +392,40 @@ Exit codes:
392392
On failure/blocked/cancelled, run: testsprite test artifact get <run-id>
393393
394394
Options:
395-
--all rerun all tests in the resolved project (requires
396-
--project) (default: false)
397-
--project <id> project id (required with --all; returned by
398-
\`testsprite project list\`)
399-
--skip-terminal with --all: skip tests already in a terminal status
400-
(passed|failed|blocked|cancelled) (default: false)
401-
--status <list> with --all: only dispatch tests whose status matches
402-
one of these values (comma-separated; accepted:
403-
draft|ready|queued|running|passed|failed|blocked|cancelled|unknown)
404-
--filter <substr> with --all: only rerun tests whose name contains
405-
this substring (case-insensitive)
406-
--wait block until terminal status or --timeout elapses
407-
(default: false)
408-
--timeout <s> with --wait, max seconds to wait (1–3600, default
409-
600)
410-
--no-auto-heal opt out of AI heal-on-drift for this FE rerun
411-
(default: auto-heal is ON). Costs 0.2 credits per
412-
engage when a step has drifted. Ignored for backend
413-
tests.
414-
--skip-dependencies BE only: rerun only the named test without expanding
415-
the producer/teardown closure (default: false)
416-
--max-concurrency <n> with --wait, max in-flight polls at once (1-100,
417-
default: 50)
418-
--idempotency-key <key> opaque key for safe retries (1–256 chars). Printed
419-
to stderr at --verbose if auto-generated.
420-
--report <format> with batch --wait: write a JUnit XML sidecar
421-
report after polling (accepted: junit)
422-
--report-file <path> output path for --report (atomic write)
395+
--all rerun all tests in the resolved project (requires
396+
--project) (default: false)
397+
--project <id> project id (required with --all; returned by
398+
\`testsprite project list\`)
399+
--skip-terminal with --all: skip tests already in a terminal
400+
status (passed|failed|blocked|cancelled)
401+
(default: false)
402+
--status <list> with --all: only dispatch tests whose status
403+
matches one of these values (comma-separated;
404+
accepted:
405+
draft|ready|queued|running|passed|failed|blocked|cancelled|unknown)
406+
--filter <substr> with --all: only rerun tests whose name contains
407+
this substring (case-insensitive)
408+
--wait block until terminal status or --timeout elapses
409+
(default: false)
410+
--timeout <s> with --wait, max seconds to wait (1–3600, default
411+
600)
412+
--no-auto-heal opt out of AI heal-on-drift for this FE rerun
413+
(default: auto-heal is ON). Costs 0.2 credits per
414+
engage when a step has drifted. Ignored for
415+
backend tests.
416+
--skip-dependencies BE only: rerun only the named test without
417+
expanding the producer/teardown closure (default:
418+
false)
419+
--max-concurrency <n> with --wait, max in-flight polls at once (1-100,
420+
default: 50)
421+
--idempotency-key <key> opaque key for safe retries (1–256 chars).
422+
Printed to stderr at --verbose if auto-generated.
423+
--report <format> with batch --wait: write a JUnit XML sidecar
424+
report after polling (accepted: junit)
425+
--report-file <path> output path for --report (atomic write)
423426
--report-suite-name <name> optional JUnit <testsuite name=...> override
424-
(default: testsprite:<projectId>)
425-
-h, --help display help for command
427+
(default: testsprite:<projectId>)
428+
-h, --help display help for command
426429
427430
Notes:
428431
rerun replays a saved run/script and is MORE LENIENT than a fresh \`test run\`
@@ -495,29 +498,29 @@ Exit codes:
495498
On failure/blocked/cancelled, run: testsprite test artifact get <run-id>
496499
497500
Options:
498-
--target-url <url> override the project default env URL for this run
499-
(http/https only, no localhost/private IPs)
500-
--wait poll until terminal status or --timeout elapses
501-
(default: false)
502-
--timeout <s> with --wait, max seconds to wait (1–3600, default
503-
600)
504-
--idempotency-key <key> opaque key for safe retries (1–256 chars). Printed
505-
to stderr at --debug if auto-generated.
506-
--all run all BE tests in the project (wave-ordered fresh
507-
run; requires --project). Mutually exclusive with
508-
<test-id>. (default: false)
509-
--project <id> project id (required with --all; returned by
510-
\`testsprite project list\`)
511-
--filter <substr> with --all: only run tests whose name contains this
512-
substring (case-insensitive)
513-
--max-concurrency <n> with --all --wait, max in-flight polls at once
514-
(1-100, default: 50)
515-
--report <format> with --all --wait: write a JUnit XML sidecar
516-
report after polling (accepted: junit)
517-
--report-file <path> output path for --report (atomic write)
501+
--target-url <url> override the project default env URL for this run
502+
(http/https only, no localhost/private IPs)
503+
--wait poll until terminal status or --timeout elapses
504+
(default: false)
505+
--timeout <s> with --wait, max seconds to wait (1–3600, default
506+
600)
507+
--idempotency-key <key> opaque key for safe retries (1–256 chars).
508+
Printed to stderr at --debug if auto-generated.
509+
--all run all BE tests in the project (wave-ordered
510+
fresh run; requires --project). Mutually
511+
exclusive with <test-id>. (default: false)
512+
--project <id> project id (required with --all; returned by
513+
\`testsprite project list\`)
514+
--filter <substr> with --all: only run tests whose name contains
515+
this substring (case-insensitive)
516+
--max-concurrency <n> with --all --wait, max in-flight polls at once
517+
(1-100, default: 50)
518+
--report <format> with --all --wait: write a JUnit XML sidecar
519+
report after polling (accepted: junit)
520+
--report-file <path> output path for --report (atomic write)
518521
--report-suite-name <name> optional JUnit <testsuite name=...> override
519-
(default: testsprite:<projectId>)
520-
-h, --help display help for command
522+
(default: testsprite:<projectId>)
523+
-h, --help display help for command
521524
522525
Dependency-aware fresh run (M4):
523526
testsprite test run --all --project <id> run all BE tests in wave order

0 commit comments

Comments
 (0)