@@ -72,6 +72,7 @@ import {
7272 isScenarioRetryAllowed ,
7373} from "../healing/classify.js" ;
7474import { spawnScenarioWorker , cleanupRunDirHeartbeats } from "./subprocess.js" ;
75+ import { ParallelScenarioDisplay } from "./parallel-display.js" ;
7576import {
7677 buildReport ,
7778 createRunId ,
@@ -128,21 +129,27 @@ function logScenarioFailureReason(result: ScenarioResult): void {
128129 }
129130}
130131
131- function logRunSummary ( report : {
132- results : ScenarioResult [ ] ;
133- summary : {
134- total : number ;
135- passed : number ;
136- failed : number ;
137- errors : number ;
138- skipped : number ;
139- } ;
140- } ) : void {
132+ function logRunSummary (
133+ report : {
134+ results : ScenarioResult [ ] ;
135+ summary : {
136+ total : number ;
137+ passed : number ;
138+ failed : number ;
139+ errors : number ;
140+ skipped : number ;
141+ } ;
142+ } ,
143+ options ?: { compact ?: boolean } ,
144+ ) : void {
141145 if ( report . results . length === 0 ) {
142146 return ;
143147 }
144148 console . log ( "\nRun summary:" ) ;
145149 for ( const result of report . results ) {
150+ if ( options ?. compact && result . status === "pass" ) {
151+ continue ;
152+ }
146153 const duration = `${ ( result . durationMs / 1000 ) . toFixed ( 1 ) } s` ;
147154 if ( result . status === "pass" ) {
148155 console . log ( chalk . green ( ` ✓ ${ result . scenario } — pass (${ duration } )` ) ) ;
@@ -679,25 +686,22 @@ export async function executeRun(
679686 workerHeartbeatIntervalMs : config . agent . workerHeartbeatIntervalMs ,
680687 } ;
681688
689+ const display = new ParallelScenarioDisplay ( ) ;
690+
682691 const partial = await mapWithConcurrency (
683692 selectedSummaries ,
684693 parallel ,
685694 async ( summary ) => {
686695 const name = summary . frontmatter . name ;
687- console . log ( `[ ${ name } ] running...` ) ;
688- const result = await spawnScenarioWorker ( {
696+ display . start ( name ) ;
697+ const { result, bufferedLines } = await spawnScenarioWorker ( {
689698 scenarioFilePath : summary . filePath ,
690699 scenarioName : name ,
691700 runDir,
692701 cwd,
693702 options : workerOptions ,
694703 } ) ;
695- if ( result . status === "pass" ) {
696- console . log ( chalk . green ( `[${ name } ] passed` ) ) ;
697- } else {
698- console . log ( chalk . red ( `[${ name } ] ${ result . status } ` ) ) ;
699- logScenarioFailureReason ( result ) ;
700- }
704+ display . finish ( name , result , bufferedLines , logScenarioFailureReason ) ;
701705 return result ;
702706 } ,
703707 {
@@ -789,7 +793,7 @@ export async function executeRun(
789793 const report = buildReport ( runId , startedAt , results ) ;
790794 writeReport ( runDir , report , redactor ) ;
791795
792- logRunSummary ( report ) ;
796+ logRunSummary ( report , { compact : parallel !== undefined } ) ;
793797
794798 const reportPath = finalizeRunReport ( runDir , zipDestination ) ;
795799 console . log ( `\nReport: ${ reportPath } ` ) ;
0 commit comments