@@ -15,7 +15,7 @@ use super::HandleSignalResult;
15
15
use crate :: {
16
16
config:: {
17
17
EvaluatableProfile , RetryPolicy , ScriptConfig , ScriptId , SetupScriptCommand ,
18
- SetupScriptExecuteData , SlowTimeout , TestSettings ,
18
+ SetupScriptExecuteData , SlowTimeout , TestGroup , TestSettings ,
19
19
} ,
20
20
double_spawn:: DoubleSpawnInfo ,
21
21
errors:: { ChildError , ChildFdError , ChildStartError , ErrorList } ,
@@ -628,15 +628,34 @@ impl<'a> ExecutorContext<'a> {
628
628
command_mut. env ( "__NEXTEST_ATTEMPT" , format ! ( "{}" , test. retry_data. attempt) ) ;
629
629
630
630
command_mut. env ( "NEXTEST_RUN_ID" , format ! ( "{}" , self . run_id) ) ;
631
+
632
+ // Set group and slot environment variables.
631
633
command_mut. env (
632
634
"NEXTEST_TEST_GLOBAL_SLOT" ,
633
635
test. cx . global_slot ( ) . to_string ( ) ,
634
636
) ;
637
+ match test. settings . test_group ( ) {
638
+ TestGroup :: Custom ( name) => {
639
+ debug_assert ! (
640
+ test. cx. group_slot( ) . is_some( ) ,
641
+ "test_group being set implies group_slot is set"
642
+ ) ;
643
+ command_mut. env ( "NEXTEST_TEST_GROUP" , name. as_str ( ) ) ;
644
+ }
645
+ TestGroup :: Global => {
646
+ debug_assert ! (
647
+ test. cx. group_slot( ) . is_none( ) ,
648
+ "test_group being unset implies group_slot is unset"
649
+ ) ;
650
+ command_mut. env ( "NEXTEST_TEST_GROUP" , TestGroup :: GLOBAL_STR ) ;
651
+ }
652
+ }
635
653
if let Some ( group_slot) = test. cx . group_slot ( ) {
636
654
command_mut. env ( "NEXTEST_TEST_GROUP_SLOT" , group_slot. to_string ( ) ) ;
637
655
} else {
638
656
command_mut. env ( "NEXTEST_TEST_GROUP_SLOT" , "none" ) ;
639
657
}
658
+
640
659
command_mut. stdin ( Stdio :: null ( ) ) ;
641
660
test. setup_script_data . apply (
642
661
& test. test_instance . to_test_query ( ) ,
0 commit comments