Skip to content

Commit a3152fc

Browse files
committed
fix windows and macos handling
1 parent 90bbb2f commit a3152fc

File tree

5 files changed

+50
-104
lines changed

5 files changed

+50
-104
lines changed

.evergreen/generated_configs/tasks.yml

Lines changed: 28 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,13 @@ tasks:
3636
- func: run tests
3737
vars:
3838
TEST_NAME: auth_aws
39-
SUB_TEST_NAME: web-identity
40-
AWS_ROLE_SESSION_NAME: test
41-
tags: [auth-aws, "4.4"]
42-
- name: test-auth-aws-ecs-4.4
43-
commands:
44-
- func: bootstrap mongo-orchestration
45-
vars:
46-
AUTH: auth
47-
ORCHESTRATION_FILE: auth-aws.json
48-
TOPOLOGY: server
49-
VERSION: "4.4"
39+
SUB_TEST_NAME: ecs
5040
- func: run tests
5141
vars:
5242
TEST_NAME: auth_aws
53-
SUB_TEST_NAME: ecs
54-
tags: [auth-aws-ecs]
43+
SUB_TEST_NAME: web-identity
44+
AWS_ROLE_SESSION_NAME: test
45+
tags: [auth-aws]
5546
- name: test-auth-aws-5.0
5647
commands:
5748
- func: bootstrap mongo-orchestration
@@ -88,22 +79,13 @@ tasks:
8879
- func: run tests
8980
vars:
9081
TEST_NAME: auth_aws
91-
SUB_TEST_NAME: web-identity
92-
AWS_ROLE_SESSION_NAME: test
93-
tags: [auth-aws, "5.0"]
94-
- name: test-auth-aws-ecs-5.0
95-
commands:
96-
- func: bootstrap mongo-orchestration
97-
vars:
98-
AUTH: auth
99-
ORCHESTRATION_FILE: auth-aws.json
100-
TOPOLOGY: server
101-
VERSION: "5.0"
82+
SUB_TEST_NAME: ecs
10283
- func: run tests
10384
vars:
10485
TEST_NAME: auth_aws
105-
SUB_TEST_NAME: ecs
106-
tags: [auth-aws-ecs]
86+
SUB_TEST_NAME: web-identity
87+
AWS_ROLE_SESSION_NAME: test
88+
tags: [auth-aws]
10789
- name: test-auth-aws-6.0
10890
commands:
10991
- func: bootstrap mongo-orchestration
@@ -140,22 +122,13 @@ tasks:
140122
- func: run tests
141123
vars:
142124
TEST_NAME: auth_aws
143-
SUB_TEST_NAME: web-identity
144-
AWS_ROLE_SESSION_NAME: test
145-
tags: [auth-aws, "6.0"]
146-
- name: test-auth-aws-ecs-6.0
147-
commands:
148-
- func: bootstrap mongo-orchestration
149-
vars:
150-
AUTH: auth
151-
ORCHESTRATION_FILE: auth-aws.json
152-
TOPOLOGY: server
153-
VERSION: "6.0"
125+
SUB_TEST_NAME: ecs
154126
- func: run tests
155127
vars:
156128
TEST_NAME: auth_aws
157-
SUB_TEST_NAME: ecs
158-
tags: [auth-aws-ecs]
129+
SUB_TEST_NAME: web-identity
130+
AWS_ROLE_SESSION_NAME: test
131+
tags: [auth-aws]
159132
- name: test-auth-aws-7.0
160133
commands:
161134
- func: bootstrap mongo-orchestration
@@ -192,22 +165,13 @@ tasks:
192165
- func: run tests
193166
vars:
194167
TEST_NAME: auth_aws
195-
SUB_TEST_NAME: web-identity
196-
AWS_ROLE_SESSION_NAME: test
197-
tags: [auth-aws, "7.0"]
198-
- name: test-auth-aws-ecs-7.0
199-
commands:
200-
- func: bootstrap mongo-orchestration
201-
vars:
202-
AUTH: auth
203-
ORCHESTRATION_FILE: auth-aws.json
204-
TOPOLOGY: server
205-
VERSION: "7.0"
168+
SUB_TEST_NAME: ecs
206169
- func: run tests
207170
vars:
208171
TEST_NAME: auth_aws
209-
SUB_TEST_NAME: ecs
210-
tags: [auth-aws-ecs]
172+
SUB_TEST_NAME: web-identity
173+
AWS_ROLE_SESSION_NAME: test
174+
tags: [auth-aws]
211175
- name: test-auth-aws-8.0
212176
commands:
213177
- func: bootstrap mongo-orchestration
@@ -244,22 +208,13 @@ tasks:
244208
- func: run tests
245209
vars:
246210
TEST_NAME: auth_aws
247-
SUB_TEST_NAME: web-identity
248-
AWS_ROLE_SESSION_NAME: test
249-
tags: [auth-aws, "8.0"]
250-
- name: test-auth-aws-ecs-8.0
251-
commands:
252-
- func: bootstrap mongo-orchestration
253-
vars:
254-
AUTH: auth
255-
ORCHESTRATION_FILE: auth-aws.json
256-
TOPOLOGY: server
257-
VERSION: "8.0"
211+
SUB_TEST_NAME: ecs
258212
- func: run tests
259213
vars:
260214
TEST_NAME: auth_aws
261-
SUB_TEST_NAME: ecs
262-
tags: [auth-aws-ecs]
215+
SUB_TEST_NAME: web-identity
216+
AWS_ROLE_SESSION_NAME: test
217+
tags: [auth-aws]
263218
- name: test-auth-aws-rapid
264219
commands:
265220
- func: bootstrap mongo-orchestration
@@ -296,22 +251,13 @@ tasks:
296251
- func: run tests
297252
vars:
298253
TEST_NAME: auth_aws
299-
SUB_TEST_NAME: web-identity
300-
AWS_ROLE_SESSION_NAME: test
301-
tags: [auth-aws, rapid]
302-
- name: test-auth-aws-ecs-rapid
303-
commands:
304-
- func: bootstrap mongo-orchestration
305-
vars:
306-
AUTH: auth
307-
ORCHESTRATION_FILE: auth-aws.json
308-
TOPOLOGY: server
309-
VERSION: rapid
254+
SUB_TEST_NAME: ecs
310255
- func: run tests
311256
vars:
312257
TEST_NAME: auth_aws
313-
SUB_TEST_NAME: ecs
314-
tags: [auth-aws-ecs]
258+
SUB_TEST_NAME: web-identity
259+
AWS_ROLE_SESSION_NAME: test
260+
tags: [auth-aws]
315261
- name: test-auth-aws-latest
316262
commands:
317263
- func: bootstrap mongo-orchestration
@@ -348,22 +294,13 @@ tasks:
348294
- func: run tests
349295
vars:
350296
TEST_NAME: auth_aws
351-
SUB_TEST_NAME: web-identity
352-
AWS_ROLE_SESSION_NAME: test
353-
tags: [auth-aws, latest]
354-
- name: test-auth-aws-ecs-latest
355-
commands:
356-
- func: bootstrap mongo-orchestration
357-
vars:
358-
AUTH: auth
359-
ORCHESTRATION_FILE: auth-aws.json
360-
TOPOLOGY: server
361-
VERSION: latest
297+
SUB_TEST_NAME: ecs
362298
- func: run tests
363299
vars:
364300
TEST_NAME: auth_aws
365-
SUB_TEST_NAME: ecs
366-
tags: [auth-aws-ecs]
301+
SUB_TEST_NAME: web-identity
302+
AWS_ROLE_SESSION_NAME: test
303+
tags: [auth-aws]
367304

368305
# Kms tests
369306
- name: test-gcpkms

.evergreen/generated_configs/variants.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ buildvariants:
108108
- name: auth-aws-ubuntu-20-python3.9
109109
tasks:
110110
- name: .auth-aws
111-
- name: .auth-aws-ecs
112111
display_name: Auth AWS Ubuntu-20 Python3.9
113112
run_on:
114113
- ubuntu2004-small
@@ -117,7 +116,6 @@ buildvariants:
117116
- name: auth-aws-ubuntu-20-python3.13
118117
tasks:
119118
- name: .auth-aws
120-
- name: .auth-aws-ecs
121119
display_name: Auth AWS Ubuntu-20 Python3.13
122120
run_on:
123121
- ubuntu2004-small

.evergreen/scripts/generate_config.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -738,8 +738,6 @@ def create_aws_auth_variants():
738738
for host_name, python in product(["ubuntu20", "win64", "macos"], MIN_MAX_PYTHON):
739739
expansions = dict()
740740
tasks = [".auth-aws"]
741-
if host_name == "ubuntu20":
742-
tasks += [".auth-aws-ecs"]
743741
host = HOSTS[host_name]
744742
variant = create_variant(
745743
tasks,
@@ -845,10 +843,18 @@ def create_kms_tasks():
845843

846844
def create_aws_tasks():
847845
tasks = []
848-
aws_test_types = ["regular", "assume-role", "ec2", "env-creds", "session-creds", "web-identity"]
846+
aws_test_types = [
847+
"regular",
848+
"assume-role",
849+
"ec2",
850+
"env-creds",
851+
"session-creds",
852+
"web-identity",
853+
"ecs",
854+
]
849855
for version in get_versions_from("4.4"):
850856
name = f"test-auth-aws-{version}"
851-
tags = ["auth-aws", version]
857+
tags = ["auth-aws"]
852858
bootstrap_vars = dict(
853859
AUTH="auth", ORCHESTRATION_FILE="auth-aws.json", TOPOLOGY="server", VERSION=version
854860
)
@@ -865,11 +871,6 @@ def create_aws_tasks():
865871
funcs = [bootstrap_func, assume_func, *test_funcs]
866872
tasks.append(EvgTask(name=name, tags=tags, commands=funcs))
867873

868-
tags = ["auth-aws-ecs"]
869-
name = f"test-auth-aws-ecs-{version}"
870-
test_vars = dict(TEST_NAME="auth_aws", SUB_TEST_NAME="ecs")
871-
ecs_func = FunctionCall(func="run tests", vars=test_vars)
872-
tasks.append(EvgTask(name=name, tags=tags, commands=[bootstrap_func, ecs_func]))
873874
return tasks
874875

875876

.evergreen/scripts/run_tests.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ def handle_pymongocrypt() -> None:
8282

8383

8484
def run() -> None:
85+
if os.environ.get("SKIP_TESTS"):
86+
LOGGER.info("Skipping tests")
87+
return
88+
8589
# Handle green framework first so they can patch modules.
8690
if GREEN_FRAMEWORK:
8791
handle_green_framework()

.evergreen/scripts/setup_tests.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,17 +369,23 @@ def handle_test_env() -> None:
369369
write_env("OCSP_TLS_SHOULD_SUCCEED", os.environ["OCSP_TLS_SHOULD_SUCCEED"])
370370

371371
if test_name == "auth_aws" and sub_test_name != "ecs-remote":
372+
if sub_test_name in ["ec2", "web_identity"] and PLATFORM == "darwin":
373+
write_env("SKIP_TESTS")
374+
return
375+
if sub_test_name == "ec2" and PLATFORM != "linux":
376+
write_env("SKIP_TESTS")
377+
return
372378
auth_aws_dir = f"{DRIVERS_TOOLS}/.evergreen/auth_aws"
373379
if "AWS_ROLE_SESSION_NAME" in os.environ:
374380
write_env("AWS_ROLE_SESSION_NAME")
375381
if sub_test_name != "ecs":
376382
aws_setup = f"{auth_aws_dir}/aws_setup.sh"
377-
run_command(f"{aws_setup} {sub_test_name}")
383+
run_command(f"bash {aws_setup} {sub_test_name}")
378384
creds = read_env(f"{auth_aws_dir}/test-env.sh")
379385
for name, value in creds.items():
380386
write_env(name, value)
381387
else:
382-
run_command(f"{auth_aws_dir}/setup-secrets.sh")
388+
run_command(f"bash {auth_aws_dir}/setup-secrets.sh")
383389

384390
if test_name == "perf":
385391
# PYTHON-4769 Run perf_test.py directly otherwise pytest's test collection negatively

0 commit comments

Comments
 (0)