Skip to content

Commit 3723edc

Browse files
authored
PYTHON-5277 Convert remaining Evergreen functions to generated config (#2281)
1 parent 5d14b34 commit 3723edc

File tree

4 files changed

+284
-109
lines changed

4 files changed

+284
-109
lines changed

Diff for: .evergreen/config.yml

-108
Original file line numberDiff line numberDiff line change
@@ -29,114 +29,6 @@ include:
2929
- filename: .evergreen/generated_configs/tasks.yml
3030
- filename: .evergreen/generated_configs/variants.yml
3131

32-
functions:
33-
"fetch source":
34-
# Executes clone and applies the submitted patch, if any
35-
- command: git.get_project
36-
params:
37-
directory: "src"
38-
# Applies the subitted patch, if any
39-
# Deprecated. Should be removed. But still needed for certain agents (ZAP)
40-
- command: git.apply_patch
41-
42-
"setup system":
43-
# Make an evergreen expansion file with dynamic values
44-
- command: subprocess.exec
45-
params:
46-
include_expansions_in_env: ["is_patch", "project", "version_id"]
47-
binary: bash
48-
working_dir: "src"
49-
args:
50-
- .evergreen/scripts/setup-system.sh
51-
# Load the expansion file to make an evergreen variable with the current unique version
52-
- command: expansions.update
53-
params:
54-
file: src/expansion.yml
55-
56-
"upload test results":
57-
- command: attach.results
58-
params:
59-
file_location: "${DRIVERS_TOOLS}/results.json"
60-
- command: attach.xunit_results
61-
params:
62-
file: "src/xunit-results/TEST-*.xml"
63-
64-
"run server":
65-
- command: subprocess.exec
66-
params:
67-
binary: bash
68-
working_dir: "src"
69-
include_expansions_in_env: [VERSION, TOPOLOGY, AUTH, SSL, ORCHESTRATION_FILE, PYTHON_BINARY, PYTHON_VERSION, IS_WIN32,
70-
STORAGE_ENGINE, REQUIRE_API_VERSION, DRIVERS_TOOLS, TEST_CRYPT_SHARED, AUTH_AWS, LOAD_BALANCER, LOCAL_ATLAS, NO_EXT]
71-
args: [.evergreen/just.sh, run-server, "${TEST_NAME}"]
72-
- command: expansions.update
73-
params:
74-
file: ${DRIVERS_TOOLS}/mo-expansion.yml
75-
76-
"run just script":
77-
- command: subprocess.exec
78-
type: test
79-
params:
80-
include_expansions_in_env: [AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN]
81-
binary: bash
82-
working_dir: "src"
83-
args: [.evergreen/just.sh, "${JUSTFILE_TARGET}"]
84-
85-
"run tests":
86-
- command: subprocess.exec
87-
type: test
88-
params:
89-
include_expansions_in_env: [AUTH, SSL, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY,
90-
AWS_SESSION_TOKEN, COVERAGE, PYTHON_BINARY, LIBMONGOCRYPT_URL, MONGODB_URI, PYTHON_VERSION, IS_WIN32,
91-
DISABLE_TEST_COMMANDS, GREEN_FRAMEWORK, NO_EXT, COMPRESSORS, MONGODB_API_VERSION, DEBUG_LOG,
92-
ORCHESTRATION_FILE, OCSP_SERVER_TYPE, VERSION, REQUIRE_FIPS]
93-
binary: bash
94-
working_dir: "src"
95-
args: [.evergreen/just.sh, setup-tests, "${TEST_NAME}", "${SUB_TEST_NAME}"]
96-
- command: subprocess.exec
97-
type: test
98-
params:
99-
working_dir: "src"
100-
binary: bash
101-
args: [.evergreen/just.sh, run-tests]
102-
103-
"cleanup":
104-
- command: subprocess.exec
105-
params:
106-
binary: bash
107-
working_dir: "src"
108-
args:
109-
- .evergreen/scripts/cleanup.sh
110-
111-
"teardown system":
112-
- command: subprocess.exec
113-
params:
114-
binary: bash
115-
working_dir: "src"
116-
args: [.evergreen/just.sh, teardown-tests]
117-
- command: subprocess.exec
118-
params:
119-
binary: bash
120-
working_dir: "src"
121-
args:
122-
- ${DRIVERS_TOOLS}/.evergreen/teardown.sh
123-
124-
"assume ec2 role":
125-
- command: ec2.assume_role
126-
params:
127-
role_arn: ${aws_test_secrets_role}
128-
duration_seconds: 3600
129-
130-
"attach benchmark test results":
131-
- command: attach.results
132-
params:
133-
file_location: src/report.json
134-
135-
"send dashboard data":
136-
- command: perf.send
137-
params:
138-
file: src/results.json
139-
14032
pre:
14133
- func: "fetch source"
14234
- func: "setup system"

Diff for: .evergreen/generated_configs/functions.yml

+168
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,27 @@
11
functions:
2+
# Assume ec2 role
3+
assume ec2 role:
4+
- command: ec2.assume_role
5+
params:
6+
role_arn: ${aws_test_secrets_role}
7+
duration_seconds: 3600
8+
9+
# Attach benchmark test results
10+
attach benchmark test results:
11+
- command: attach.results
12+
params:
13+
file_location: src/report.json
14+
15+
# Cleanup
16+
cleanup:
17+
- command: subprocess.exec
18+
params:
19+
binary: bash
20+
args:
21+
- .evergreen/scripts/cleanup.sh
22+
working_dir: src
23+
type: test
24+
225
# Download and merge coverage
326
download and merge coverage:
427
- command: ec2.assume_role
@@ -56,6 +79,142 @@ functions:
5679
optional: "true"
5780
type: setup
5881

82+
# Fetch source
83+
fetch source:
84+
- command: git.get_project
85+
params:
86+
directory: src
87+
88+
# Run just script
89+
run just script:
90+
- command: subprocess.exec
91+
params:
92+
binary: bash
93+
args:
94+
- .evergreen/just.sh
95+
- ${JUSTFILE_TARGET}
96+
working_dir: src
97+
include_expansions_in_env:
98+
- AWS_ACCESS_KEY_ID
99+
- AWS_SECRET_ACCESS_KEY
100+
- AWS_SESSION_TOKEN
101+
type: test
102+
103+
# Run server
104+
run server:
105+
- command: subprocess.exec
106+
params:
107+
binary: bash
108+
args:
109+
- .evergreen/just.sh
110+
- run-server
111+
- ${TEST_NAME}
112+
working_dir: src
113+
include_expansions_in_env:
114+
- VERSION
115+
- TOPOLOGY
116+
- AUTH
117+
- SSL
118+
- ORCHESTRATION_FILE
119+
- PYTHON_BINARY
120+
- PYTHON_VERSION
121+
- STORAGE_ENGINE
122+
- REQUIRE_API_VERSION
123+
- DRIVERS_TOOLS
124+
- TEST_CRYPT_SHARED
125+
- AUTH_AWS
126+
- LOAD_BALANCER
127+
- LOCAL_ATLAS
128+
- NO_EXT
129+
type: test
130+
- command: expansions.update
131+
params:
132+
file: ${DRIVERS_TOOLS}/mo-expansion.yml
133+
134+
# Run tests
135+
run tests:
136+
- command: subprocess.exec
137+
params:
138+
binary: bash
139+
args:
140+
- .evergreen/just.sh
141+
- setup-tests
142+
- ${TEST_NAME}
143+
- ${SUB_TEST_NAME}
144+
working_dir: src
145+
include_expansions_in_env:
146+
- AUTH
147+
- SSL
148+
- AWS_ACCESS_KEY_ID
149+
- AWS_SECRET_ACCESS_KEY
150+
- AWS_SESSION_TOKEN
151+
- COVERAGE
152+
- PYTHON_BINARY
153+
- LIBMONGOCRYPT_URL
154+
- MONGODB_URI
155+
- PYTHON_VERSION
156+
- DISABLE_TEST_COMMANDS
157+
- GREEN_FRAMEWORK
158+
- NO_EXT
159+
- COMPRESSORS
160+
- MONGODB_API_VERSION
161+
- DEBUG_LOG
162+
- ORCHESTRATION_FILE
163+
- OCSP_SERVER_TYPE
164+
- VERSION
165+
- IS_WIN32
166+
- REQUIRE_FIPS
167+
type: test
168+
- command: subprocess.exec
169+
params:
170+
binary: bash
171+
args:
172+
- .evergreen/just.sh
173+
- run-tests
174+
working_dir: src
175+
type: test
176+
177+
# Send dashboard data
178+
send dashboard data:
179+
- command: perf.send
180+
params:
181+
file: src/results.json
182+
183+
# Setup system
184+
setup system:
185+
- command: subprocess.exec
186+
params:
187+
binary: bash
188+
args:
189+
- .evergreen/scripts/setup-system.sh
190+
working_dir: src
191+
include_expansions_in_env:
192+
- is_patch
193+
- project
194+
- version_id
195+
type: test
196+
- command: expansions.update
197+
params:
198+
file: src/expansion.yml
199+
200+
# Teardown system
201+
teardown system:
202+
- command: subprocess.exec
203+
params:
204+
binary: bash
205+
args:
206+
- .evergreen/just.sh
207+
- teardown-tests
208+
working_dir: src
209+
type: test
210+
- command: subprocess.exec
211+
params:
212+
binary: bash
213+
args:
214+
- ${DRIVERS_TOOLS}/.evergreen/teardown.sh
215+
working_dir: src
216+
type: test
217+
59218
# Upload coverage
60219
upload coverage:
61220
- command: ec2.assume_role
@@ -115,3 +274,12 @@ functions:
115274
display_name: drivers-tools-logs.tar.gz
116275
optional: "true"
117276
type: setup
277+
278+
# Upload test results
279+
upload test results:
280+
- command: attach.results
281+
params:
282+
file_location: ${DRIVERS_TOOLS}/results.json
283+
- command: attach.xunit_results
284+
params:
285+
file: src/xunit-results/TEST-*.xml

0 commit comments

Comments
 (0)