Skip to content

Commit 35bcead

Browse files
authored
DAG-2546 Improve UX of generated multiversion tasks (#59)
* Working task generation * Removed dead code and fixed up burn_in_tests.rs * Fixed/added tests * update changelog and version * Updated doc strings * Docs * Only generate tasks taht match the old version from the multiversion-config * version bump
1 parent 3a1f265 commit 35bcead

17 files changed

+726
-873
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## 0.7.7 - 2022-05-08
4+
* Make generated multiversion tasks explicit.
5+
36
## 0.7.6 - 2022-05-02
47
* Pass suite description and matrix_suite to subsuites
58

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 mongodb/mongo project."
44
license = "Apache-2.0"
5-
version = "0.7.6"
5+
version = "0.7.7"
66
repository = "https://github.com/mongodb/mongo-task-generator"
77
authors = ["Decision Automation Group <[email protected]>"]
88
edition = "2018"

docs/generating_tasks.md

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,26 @@ we can see how this is controlled:
3636
...
3737

3838
- <<: *jstestfuzz_template
39-
name: aggregation_expression_multiversion_fuzzer_gen
40-
tags: ["aggfuzzer", "multiversion", "require_npm", "random_name"]
39+
name: initial_sync_fuzzer_gen
40+
tags: ["require_npm", "random_name"]
4141
commands:
4242
- func: "generate resmoke tasks"
4343
vars:
4444
<<: *jstestfuzz_config_vars
45-
num_files: 5
45+
num_files: 10
4646
num_tasks: 5
47-
suite: generational_fuzzer
47+
npm_command: initsync-fuzzer
48+
suite: initial_sync_fuzzer
4849
resmoke_args: "--mongodSetParameters='{logComponentVerbosity: {command: 2}}'"
49-
npm_command: agg-expr-fuzzer
5050
```
5151
5252
When generating a fuzzer most of the variables under the `"generate resmoke tasks"` function will
5353
be passed along to the generated tasks. The one exception is the `num_tasks` variable. This
5454
variable controls how many instances of this task will be created and executed. Since these
5555
generated tasks can be executed independently, they can be executed on multiple hosts in parallel.
5656

57-
In this sample, we would generated 5 tasks of this fuzzer and each of them would create and run 5
58-
fuzzer test files, executing a total of 25 fuzzer tests.
57+
In this sample, we would generated 5 tasks of this fuzzer and each of them would create and run 10
58+
fuzzer test files, executing a total of 50 fuzzer tests.
5959

6060
It is important to note that the `mongo-task-generator` can tell this is a task it should generate
6161
configuration for because it runs the `"generate resmoke tasks"` function. Additionally, it is able
@@ -145,7 +145,7 @@ tasks configuration:
145145
```yaml
146146
- <<: *gen_task_template
147147
name: multiversion_auth_future_git_tag_gen
148-
tags: ["auth", "multiversion", "no_version_combination", "multiversion_future_git_tag"]
148+
tags: ["auth", "multiversion", "no_multiversion_generate_tasks", "multiversion_future_git_tag"]
149149
commands:
150150
- func: "generate resmoke tasks"
151151
vars:
@@ -154,9 +154,28 @@ tasks configuration:
154154

155155
A task is marked as a multiversion version task by including `"multiversion"` in the `tags` section
156156
of the task definition. When this tag is present, both the extra setup steps and the generation
157-
of multiversion sub-tasks will be preformed. In order to only perform the extra setup steps
158-
the `"no_version_combinations"` tag should also be included.
157+
of multiversion sub-tasks will be performed. In order to only perform the extra setup steps
158+
the `"no_multiversion_generate_tasks"` tag should also be included. This is typically used for [explicit multiversion](https://github.com/10gen/mongo/blob/99f7a334eee4b724a231c0db75052eb8199ad8e1/docs/evergreen-testing/multiversion.md#explicit-and-implicit-multiversion-suites) tasks since those suites explicitly test against various mongodb topologies/versions and do not require running additional suites/tasks to ensure multiversion suite converage.
159159

160+
[Implicit multiversion](https://github.com/10gen/mongo/blob/99f7a334eee4b724a231c0db75052eb8199ad8e1/docs/evergreen-testing/multiversion.md#explicit-and-implicit-multiversion-suites) tasks on the other hand must be configured differently to account for various multiversion topologies/version combinations. Here is an example:
161+
```yaml
162+
- <<: *gen_task_template
163+
name: concurrency_replication_multiversion_gen
164+
tags: ["multiversion", "multiversion_passthrough"]
165+
commands:
166+
- func: "initialize multiversion tasks"
167+
vars:
168+
concurrency_replication_last_continuous_new_new_old: last_continuous
169+
concurrency_replication_last_continuous_new_old_new: last_continuous
170+
concurrency_replication_last_continuous_old_new_new: last_continuous
171+
concurrency_replication_last_lts_new_new_old: last_lts
172+
concurrency_replication_last_lts_new_old_new: last_lts
173+
concurrency_replication_last_lts_old_new_new: last_lts
174+
- func: "generate resmoke tasks"
175+
vars:
176+
run_no_feature_flag_tests: "true
177+
```
178+
The `"initialize multiversion tasks"` function has all of the related suites to run as sub-tasks of this task as variable names and the "old" version to run against as the values. The absence of the `"no_multiversion_generate_tasks"` tag indicates to the task generator to generate sub-tasks for this task according to the `"initialize multiversion tasks"` function variables. Because the `suite` name is embedded in the `"initialize multiversion tasks"` variables, a `suite` variable passed to `"generate resmoke tasks"` will have no effect. Additionally, the variable/suite names in `"initialize multiversion tasks"` must be globally unique because these are ultimately going to become the sub-task name and evergreen requires task names to be unique.
160179
### Burn in tests, burn in tags and burn in tasks
161180

162181
Newly added or modified tests might become flaky. In order to avoid that, those tests can be run

src/evergreen/evg_config.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ impl EvgConfigService for EvgProjectConfig {
5858
let build_variant_map = self.get_build_variant_map();
5959
let mut build_variants: Vec<String> = build_variant_map
6060
.keys()
61-
.into_iter()
6261
.filter_map(|bv| {
6362
if bv.ends_with(REQUIRED_PREFIX) {
6463
Some(bv.to_string())
@@ -71,7 +70,6 @@ impl EvgConfigService for EvgProjectConfig {
7170
build_variants.extend::<Vec<String>>(
7271
build_variant_map
7372
.keys()
74-
.into_iter()
7573
.filter_map(|bv| {
7674
if !bv.ends_with(REQUIRED_PREFIX) {
7775
Some(bv.to_string())

0 commit comments

Comments
 (0)