Skip to content

Commit 846b1fc

Browse files
authored
PYTHON-5316 Update tests for other hosts (#2287)
1 parent b83389d commit 846b1fc

File tree

4 files changed

+105
-32
lines changed

4 files changed

+105
-32
lines changed

.evergreen/generated_configs/tasks.yml

+44
Original file line numberDiff line numberDiff line change
@@ -3083,6 +3083,50 @@ tasks:
30833083
SUB_TEST_NAME: gke
30843084
tags: [auth_oidc, auth_oidc_remote]
30853085

3086+
# Other hosts tests
3087+
- name: test-sync-noauth-nossl-standalone
3088+
commands:
3089+
- func: run server
3090+
vars:
3091+
AUTH: noauth
3092+
SSL: nossl
3093+
TOPOLOGY: standalone
3094+
- func: run tests
3095+
vars:
3096+
AUTH: noauth
3097+
SSL: nossl
3098+
TOPOLOGY: standalone
3099+
TEST_NAME: default_sync
3100+
tags: [other-hosts, standalone-noauth-nossl]
3101+
- name: test-async-noauth-ssl-replica-set
3102+
commands:
3103+
- func: run server
3104+
vars:
3105+
AUTH: noauth
3106+
SSL: ssl
3107+
TOPOLOGY: replica_set
3108+
- func: run tests
3109+
vars:
3110+
AUTH: noauth
3111+
SSL: ssl
3112+
TOPOLOGY: replica_set
3113+
TEST_NAME: default_async
3114+
tags: [other-hosts, replica_set-noauth-ssl]
3115+
- name: test-sync-auth-ssl-sharded-cluster
3116+
commands:
3117+
- func: run server
3118+
vars:
3119+
AUTH: auth
3120+
SSL: ssl
3121+
TOPOLOGY: sharded_cluster
3122+
- func: run tests
3123+
vars:
3124+
AUTH: auth
3125+
SSL: ssl
3126+
TOPOLOGY: sharded_cluster
3127+
TEST_NAME: default_sync
3128+
tags: [other-hosts, sharded_cluster-auth-ssl]
3129+
30863130
# Perf tests
30873131
- name: perf-8.0-standalone-ssl
30883132
commands:

.evergreen/generated_configs/variants.yml

+25-20
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,66 @@
11
buildvariants:
22
# Alternative hosts tests
3-
- name: openssl-1.0.2-rhel7-python3.9
3+
- name: openssl-1.0.2-rhel7-v5.0-python3.9
44
tasks:
5-
- name: .5.0 .standalone !.sync_async
6-
display_name: OpenSSL 1.0.2 RHEL7 Python3.9
5+
- name: .other-hosts
6+
display_name: OpenSSL 1.0.2 RHEL7 v5.0 Python3.9
77
run_on:
88
- rhel79-small
99
batchtime: 10080
1010
expansions:
11+
VERSION: "5.0"
12+
PYTHON_VERSION: "3.9"
1113
PYTHON_BINARY: /opt/python/3.9/bin/python3
12-
- name: other-hosts-rhel9-fips
14+
- name: other-hosts-rhel9-fips-latest
1315
tasks:
14-
- name: .6.0 .standalone !.sync_async
15-
display_name: Other hosts RHEL9-FIPS
16+
- name: .other-hosts
17+
display_name: Other hosts RHEL9-FIPS latest
1618
run_on:
1719
- rhel92-fips
1820
batchtime: 10080
1921
expansions:
22+
VERSION: latest
2023
NO_EXT: "1"
2124
REQUIRE_FIPS: "1"
22-
- name: other-hosts-rhel8-zseries
25+
- name: other-hosts-rhel8-zseries-latest
2326
tasks:
24-
- name: .6.0 .standalone !.sync_async
25-
display_name: Other hosts RHEL8-zseries
27+
- name: .other-hosts
28+
display_name: Other hosts RHEL8-zseries latest
2629
run_on:
2730
- rhel8-zseries-small
2831
batchtime: 10080
2932
expansions:
33+
VERSION: latest
3034
NO_EXT: "1"
31-
- name: other-hosts-rhel8-power8
35+
- name: other-hosts-rhel8-power8-latest
3236
tasks:
33-
- name: .6.0 .standalone !.sync_async
34-
display_name: Other hosts RHEL8-POWER8
37+
- name: .other-hosts
38+
display_name: Other hosts RHEL8-POWER8 latest
3539
run_on:
3640
- rhel8-power-small
3741
batchtime: 10080
3842
expansions:
43+
VERSION: latest
3944
NO_EXT: "1"
40-
- name: other-hosts-rhel8-arm64
45+
- name: other-hosts-rhel8-arm64-latest
4146
tasks:
42-
- name: .6.0 .standalone !.sync_async
43-
display_name: Other hosts RHEL8-arm64
47+
- name: .other-hosts
48+
display_name: Other hosts RHEL8-arm64 latest
4449
run_on:
4550
- rhel82-arm64-small
4651
batchtime: 10080
4752
expansions:
53+
VERSION: latest
4854
NO_EXT: "1"
49-
- name: other-hosts-amazon2023
55+
- name: other-hosts-amazon2023-latest
5056
tasks:
51-
- name: .latest !.sync_async .sharded_cluster .auth .ssl
52-
- name: .latest !.sync_async .replica_set .noauth .ssl
53-
- name: .latest !.sync_async .standalone .noauth .nossl
54-
display_name: Other hosts Amazon2023
57+
- name: .other-hosts
58+
display_name: Other hosts Amazon2023 latest
5559
run_on:
5660
- amazon2023-arm64-latest-large-m8g
5761
batchtime: 10080
5862
expansions:
63+
VERSION: latest
5964
NO_EXT: "1"
6065

6166
# Atlas connect tests

.evergreen/scripts/generate_config.py

+30-12
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
create_variant,
2323
get_assume_role,
2424
get_s3_put,
25+
get_standard_auth_ssl,
2526
get_subprocess_exec,
2627
get_task_name,
2728
get_variant_name,
@@ -548,29 +549,29 @@ def create_alternative_hosts_variants():
548549
variants = []
549550

550551
host = HOSTS["rhel7"]
552+
version = "5.0"
551553
variants.append(
552554
create_variant(
553-
[".5.0 .standalone !.sync_async"],
554-
get_variant_name("OpenSSL 1.0.2", host, python=CPYTHONS[0]),
555+
[".other-hosts"],
556+
get_variant_name("OpenSSL 1.0.2", host, python=CPYTHONS[0], version=version),
555557
host=host,
556558
python=CPYTHONS[0],
557559
batchtime=batchtime,
560+
expansions=dict(VERSION=version, PYTHON_VERSION=CPYTHONS[0]),
558561
)
559562
)
560563

564+
version = "latest"
561565
for host_name in OTHER_HOSTS:
562-
expansions = dict()
566+
expansions = dict(VERSION="latest")
563567
handle_c_ext(C_EXTS[0], expansions)
564568
host = HOSTS[host_name]
565569
if "fips" in host_name.lower():
566570
expansions["REQUIRE_FIPS"] = "1"
567-
tags = [".6.0 .standalone !.sync_async"]
568-
if host_name == "Amazon2023":
569-
tags = [f".latest !.sync_async {t}" for t in SUB_TASKS]
570571
variants.append(
571572
create_variant(
572-
tags,
573-
display_name=get_variant_name("Other hosts", host),
573+
[".other-hosts"],
574+
display_name=get_variant_name("Other hosts", host, version=version),
574575
batchtime=batchtime,
575576
host=host,
576577
expansions=expansions,
@@ -615,14 +616,32 @@ def create_server_version_tasks():
615616
return tasks
616617

617618

619+
def create_other_hosts_tasks():
620+
tasks = []
621+
622+
for topology, sync in zip_cycle(TOPOLOGIES, SYNCS):
623+
auth, ssl = get_standard_auth_ssl(topology)
624+
tags = [
625+
"other-hosts",
626+
f"{topology}-{auth}-{ssl}",
627+
]
628+
expansions = dict(AUTH=auth, SSL=ssl, TOPOLOGY=topology)
629+
name = get_task_name("test", sync=sync, **expansions)
630+
server_func = FunctionCall(func="run server", vars=expansions)
631+
test_vars = expansions.copy()
632+
test_vars["TEST_NAME"] = f"default_{sync}"
633+
test_func = FunctionCall(func="run tests", vars=test_vars)
634+
tasks.append(EvgTask(name=name, tags=tags, commands=[server_func, test_func]))
635+
return tasks
636+
637+
618638
def create_standard_linux_tasks():
619639
tasks = []
620640

621641
for (version, topology), python in zip_cycle(
622642
list(product(ALL_VERSIONS, TOPOLOGIES)), ALL_PYTHONS
623643
):
624-
auth = "auth" if topology == "sharded_cluster" else "noauth"
625-
ssl = "nossl" if topology == "standalone" else "ssl"
644+
auth, ssl = get_standard_auth_ssl(topology)
626645
tags = [
627646
"standard-linux",
628647
f"server-{version}",
@@ -645,8 +664,7 @@ def create_standard_non_linux_tasks():
645664
for (version, topology), python, sync in zip_cycle(
646665
list(product(ALL_VERSIONS, TOPOLOGIES)), CPYTHONS, SYNCS
647666
):
648-
auth = "auth" if topology == "sharded_cluster" else "noauth"
649-
ssl = "nossl" if topology == "standalone" else "ssl"
667+
auth, ssl = get_standard_auth_ssl(topology)
650668
tags = [
651669
"standard-non-linux",
652670
f"server-{version}",

.evergreen/scripts/generate_config_utils.py

+6
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,12 @@ def handle_c_ext(c_ext, expansions) -> None:
239239
expansions["NO_EXT"] = "1"
240240

241241

242+
def get_standard_auth_ssl(topology):
243+
auth = "auth" if topology == "sharded_cluster" else "noauth"
244+
ssl = "nossl" if topology == "standalone" else "ssl"
245+
return auth, ssl
246+
247+
242248
def get_assume_role(**kwargs):
243249
kwargs.setdefault("command_type", EvgCommandType.SETUP)
244250
kwargs.setdefault("role_arn", "${assume_role_arn}")

0 commit comments

Comments
 (0)