Add interactive mode with verbose checking (#23)

* add back interactive mode, todo: print instructions for running w/ command and fix optional error message on command

* add verbose checking
This commit is contained in:
Paul Carleton 2025-11-11 17:49:36 +00:00 • committed by GitHub
commit 73af777bc2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,7 +7,8 @@ import {
printClientResults,
runServerConformanceTest,
printServerResults,
printServerSummary
printServerSummary,
runInteractiveMode
} from './runner';
import { listScenarios, listClientScenarios } from './scenarios';
import { ConformanceCheck } from './types';
@ -24,8 +25,10 @@ program
// Client command - tests a client implementation against scenarios
program
.command('client')
.description('Run conformance tests against a client implementation')
.requiredOption('--command <command>', 'Command to run the client')
.description(
'Run conformance tests against a client implementation or start interactive mode'
)
.option('--command <command>', 'Command to run the client')
.requiredOption('--scenario <scenario>', 'Scenario to test')
.option('--timeout <ms>', 'Timeout in milliseconds', '30000')
.option('--verbose', 'Show verbose output')
@ -34,10 +37,20 @@ program
// Validate options with Zod
const validated = ClientOptionsSchema.parse(options);
// If no command provided, run in interactive mode
if (!validated.command) {
await runInteractiveMode(
validated.scenario,
validated.verbose ?? false
);
process.exit(0);
}
// Otherwise run conformance test
const result = await runConformanceTest(
validated.command,
validated.scenario,
validated.timeout
validated.timeout ?? 30000
);
const { failed } = printClientResults(