Skip to content

Commit 0d56c1d

Browse files
authored
DEVPROD-18487 Respect use_large_distro and use_xlarge_distro when generating jstestfuzz tasks (#106)
1 parent c76b54f commit 0d56c1d

File tree

6 files changed

+45
-5
lines changed

6 files changed

+45
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Changelog
2+
## 3.4.1 - 2025-06-23
3+
* Respect `use_large_distro` and `use_xlarge_distro` when generating jstestfuzz tasks
4+
25
## 3.4.0 - 2025-06-12
36
* Allow fuzzer tasks to use the `no_multiversion_generate_tasks` tag
47

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.0"
5+
version = "3.4.1"
66
repository = "https://github.com/mongodb/mongo-task-generator"
77
authors = ["DevProd Correctness Team <[email protected]>"]
88
edition = "2018"

src/services/config_extraction.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,16 @@ impl ConfigExtractionService for ConfigExtractionServiceImpl {
198198
task_name,
199199
variant: build_variant.name.to_string(),
200200
suite,
201+
use_large_distro: self.evg_config_utils.lookup_default_param_bool(
202+
task_def,
203+
USE_LARGE_DISTRO,
204+
false,
205+
)?,
206+
use_xlarge_distro: self.evg_config_utils.lookup_default_param_bool(
207+
task_def,
208+
USE_XLARGE_DISTRO,
209+
false,
210+
)?,
201211
num_files,
202212
num_tasks: evg_config_utils.lookup_required_param_u64(task_def, NUM_FUZZER_TASKS)?,
203213
resmoke_args: evg_config_utils.lookup_required_param_str(task_def, RESMOKE_ARGS)?,

src/task_types/fuzzer_tasks.rs

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ pub struct FuzzerGenTaskParams {
3838
pub suite: String,
3939
/// The bazel test target, if it is a bazel-based resmoke task.
4040
pub bazel_target: Option<String>,
41+
/// Should the generated tasks run on a 'large' distro.
42+
pub use_large_distro: bool,
43+
/// Should the generated tasks run on a 'xlarge' distro.
44+
pub use_xlarge_distro: bool,
4145
/// Number of javascript files fuzzer should generate.
4246
pub num_files: String,
4347
/// Number of sub-tasks fuzzer should generate.
@@ -165,12 +169,16 @@ impl FuzzerGenTaskParams {
165169
}
166170

167171
/// A Generated Fuzzer task.
168-
#[derive(Debug)]
172+
#[derive(Debug, Default)]
169173
pub struct FuzzerTask {
170174
/// Name for generated task.
171175
pub task_name: String,
172176
/// Sub-tasks comprising generated task.
173177
pub sub_tasks: Vec<EvgTask>,
178+
/// Should the generated tasks run on a 'large' distro.
179+
pub use_large_distro: bool,
180+
/// Should the generated tasks run on a 'xlarge' distro.
181+
pub use_xlarge_distro: bool,
174182
}
175183

176184
impl GeneratedSuite for FuzzerTask {
@@ -186,8 +194,8 @@ impl GeneratedSuite for FuzzerTask {
186194
.into_iter()
187195
.map(|sub_task| GeneratedSubTask {
188196
evg_task: sub_task,
189-
use_large_distro: false,
190-
use_xlarge_distro: false,
197+
use_large_distro: self.use_large_distro,
198+
use_xlarge_distro: self.use_xlarge_distro,
191199
})
192200
.collect()
193201
}
@@ -256,6 +264,8 @@ impl GenFuzzerService for GenFuzzerServiceImpl {
256264
Ok(Box::new(FuzzerTask {
257265
task_name: params.task_name.to_string(),
258266
sub_tasks,
267+
use_large_distro: params.use_large_distro,
268+
use_xlarge_distro: params.use_xlarge_distro,
259269
}))
260270
}
261271
}
@@ -443,11 +453,24 @@ mod tests {
443453
let fuzzer_task = FuzzerTask {
444454
task_name: "my fuzzer".to_string(),
445455
sub_tasks: vec![],
456+
..Default::default()
446457
};
447458

448459
assert_eq!(fuzzer_task.display_name(), "my fuzzer".to_string());
449460
}
450461

462+
#[test]
463+
fn test_large_distro() {
464+
let fuzzer_task = FuzzerTask {
465+
task_name: "my fuzzer".to_string(),
466+
sub_tasks: vec![],
467+
use_large_distro: true,
468+
..Default::default()
469+
};
470+
471+
assert!(fuzzer_task.use_large_distro);
472+
}
473+
451474
#[test]
452475
fn test_sub_tasks() {
453476
let fuzzer_task = FuzzerTask {
@@ -460,6 +483,7 @@ mod tests {
460483
..Default::default()
461484
},
462485
],
486+
..Default::default()
463487
};
464488

465489
assert_eq!(fuzzer_task.sub_tasks().len(), 2);
@@ -477,6 +501,7 @@ mod tests {
477501
..Default::default()
478502
},
479503
],
504+
..Default::default()
480505
};
481506

482507
let task_refs = fuzzer_task.build_task_ref(Some("distro".to_string()), None);

tests/data/evergreen.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3303,6 +3303,7 @@ tasks:
33033303
npm_command: initsync-fuzzer
33043304
suite: initial_sync_fuzzer
33053305
resmoke_args: "--mongodSetParameters='{logComponentVerbosity: {command: 2}}'"
3306+
use_large_distro: "true"
33063307

33073308
## initial sync generational fuzzer ##
33083309
- <<: *jstestfuzz_template
@@ -3317,6 +3318,7 @@ tasks:
33173318
npm_command: initsync-fuzzer
33183319
suite: initial_sync_fuzzer
33193320
resmoke_args: "--mongodSetParameters='{logComponentVerbosity: {command: 2}}'"
3321+
use_xlarge_distro: "true"
33203322

33213323
## Standalone generational fuzzer for multiversion aggregation pipelines ##
33223324
- <<: *jstestfuzz_template

0 commit comments

Comments
 (0)