MCPcopy Create free account
hub / github.com/TestSprite/testsprite-cli / createTestFailureCommand

Function createTestFailureCommand

src/commands/test.ts:8503–8537  ·  view source on GitHub ↗
(deps: TestDeps)

Source from the content-addressed store, hash-verified

8501}
8502
8503function createTestFailureCommand(deps: TestDeps): Command {
8504 const failure = new Command('failure').description('Export the latest-failure agent bundle');
8505 failure
8506 .command('get <test-id>')
8507 .description("Write a self-contained failure-context bundle for a test's latest failing run")
8508 .option(
8509 '--out <dir>',
8510 'Directory to write the §7 disk layout into (default: print wire envelope to stdout)',
8511 )
8512 .option('--failed-only', 'Keep only the failed step plus its immediate neighbors (±1)')
8513 .addHelpText('after', GLOBAL_OPTS_HINT)
8514 .action(
8515 async (testId: string, cmdOpts: { out?: string; failedOnly?: boolean }, command: Command) => {
8516 await runFailureGet(
8517 {
8518 ...resolveCommonOptions(command),
8519 testId,
8520 out: cmdOpts.out,
8521 failedOnly: Boolean(cmdOpts.failedOnly),
8522 },
8523 deps,
8524 );
8525 },
8526 );
8527 failure
8528 .command('summary <test-id>')
8529 .description(
8530 'Print a one-screen summary of the latest failing run (status, failureKind, hypothesis, fix target — M2.1)',
8531 )
8532 .addHelpText('after', GLOBAL_OPTS_HINT)
8533 .action(async (testId: string, _cmdOpts, command: Command) => {
8534 await runFailureSummary({ ...resolveCommonOptions(command), testId }, deps);
8535 });
8536 return failure;
8537}

Callers 1

createTestCommandFunction · 0.85

Calls 3

runFailureGetFunction · 0.85
runFailureSummaryFunction · 0.85
resolveCommonOptionsFunction · 0.70

Tested by

no test coverage detected