@@ -11,8 +11,11 @@ use owo_colors::{Style, Styled};
1111use vite_path:: AbsolutePath ;
1212
1313use super :: {
14- cache:: { format_cache_status_inline, format_cache_status_summary} ,
15- event:: { CacheStatus , ExecutionEvent , ExecutionEventKind , ExecutionId , ExecutionItemDisplay } ,
14+ cache:: { format_cache_status_inline, format_cache_status_summary, format_cache_update_status} ,
15+ event:: {
16+ CacheStatus , CacheUpdateStatus , ExecutionEvent , ExecutionEventKind , ExecutionId ,
17+ ExecutionItemDisplay ,
18+ } ,
1619} ;
1720
1821/// Wrap of `OwoColorize` that ignores style if `NO_COLOR` is set.
@@ -55,6 +58,7 @@ const CACHE_MISS_STYLE: Style = Style::new().purple();
5558struct ExecutionInfo {
5659 display : Option < ExecutionItemDisplay > ,
5760 cache_status : CacheStatus , // Non-optional, determined at Start
61+ cache_update_status : Option < CacheUpdateStatus > , // Set at Finish
5862 exit_status : Option < i32 > ,
5963 error_message : Option < String > ,
6064}
@@ -157,6 +161,7 @@ impl<W: Write> LabeledReporter<W> {
157161 self . executions . push ( ExecutionInfo {
158162 display : None ,
159163 cache_status,
164+ cache_update_status : None ,
160165 exit_status : None ,
161166 error_message : None ,
162167 } ) ;
@@ -199,6 +204,7 @@ impl<W: Write> LabeledReporter<W> {
199204 self . executions . push ( ExecutionInfo {
200205 display : Some ( display) ,
201206 cache_status,
207+ cache_update_status : None ,
202208 exit_status : None ,
203209 error_message : None ,
204210 } ) ;
@@ -226,17 +232,23 @@ impl<W: Write> LabeledReporter<W> {
226232 self . stats . failed += 1 ;
227233 }
228234
229- fn handle_finish ( & mut self , execution_id : ExecutionId , status : Option < i32 > ) {
235+ fn handle_finish (
236+ & mut self ,
237+ execution_id : ExecutionId ,
238+ status : Option < i32 > ,
239+ cache_update_status : CacheUpdateStatus ,
240+ ) {
230241 // Update failure statistics
231242 if let Some ( s) = status {
232243 if s != 0 {
233244 self . stats . failed += 1 ;
234245 }
235246 }
236247
237- // Update execution info exit status
248+ // Update execution info
238249 if let Some ( exec) = self . executions . last_mut ( ) {
239250 exec. exit_status = status;
251+ exec. cache_update_status = Some ( cache_update_status) ;
240252 }
241253
242254 // For direct synthetic execution with cache hit, print message at the bottom
@@ -430,6 +442,14 @@ impl<W: Write> LabeledReporter<W> {
430442 } ;
431443 let _ = writeln ! ( self . writer, " {}" , styled_summary) ;
432444
445+ // Cache update status (only shown for NonZeroExitStatus)
446+ if let Some ( ref cache_update_status) = exec. cache_update_status {
447+ if let Some ( update_msg) = format_cache_update_status ( cache_update_status) {
448+ let _ =
449+ writeln ! ( self . writer, " {}" , update_msg. style( Style :: new( ) . yellow( ) ) ) ;
450+ }
451+ }
452+
433453 // Error message if present
434454 if let Some ( ref error_msg) = exec. error_message {
435455 let _ = writeln ! (
@@ -486,8 +506,8 @@ impl<W: Write> Reporter for LabeledReporter<W> {
486506 ExecutionEventKind :: Error { message } => {
487507 self . handle_error ( event. execution_id , message) ;
488508 }
489- ExecutionEventKind :: Finish { status, cache_update_status : _ } => {
490- self . handle_finish ( event. execution_id , status) ;
509+ ExecutionEventKind :: Finish { status, cache_update_status } => {
510+ self . handle_finish ( event. execution_id , status, cache_update_status ) ;
491511 }
492512 }
493513 }
0 commit comments