@@ -32,6 +32,7 @@ if (argv.includes("--help") || argv.includes("-h")) {
3232 " --retries <N> Extra attempts for failing files (default: 1)" ,
3333 " --profile <name> Run a curated test profile (env: KILO_TEST_PROFILE)" ,
3434 " --bail Stop on first failure" ,
35+ " --dots Show compact dot progress" ,
3536 " --verbose Show full output for every file" ,
3637 " -h, --help Show this help" ,
3738 "" ,
@@ -64,6 +65,7 @@ function text(name: string) {
6465const ci = argv . includes ( "--ci" )
6566const bail = argv . includes ( "--bail" )
6667const verbose = argv . includes ( "--verbose" )
68+ const dots = ! verbose && ( ci || argv . includes ( "--dots" ) )
6769// Cap concurrency at 4 even on bigger runners: the bottleneck is shared
6870// resources (ports, global filesystem like ~/.local/share/kilo), not CPU.
6971// Eight parallel processes was triggering port/FS races, not going faster.
@@ -164,6 +166,14 @@ if (ci) await fs.mkdir(xmldir, { recursive: true })
164166
165167const counter = { done : 0 }
166168const pad = String ( files . length ) . length
169+ const progress = { width : 80 }
170+ const marks = {
171+ pass : "." ,
172+ retry : "R" ,
173+ fail : "F" ,
174+ timeout : "T" ,
175+ } as const
176+ const legend = `Legend: ${ marks . pass } =pass ${ marks . retry } =pass-after-retry ${ marks . fail } =fail ${ marks . timeout } =timeout`
167177
168178// ---------------------------------------------------------------------------
169179// Run a single test file
@@ -216,8 +226,21 @@ async function run(file: string): Promise<Result> {
216226// Report a single result
217227// ---------------------------------------------------------------------------
218228
229+ function mark ( result : Result ) {
230+ if ( result . timedout ) return marks . timeout
231+ if ( ! result . passed ) return marks . fail
232+ if ( result . attempts > 1 ) return marks . retry
233+ return marks . pass
234+ }
235+
219236function report ( result : Result ) {
220237 counter . done ++
238+ if ( dots ) {
239+ process . stdout . write ( mark ( result ) )
240+ if ( counter . done % progress . width === 0 ) process . stdout . write ( "\n" )
241+ return
242+ }
243+
221244 const idx = String ( counter . done ) . padStart ( pad )
222245 const secs = ( result . duration / 1000 ) . toFixed ( 1 )
223246 const tries = result . attempts > 1 ? dim ( ` [attempt ${ result . attempts } /${ retries + 1 } ]` ) : ""
@@ -250,7 +273,9 @@ function report(result: Result) {
250273// Parallel execution
251274// ---------------------------------------------------------------------------
252275
253- console . log ( `\nRunning ${ bold ( String ( files . length ) ) } test files with concurrency ${ bold ( String ( concurrency ) ) } \n` )
276+ console . log ( `\nRunning ${ bold ( String ( files . length ) ) } test files with concurrency ${ bold ( String ( concurrency ) ) } ` )
277+ if ( dots ) console . log ( dim ( legend ) )
278+ console . log ( )
254279
255280const start = performance . now ( )
256281const results : Result [ ] = [ ]
@@ -278,6 +303,8 @@ const workers = Array.from({ length: Math.min(concurrency, files.length) }, asyn
278303
279304await Promise . all ( workers )
280305
306+ if ( dots && counter . done % progress . width !== 0 ) console . log ( )
307+
281308const elapsed = ( performance . now ( ) - start ) / 1000
282309
283310// ---------------------------------------------------------------------------
0 commit comments