@@ -569,6 +569,61 @@ fn test_logs_list_sort_accepts_hyphen_timestamp() {
569569 }
570570}
571571
572+ #[ test]
573+ fn test_logs_search_and_aggregate_default_to_flex_storage ( ) {
574+ use clap:: Parser ;
575+
576+ let search = crate :: Cli :: try_parse_from ( [ "pup" , "logs" , "search" , "--query" , "*" ] )
577+ . expect ( "logs search should parse" ) ;
578+ let aggregate = crate :: Cli :: try_parse_from ( [ "pup" , "logs" , "aggregate" ] )
579+ . expect ( "logs aggregate should parse" ) ;
580+
581+ match search. command {
582+ crate :: Commands :: Logs {
583+ action : crate :: LogActions :: Search { storage, .. } ,
584+ } => assert_eq ! ( storage. as_deref( ) , Some ( "flex" ) ) ,
585+ _ => panic ! ( "expected LogActions::Search" ) ,
586+ }
587+ match aggregate. command {
588+ crate :: Commands :: Logs {
589+ action : crate :: LogActions :: Aggregate { storage, .. } ,
590+ } => assert_eq ! ( storage. as_deref( ) , Some ( "flex" ) ) ,
591+ _ => panic ! ( "expected LogActions::Aggregate" ) ,
592+ }
593+ }
594+
595+ #[ test]
596+ fn test_logs_search_and_aggregate_storage_overrides_are_preserved ( ) {
597+ use clap:: Parser ;
598+
599+ let search = crate :: Cli :: try_parse_from ( [
600+ "pup" ,
601+ "logs" ,
602+ "search" ,
603+ "--query" ,
604+ "*" ,
605+ "--storage" ,
606+ "indexes" ,
607+ ] )
608+ . expect ( "logs search --storage indexes should parse" ) ;
609+ let aggregate =
610+ crate :: Cli :: try_parse_from ( [ "pup" , "logs" , "aggregate" , "--storage" , "online-archives" ] )
611+ . expect ( "logs aggregate --storage online-archives should parse" ) ;
612+
613+ match search. command {
614+ crate :: Commands :: Logs {
615+ action : crate :: LogActions :: Search { storage, .. } ,
616+ } => assert_eq ! ( storage. as_deref( ) , Some ( "indexes" ) ) ,
617+ _ => panic ! ( "expected LogActions::Search" ) ,
618+ }
619+ match aggregate. command {
620+ crate :: Commands :: Logs {
621+ action : crate :: LogActions :: Aggregate { storage, .. } ,
622+ } => assert_eq ! ( storage. as_deref( ) , Some ( "online-archives" ) ) ,
623+ _ => panic ! ( "expected LogActions::Aggregate" ) ,
624+ }
625+ }
626+
572627#[ test]
573628fn test_logs_saved_views_create_parses ( ) {
574629 use clap:: Parser ;
0 commit comments