Skip to content

Commit 896f139

Browse files
authored
PYTHON-5703 Use Ubuntu24 for AWS Auth tests (#2686)
1 parent a89c5e3 commit 896f139

File tree

4 files changed

+49
-10
lines changed

4 files changed

+49
-10
lines changed

.evergreen/generated_configs/tasks.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ tasks:
102102
AWS_ROLE_SESSION_NAME: test
103103
TOOLCHAIN_VERSION: "3.14"
104104
tags: [auth-aws, auth-aws-web-identity]
105-
- name: test-auth-aws-latest-ecs-python3.10
105+
- name: test-auth-aws-latest-regular-python3.10-min-deps
106106
commands:
107107
- func: run server
108108
vars:
@@ -112,9 +112,21 @@ tasks:
112112
- func: run tests
113113
vars:
114114
TEST_NAME: auth_aws
115-
SUB_TEST_NAME: ecs
115+
SUB_TEST_NAME: regular
116116
TOOLCHAIN_VERSION: "3.10"
117-
tags: [auth-aws, auth-aws-ecs]
117+
TEST_MIN_DEPS: "1"
118+
tags: [auth-aws, auth-aws-regular]
119+
- name: test-auth-aws-ecs
120+
commands:
121+
- func: assume ec2 role
122+
- func: run server
123+
vars:
124+
VERSION: "8.0"
125+
- func: run tests
126+
vars:
127+
TEST_NAME: auth_aws
128+
SUB_TEST_NAME: ecs
129+
tags: [auth-aws-ecs]
118130

119131
# Backport pr tests
120132
- name: backport-pr

.evergreen/generated_configs/variants.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,25 @@ buildvariants:
7979
tags: []
8080
- name: auth-aws-win64
8181
tasks:
82-
- name: .auth-aws !.auth-aws-ecs
82+
- name: .auth-aws
8383
display_name: Auth AWS Win64
8484
run_on:
8585
- windows-2022-latest-small
8686
tags: []
8787
- name: auth-aws-macos
8888
tasks:
89-
- name: .auth-aws !.auth-aws-web-identity !.auth-aws-ecs !.auth-aws-ec2
89+
- name: .auth-aws !.auth-aws-web-identity !.auth-aws-ec2
9090
display_name: Auth AWS macOS
9191
run_on:
9292
- macos-14
9393
tags: [pr]
94+
- name: auth-aws-ecs-macos
95+
tasks:
96+
- name: .auth-aws-ecs
97+
display_name: Auth AWS ECS macOS
98+
run_on:
99+
- ubuntu2404-small
100+
tags: [pr]
94101

95102
# Aws lambda tests
96103
- name: faas-lambda

.evergreen/scripts/generate_config.py

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,10 @@ def create_aws_auth_variants():
486486
tasks = [".auth-aws"]
487487
tags = []
488488
if host_name == "macos":
489-
tasks = [".auth-aws !.auth-aws-web-identity !.auth-aws-ecs !.auth-aws-ec2"]
489+
tasks = [".auth-aws !.auth-aws-web-identity !.auth-aws-ec2"]
490490
tags = ["pr"]
491491
elif host_name == "win64":
492-
tasks = [".auth-aws !.auth-aws-ecs"]
492+
tasks = [".auth-aws"]
493493
host = HOSTS[host_name]
494494
variant = create_variant(
495495
tasks,
@@ -499,6 +499,16 @@ def create_aws_auth_variants():
499499
expansions=expansions,
500500
)
501501
variants.append(variant)
502+
503+
# The ECS test must be run on Ubuntu 24 to match the Fargate Config.
504+
variant = create_variant(
505+
[".auth-aws-ecs"],
506+
get_variant_name("Auth AWS ECS", host),
507+
host=HOSTS["ubuntu24"],
508+
tags=tags,
509+
expansions=expansions,
510+
)
511+
variants.append(variant)
502512
return variants
503513

504514

@@ -788,19 +798,18 @@ def create_aws_tasks():
788798
"env-creds",
789799
"session-creds",
790800
"web-identity",
791-
"ecs",
792801
]
802+
assume_func = FunctionCall(func="assume ec2 role")
793803
for version, test_type, python in zip_cycle(get_versions_from("4.4"), aws_test_types, CPYTHONS):
794804
base_name = f"test-auth-aws-{version}"
795805
base_tags = ["auth-aws"]
796806
server_vars = dict(AUTH_AWS="1", VERSION=version)
797807
server_func = FunctionCall(func="run server", vars=server_vars)
798-
assume_func = FunctionCall(func="assume ec2 role")
799808
tags = [*base_tags, f"auth-aws-{test_type}"]
800809
if "t" in python:
801810
tags.append("free-threaded")
802811
test_vars = dict(TEST_NAME="auth_aws", SUB_TEST_NAME=test_type, TOOLCHAIN_VERSION=python)
803-
if python == ALL_PYTHONS[0] and test_type != "ecs":
812+
if python == ALL_PYTHONS[0]:
804813
test_vars["TEST_MIN_DEPS"] = "1"
805814
name = get_task_name(f"{base_name}-{test_type}", **test_vars)
806815
test_func = FunctionCall(func="run tests", vars=test_vars)
@@ -822,6 +831,16 @@ def create_aws_tasks():
822831
funcs = [server_func, assume_func, test_func]
823832
tasks.append(EvgTask(name=name, tags=tags, commands=funcs))
824833

834+
# Add the ECS task. This will run on Ubuntu 24 to match the
835+
# Fargate environment.
836+
tags = ["auth-aws-ecs"]
837+
test_vars = dict(TEST_NAME="auth_aws", SUB_TEST_NAME="ecs")
838+
name = get_task_name("test-auth-aws-ecs", **test_vars)
839+
test_func = FunctionCall(func="run tests", vars=test_vars)
840+
server_func = FunctionCall(func="run server", vars=dict(VERSION="8.0"))
841+
funcs = [assume_func, server_func, test_func]
842+
tasks.append(EvgTask(name=name, tags=tags, commands=funcs))
843+
825844
return tasks
826845

827846

.evergreen/scripts/generate_config_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class Host:
6464
HOSTS["macos"] = Host("macos", "macos-14", "macOS", dict())
6565
HOSTS["macos-arm64"] = Host("macos-arm64", "macos-14-arm64", "macOS Arm64", dict())
6666
HOSTS["ubuntu22"] = Host("ubuntu22", "ubuntu2204-small", "Ubuntu-22", dict())
67+
HOSTS["ubuntu24"] = Host("ubuntu24", "ubuntu2404-small", "Ubuntu-24", dict())
6768
HOSTS["perf"] = Host("perf", "rhel90-dbx-perf-large", "", dict())
6869
HOSTS["debian11"] = Host("debian11", "debian11-small", "Debian11", dict())
6970
DEFAULT_HOST = HOSTS["rhel8"]

0 commit comments

Comments
 (0)