@@ -751,7 +751,8 @@ impl EvgConfigUtils for EvgConfigUtilsImpl {
751751 ///
752752 /// true if given build variant includes the enterprise module.
753753 fn is_enterprise_build_variant ( & self , build_variant : & BuildVariant ) -> bool {
754- let pattern = Regex :: new ( r"--enableEnterpriseTests\s*=?\s*off" ) . unwrap ( ) ;
754+ // assumed to be true, unless explicitly disabled
755+ let pattern = Regex :: new ( r"--modules\s*=?\s*none" ) . unwrap ( ) ;
755756 if let Some ( expansions_map) = & build_variant. expansions {
756757 for ( _key, value) in expansions_map. iter ( ) {
757758 if pattern. is_match ( value) {
@@ -1783,28 +1784,29 @@ mod tests {
17831784 }
17841785
17851786 // tests for is_enterprise_build_variant.
1786- #[ test]
1787- fn test_build_variant_with_enterprise_module_should_return_true ( ) {
1787+ #[ rstest]
1788+ #[ case( None ) ]
1789+ // this flag is no longer supported: it should return true in either case
1790+ #[ case( Some ( vec![ "--enableEnterpriseTests=on" . to_string( ) ] ) ) ]
1791+ #[ case( Some ( vec![ "--enableEnterpriseTests=off" . to_string( ) ] ) ) ]
1792+ fn test_build_variant_with_enterprise_module_should_return_true (
1793+ #[ case] modules : Option < Vec < String > > ,
1794+ ) {
17881795 let build_variant = BuildVariant {
1796+ modules,
17891797 ..Default :: default ( )
17901798 } ;
17911799 let evg_config_utils = EvgConfigUtilsImpl :: new ( ) ;
17921800
17931801 assert ! ( evg_config_utils. is_enterprise_build_variant( & build_variant) ) ;
17941802 }
17951803
1796- #[ rstest]
1797- #[ case( Some ( vec![ ] ) ) ]
1798- #[ case( Some ( vec![ "Another Module" . to_string( ) , "Not Enterprise" . to_string( ) ] ) ) ]
1799- #[ case( None ) ]
1800- fn test_build_variant_with_out_enterprise_module_should_return_false (
1801- #[ case] _modules : Option < Vec < String > > ,
1802- ) {
1804+ #[ test]
1805+ fn test_build_variant_with_out_enterprise_module_should_return_false ( ) {
18031806 let build_variant = BuildVariant {
1804- expansions : Some ( BTreeMap :: from ( [ (
1805- "enterprise_test_flag" . to_string ( ) ,
1806- "--enableEnterpriseTests=off" . to_string ( ) ,
1807- ) ] ) ) ,
1807+ expansions : Some ( btreemap ! {
1808+ "expansion" . to_string( ) => "--modules=none" . to_string( ) ,
1809+ } ) ,
18081810 ..Default :: default ( )
18091811 } ;
18101812 let evg_config_utils = EvgConfigUtilsImpl :: new ( ) ;
0 commit comments