Skip to content

Commit 5e848b9

Browse files
authored
DEVPROD-21045: support resmoke "modules" flag (#109)
1 parent 099520c commit 5e848b9

File tree

4 files changed

+22
-16
lines changed

4 files changed

+22
-16
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Changelog
2+
3+
## 3.5.0 - 2025-8-20
4+
* Uses new module logic to determine if tasks are in enterprise mode
5+
26
## 3.4.2 - 2025-07-16
37
* Fixes a bug where Bazel-based multiversion tasks did not generate the correct number of subtasks.
48

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "mongo-task-generator"
33
description = "Dynamically split evergreen tasks into subtasks for testing the 10gen/mongo project."
44
license = "Apache-2.0"
5-
version = "3.4.2"
5+
version = "3.5.0"
66
repository = "https://github.com/mongodb/mongo-task-generator"
77
authors = ["DevProd Correctness Team <[email protected]>"]
88
edition = "2018"

src/evergreen/evg_config_utils.rs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)