@@ -1086,7 +1086,7 @@ fn strip_component_target_args(
10861086mod tests {
10871087 use super :: * ;
10881088 use clap:: Parser ;
1089- use homeboy:: command_contract:: lab_runner_supports_contract_label;
1089+ use homeboy:: command_contract:: { lab_runner_supports_contract_label, LabCommandPortability } ;
10901090 use std:: fs;
10911091 use std:: path:: Path ;
10921092 use std:: sync:: { Mutex , MutexGuard , OnceLock } ;
@@ -1228,8 +1228,7 @@ mod tests {
12281228 let command = lab_offload_command ( & cli. command ) . unwrap ( ) . unwrap ( ) ;
12291229
12301230 assert_eq ! ( command. hot_label, "review lint" ) ;
1231- assert ! ( command. portable) ;
1232- assert ! ( command. unsupported_reason. is_none( ) ) ;
1231+ assert ! ( command. is_portable( ) ) ;
12331232 }
12341233
12351234 #[ test]
@@ -1278,8 +1277,7 @@ mod tests {
12781277 let command = lab_offload_command ( & cli. command ) . unwrap ( ) . unwrap ( ) ;
12791278
12801279 assert_eq ! ( command. hot_label, "review lint" ) ;
1281- assert ! ( command. portable) ;
1282- assert ! ( command. unsupported_reason. is_none( ) ) ;
1280+ assert ! ( command. is_portable( ) ) ;
12831281 }
12841282
12851283 #[ test]
@@ -1331,8 +1329,7 @@ mod tests {
13311329
13321330 assert_eq ! ( cli. runner. as_deref( ) , Some ( "homeboy-lab" ) ) ;
13331331 assert_eq ! ( command. hot_label, "review test" ) ;
1334- assert ! ( command. portable) ;
1335- assert ! ( command. unsupported_reason. is_none( ) ) ;
1332+ assert ! ( command. is_portable( ) ) ;
13361333 }
13371334
13381335 #[ test]
@@ -1977,7 +1974,7 @@ mod tests {
19771974 let command = lab_offload_command ( & cli. command ) . unwrap ( ) . unwrap ( ) ;
19781975
19791976 assert_eq ! ( command. hot_label, "rig check" ) ;
1980- assert ! ( command. portable ) ;
1977+ assert ! ( command. is_portable ( ) ) ;
19811978 assert ! ( !command. routing_policy. default_lab_offload) ;
19821979 assert ! ( !command. routing_policy. infer_source_path_tools) ;
19831980 assert ! ( cli. command. supports_lab_runner( ) ) ;
@@ -2018,7 +2015,7 @@ mod tests {
20182015 let command = lab_offload_command ( & cli. command ) . unwrap ( ) . unwrap ( ) ;
20192016
20202017 assert_eq ! ( command. hot_label, "rig check" ) ;
2021- assert ! ( command. portable ) ;
2018+ assert ! ( command. is_portable ( ) ) ;
20222019 assert ! ( command. routing_policy. default_lab_offload) ;
20232020 assert ! ( !command. routing_policy. infer_source_path_tools) ;
20242021 }
@@ -2030,8 +2027,7 @@ mod tests {
20302027 let command = lab_offload_command ( & cli. command ) . unwrap ( ) . unwrap ( ) ;
20312028
20322029 assert_eq ! ( command. hot_label, "review lint" ) ;
2033- assert ! ( command. portable) ;
2034- assert ! ( command. unsupported_reason. is_none( ) ) ;
2030+ assert ! ( command. is_portable( ) ) ;
20352031 assert ! ( command. routing_policy. requires_extension_parity) ;
20362032 }
20372033
@@ -2049,9 +2045,8 @@ mod tests {
20492045 let command = lab_offload_command ( & cli. command ) . unwrap ( ) . unwrap ( ) ;
20502046
20512047 assert_eq ! ( command. hot_label, "extension update" ) ;
2052- assert ! ( command. portable ) ;
2048+ assert ! ( command. is_portable ( ) ) ;
20532049 assert ! ( !command. routing_policy. default_lab_offload) ;
2054- assert ! ( command. unsupported_reason. is_none( ) ) ;
20552050 assert ! ( !command. routing_policy. requires_extension_parity) ;
20562051 assert ! ( command. required_extensions. is_empty( ) ) ;
20572052 assert ! ( !command. routing_policy. infer_source_path_tools) ;
@@ -2076,9 +2071,8 @@ mod tests {
20762071 let command = lab_offload_command ( & cli. command ) . unwrap ( ) . unwrap ( ) ;
20772072
20782073 assert_eq ! ( command. hot_label, "extension refresh" ) ;
2079- assert ! ( command. portable ) ;
2074+ assert ! ( command. is_portable ( ) ) ;
20802075 assert ! ( !command. routing_policy. default_lab_offload) ;
2081- assert ! ( command. unsupported_reason. is_none( ) ) ;
20822076 assert ! ( !command. routing_policy. requires_extension_parity) ;
20832077 assert ! ( command. required_extensions. is_empty( ) ) ;
20842078 assert ! ( !command. routing_policy. infer_source_path_tools) ;
@@ -2117,9 +2111,8 @@ mod tests {
21172111 let command = lab_offload_command ( & cli. command ) . unwrap ( ) . unwrap ( ) ;
21182112
21192113 assert_eq ! ( command. hot_label, "extension show" ) ;
2120- assert ! ( command. portable ) ;
2114+ assert ! ( command. is_portable ( ) ) ;
21212115 assert ! ( !command. routing_policy. default_lab_offload) ;
2122- assert ! ( command. unsupported_reason. is_none( ) ) ;
21232116 assert ! ( !command. routing_policy. requires_extension_parity) ;
21242117 assert ! ( command. required_extensions. is_empty( ) ) ;
21252118 assert ! ( !command. routing_policy. infer_source_path_tools) ;
@@ -2150,7 +2143,7 @@ mod tests {
21502143 assert ! ( local_policy. deny_local_execution( ) ) ;
21512144 assert_eq ! ( command. hot_label, "fuzz doctor" ) ;
21522145 assert ! ( lab_runner_supports_contract_label( command. hot_label) ) ;
2153- assert ! ( command. portable ) ;
2146+ assert ! ( command. is_portable ( ) ) ;
21542147 assert ! ( !command. routing_policy. default_lab_offload) ;
21552148 assert ! ( command. routing_policy. requires_extension_parity) ;
21562149 assert ! ( command. routing_policy. read_only_polling) ;
@@ -2372,7 +2365,7 @@ mod tests {
23722365
23732366 assert_eq ! ( cli. runner. as_deref( ) , Some ( "homeboy-lab" ) ) ;
23742367 assert ! ( lab_runner_supports_contract_label( command. hot_label) ) ;
2375- assert ! ( command. portable ) ;
2368+ assert ! ( command. is_portable ( ) ) ;
23762369 assert ! ( command. routing_policy. default_lab_offload) ;
23772370 }
23782371 }
@@ -2391,7 +2384,7 @@ mod tests {
23912384 "cargo test --locked" ,
23922385 ] ) ;
23932386 let automatic_command = lab_offload_command ( & automatic. command ) . unwrap ( ) . unwrap ( ) ;
2394- assert ! ( automatic_command. portable ) ;
2387+ assert ! ( automatic_command. is_portable ( ) ) ;
23952388 assert ! ( automatic_command. routing_policy. default_lab_offload) ;
23962389
23972390 let explicit = Cli :: parse_from ( [
@@ -2409,7 +2402,7 @@ mod tests {
24092402 ] ) ;
24102403 let explicit_command = lab_offload_command ( & explicit. command ) . unwrap ( ) . unwrap ( ) ;
24112404 assert_eq ! ( explicit. runner. as_deref( ) , Some ( "homeboy-lab" ) ) ;
2412- assert ! ( explicit_command. portable ) ;
2405+ assert ! ( explicit_command. is_portable ( ) ) ;
24132406
24142407 let lab_only = Cli :: parse_from ( [
24152408 "homeboy" ,
@@ -2428,12 +2421,10 @@ mod tests {
24282421 lab_only. allow_local_fallback ,
24292422 lab_only. lab_only ,
24302423 ) ;
2431- assert ! (
2432- lab_offload_command( & lab_only. command)
2433- . unwrap( )
2434- . unwrap( )
2435- . portable
2436- ) ;
2424+ assert ! ( lab_offload_command( & lab_only. command)
2425+ . unwrap( )
2426+ . unwrap( )
2427+ . is_portable( ) ) ;
24372428 assert ! ( local_policy. deny_local_execution( ) ) ;
24382429 }
24392430
@@ -2451,7 +2442,7 @@ mod tests {
24512442
24522443 assert_eq ! ( cli. runner. as_deref( ) , Some ( "homeboy-lab" ) ) ;
24532444 assert ! ( lab_runner_supports_contract_label( command. hot_label) ) ;
2454- assert ! ( command. portable ) ;
2445+ assert ! ( command. is_portable ( ) ) ;
24552446 assert ! ( !command. routing_policy. default_lab_offload) ;
24562447 assert ! ( !command. routing_policy. requires_extension_parity) ;
24572448 assert ! ( command. required_extensions. is_empty( ) ) ;
@@ -2486,7 +2477,7 @@ mod tests {
24862477 command. hot_label,
24872478 "agent-task controller from-spec --resume/run-from-spec/materialize"
24882479 ) ;
2489- assert ! ( command. portable ) ;
2480+ assert ! ( command. is_portable ( ) ) ;
24902481 assert ! ( command. routing_policy. default_lab_offload) ;
24912482 assert ! ( !command. routing_policy. requires_extension_parity) ;
24922483 assert_eq ! (
@@ -2536,7 +2527,7 @@ mod tests {
25362527 command. hot_label,
25372528 "agent-task controller from-spec --resume/run-from-spec/materialize"
25382529 ) ;
2539- assert ! ( command. portable ) ;
2530+ assert ! ( command. is_portable ( ) ) ;
25402531 assert ! ( command. routing_policy. default_lab_offload) ;
25412532 assert ! ( command. routing_policy. infer_source_path_tools) ;
25422533 assert ! ( !command. routing_policy. requires_extension_parity) ;
@@ -2604,7 +2595,7 @@ mod tests {
26042595 assert_eq ! ( cli. runner. as_deref( ) , Some ( "homeboy-lab" ) ) ;
26052596 assert ! ( local_policy. deny_local_execution( ) ) ;
26062597 assert_eq ! ( command. hot_label, "agent-task fanout run-plan" ) ;
2607- assert ! ( command. portable ) ;
2598+ assert ! ( command. is_portable ( ) ) ;
26082599 assert ! ( command. routing_policy. default_lab_offload) ;
26092600 assert ! ( command. routing_policy. requires_extension_parity) ;
26102601 }
@@ -2638,7 +2629,7 @@ mod tests {
26382629 assert_eq ! ( cli. runner. as_deref( ) , Some ( "homeboy-lab" ) ) ;
26392630 assert ! ( local_policy. deny_local_execution( ) ) ;
26402631 assert_eq ! ( command. hot_label, "agent-task fanout cook-batch" ) ;
2641- assert ! ( command. portable ) ;
2632+ assert ! ( command. is_portable ( ) ) ;
26422633 assert ! ( command. routing_policy. default_lab_offload) ;
26432634 assert ! ( command. routing_policy. requires_extension_parity) ;
26442635 }
@@ -2671,7 +2662,7 @@ mod tests {
26712662
26722663 assert_eq ! ( cli. runner. as_deref( ) , Some ( "homeboy-lab" ) ) ;
26732664 assert_eq ! ( command. hot_label, "agent-task fanout status/artifacts" ) ;
2674- assert ! ( command. portable ) ;
2665+ assert ! ( command. is_portable ( ) ) ;
26752666 assert ! ( !command. routing_policy. default_lab_offload) ;
26762667 assert_eq ! (
26772668 command. source_path_mode,
@@ -2707,7 +2698,7 @@ mod tests {
27072698
27082699 assert_eq ! ( cli. runner. as_deref( ) , Some ( "homeboy-lab" ) ) ;
27092700 assert_eq ! ( command. hot_label, "tunnel service start" ) ;
2710- assert ! ( command. portable ) ;
2701+ assert ! ( command. is_portable ( ) ) ;
27112702 assert ! ( !command. routing_policy. default_lab_offload) ;
27122703 assert_eq ! (
27132704 command. source_path_mode,
@@ -2740,7 +2731,7 @@ mod tests {
27402731 let command = lab_offload_command ( & cli. command ) . unwrap ( ) . unwrap ( ) ;
27412732
27422733 assert_eq ! ( command. hot_label, "tunnel preview-consumer run" ) ;
2743- assert ! ( command. portable ) ;
2734+ assert ! ( command. is_portable ( ) ) ;
27442735 assert ! ( !command. routing_policy. default_lab_offload) ;
27452736 }
27462737
@@ -2751,8 +2742,7 @@ mod tests {
27512742 let command = lab_offload_command ( & cli. command ) . unwrap ( ) . unwrap ( ) ;
27522743
27532744 assert_eq ! ( command. hot_label, "review audit" ) ;
2754- assert ! ( command. portable) ;
2755- assert_eq ! ( command. unsupported_reason, None ) ;
2745+ assert ! ( command. is_portable( ) ) ;
27562746 assert ! ( command. routing_policy. requires_extension_parity) ;
27572747 }
27582748
@@ -2763,8 +2753,7 @@ mod tests {
27632753 let command = lab_offload_command ( & cli. command ) . unwrap ( ) . unwrap ( ) ;
27642754
27652755 assert_eq ! ( command. hot_label, "review audit" ) ;
2766- assert ! ( command. portable) ;
2767- assert_eq ! ( command. unsupported_reason, None ) ;
2756+ assert ! ( command. is_portable( ) ) ;
27682757 assert ! ( command. routing_policy. requires_extension_parity) ;
27692758 }
27702759
@@ -2775,8 +2764,10 @@ mod tests {
27752764 let command = lab_offload_command ( & cli. command ) . unwrap ( ) . unwrap ( ) ;
27762765
27772766 assert_eq ! ( command. hot_label, "rig up" ) ;
2778- assert ! ( !command. portable) ;
2779- assert ! ( command. unsupported_reason. is_some( ) ) ;
2767+ assert ! ( matches!(
2768+ command. portability,
2769+ LabCommandPortability :: LocalOnly ( _)
2770+ ) ) ;
27802771 assert ! ( !command. routing_policy. requires_extension_parity) ;
27812772 }
27822773
0 commit comments