Skip to content

Commit 8cef199

Browse files
committed
PYTHON-4879 Use shrub.py for compressor tests
1 parent 257aa24 commit 8cef199

File tree

2 files changed

+300
-50
lines changed

2 files changed

+300
-50
lines changed

.evergreen/config.yml

Lines changed: 251 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2112,23 +2112,6 @@ axes:
21122112
AUTH: "noauth"
21132113
SSL: "nossl"
21142114

2115-
# Choice of wire protocol compression support
2116-
- id: compression
2117-
display_name: Compression
2118-
values:
2119-
- id: snappy
2120-
display_name: snappy compression
2121-
variables:
2122-
COMPRESSORS: "snappy"
2123-
- id: zlib
2124-
display_name: zlib compression
2125-
variables:
2126-
COMPRESSORS: "zlib"
2127-
- id: zstd
2128-
display_name: zstd compression
2129-
variables:
2130-
COMPRESSORS: "zstd"
2131-
21322115
# Choice of MongoDB server version
21332116
- id: mongodb-version
21342117
display_name: "MongoDB"
@@ -3125,6 +3108,257 @@ buildvariants:
31253108
PYTHON_BINARY: C:/python/Python313/python.exe
31263109
tags: [encryption_tag]
31273110

3111+
# Compressor tests.
3112+
- name: snappy-compression-rhel8-py3.9-no-c
3113+
tasks:
3114+
- name: .standalone
3115+
display_name: snappy compression RHEL8 py3.9 No C
3116+
run_on:
3117+
- rhel87-small
3118+
expansions:
3119+
COMPRESSORS: snappy
3120+
NO_EXT: "1"
3121+
PYTHON_BINARY: /opt/python/3.9/bin/python3
3122+
- name: snappy-compression-rhel8-py3.9
3123+
tasks:
3124+
- name: .standalone
3125+
display_name: snappy compression RHEL8 py3.9
3126+
run_on:
3127+
- rhel87-small
3128+
expansions:
3129+
COMPRESSORS: snappy
3130+
PYTHON_BINARY: /opt/python/3.9/bin/python3
3131+
- name: snappy-compression-rhel8-py3.13-no-c
3132+
tasks:
3133+
- name: .standalone
3134+
display_name: snappy compression RHEL8 py3.13 No C
3135+
run_on:
3136+
- rhel87-small
3137+
expansions:
3138+
COMPRESSORS: snappy
3139+
NO_EXT: "1"
3140+
PYTHON_BINARY: /opt/python/3.13/bin/python3
3141+
- name: snappy-compression-rhel8-py3.13
3142+
tasks:
3143+
- name: .standalone
3144+
display_name: snappy compression RHEL8 py3.13
3145+
run_on:
3146+
- rhel87-small
3147+
expansions:
3148+
COMPRESSORS: snappy
3149+
PYTHON_BINARY: /opt/python/3.13/bin/python3
3150+
- name: zlib-compression-rhel8-py3.9-no-c
3151+
tasks:
3152+
- name: .standalone
3153+
display_name: zlib compression RHEL8 py3.9 No C
3154+
run_on:
3155+
- rhel87-small
3156+
expansions:
3157+
COMPRESSORS: zlib
3158+
NO_EXT: "1"
3159+
PYTHON_BINARY: /opt/python/3.9/bin/python3
3160+
- name: zlib-compression-rhel8-py3.9
3161+
tasks:
3162+
- name: .standalone
3163+
display_name: zlib compression RHEL8 py3.9
3164+
run_on:
3165+
- rhel87-small
3166+
expansions:
3167+
COMPRESSORS: zlib
3168+
PYTHON_BINARY: /opt/python/3.9/bin/python3
3169+
- name: zlib-compression-rhel8-py3.13-no-c
3170+
tasks:
3171+
- name: .standalone
3172+
display_name: zlib compression RHEL8 py3.13 No C
3173+
run_on:
3174+
- rhel87-small
3175+
expansions:
3176+
COMPRESSORS: zlib
3177+
NO_EXT: "1"
3178+
PYTHON_BINARY: /opt/python/3.13/bin/python3
3179+
- name: zlib-compression-rhel8-py3.13
3180+
tasks:
3181+
- name: .standalone
3182+
display_name: zlib compression RHEL8 py3.13
3183+
run_on:
3184+
- rhel87-small
3185+
expansions:
3186+
COMPRESSORS: zlib
3187+
PYTHON_BINARY: /opt/python/3.13/bin/python3
3188+
- name: zstd-compression-rhel8-py3.9-no-c
3189+
tasks:
3190+
- name: .standalone !.4.0
3191+
display_name: zstd compression RHEL8 py3.9 No C
3192+
run_on:
3193+
- rhel87-small
3194+
expansions:
3195+
COMPRESSORS: zstd
3196+
NO_EXT: "1"
3197+
PYTHON_BINARY: /opt/python/3.9/bin/python3
3198+
- name: zstd-compression-rhel8-py3.9
3199+
tasks:
3200+
- name: .standalone !.4.0
3201+
display_name: zstd compression RHEL8 py3.9
3202+
run_on:
3203+
- rhel87-small
3204+
expansions:
3205+
COMPRESSORS: zstd
3206+
PYTHON_BINARY: /opt/python/3.9/bin/python3
3207+
- name: zstd-compression-rhel8-py3.13-no-c
3208+
tasks:
3209+
- name: .standalone !.4.0
3210+
display_name: zstd compression RHEL8 py3.13 No C
3211+
run_on:
3212+
- rhel87-small
3213+
expansions:
3214+
COMPRESSORS: zstd
3215+
NO_EXT: "1"
3216+
PYTHON_BINARY: /opt/python/3.13/bin/python3
3217+
- name: zstd-compression-rhel8-py3.13
3218+
tasks:
3219+
- name: .standalone !.4.0
3220+
display_name: zstd compression RHEL8 py3.13
3221+
run_on:
3222+
- rhel87-small
3223+
expansions:
3224+
COMPRESSORS: zstd
3225+
PYTHON_BINARY: /opt/python/3.13/bin/python3
3226+
- name: snappy-compression-rhel8-py3.10
3227+
tasks:
3228+
- name: .standalone
3229+
display_name: snappy compression RHEL8 py3.10
3230+
run_on:
3231+
- rhel87-small
3232+
expansions:
3233+
COMPRESSORS: snappy
3234+
PYTHON_BINARY: /opt/python/3.10/bin/python3
3235+
- name: snappy-compression-rhel8-py3.11
3236+
tasks:
3237+
- name: .standalone
3238+
display_name: snappy compression RHEL8 py3.11
3239+
run_on:
3240+
- rhel87-small
3241+
expansions:
3242+
COMPRESSORS: snappy
3243+
PYTHON_BINARY: /opt/python/3.11/bin/python3
3244+
- name: snappy-compression-rhel8-py3.12
3245+
tasks:
3246+
- name: .standalone
3247+
display_name: snappy compression RHEL8 py3.12
3248+
run_on:
3249+
- rhel87-small
3250+
expansions:
3251+
COMPRESSORS: snappy
3252+
PYTHON_BINARY: /opt/python/3.12/bin/python3
3253+
- name: snappy-compression-rhel8-pypy3.9
3254+
tasks:
3255+
- name: .standalone
3256+
display_name: snappy compression RHEL8 pypy3.9
3257+
run_on:
3258+
- rhel87-small
3259+
expansions:
3260+
COMPRESSORS: snappy
3261+
PYTHON_BINARY: /opt/python/pypy3.9/bin/python3
3262+
- name: snappy-compression-rhel8-pypy3.10
3263+
tasks:
3264+
- name: .standalone
3265+
display_name: snappy compression RHEL8 pypy3.10
3266+
run_on:
3267+
- rhel87-small
3268+
expansions:
3269+
COMPRESSORS: snappy
3270+
PYTHON_BINARY: /opt/python/pypy3.10/bin/python3
3271+
- name: zlib-compression-rhel8-py3.10
3272+
tasks:
3273+
- name: .standalone
3274+
display_name: zlib compression RHEL8 py3.10
3275+
run_on:
3276+
- rhel87-small
3277+
expansions:
3278+
COMPRESSORS: zlib
3279+
PYTHON_BINARY: /opt/python/3.10/bin/python3
3280+
- name: zlib-compression-rhel8-py3.11
3281+
tasks:
3282+
- name: .standalone
3283+
display_name: zlib compression RHEL8 py3.11
3284+
run_on:
3285+
- rhel87-small
3286+
expansions:
3287+
COMPRESSORS: zlib
3288+
PYTHON_BINARY: /opt/python/3.11/bin/python3
3289+
- name: zlib-compression-rhel8-py3.12
3290+
tasks:
3291+
- name: .standalone
3292+
display_name: zlib compression RHEL8 py3.12
3293+
run_on:
3294+
- rhel87-small
3295+
expansions:
3296+
COMPRESSORS: zlib
3297+
PYTHON_BINARY: /opt/python/3.12/bin/python3
3298+
- name: zlib-compression-rhel8-pypy3.9
3299+
tasks:
3300+
- name: .standalone
3301+
display_name: zlib compression RHEL8 pypy3.9
3302+
run_on:
3303+
- rhel87-small
3304+
expansions:
3305+
COMPRESSORS: zlib
3306+
PYTHON_BINARY: /opt/python/pypy3.9/bin/python3
3307+
- name: zlib-compression-rhel8-pypy3.10
3308+
tasks:
3309+
- name: .standalone
3310+
display_name: zlib compression RHEL8 pypy3.10
3311+
run_on:
3312+
- rhel87-small
3313+
expansions:
3314+
COMPRESSORS: zlib
3315+
PYTHON_BINARY: /opt/python/pypy3.10/bin/python3
3316+
- name: zstd-compression-rhel8-py3.10
3317+
tasks:
3318+
- name: .standalone !.4.0
3319+
display_name: zstd compression RHEL8 py3.10
3320+
run_on:
3321+
- rhel87-small
3322+
expansions:
3323+
COMPRESSORS: zstd
3324+
PYTHON_BINARY: /opt/python/3.10/bin/python3
3325+
- name: zstd-compression-rhel8-py3.11
3326+
tasks:
3327+
- name: .standalone !.4.0
3328+
display_name: zstd compression RHEL8 py3.11
3329+
run_on:
3330+
- rhel87-small
3331+
expansions:
3332+
COMPRESSORS: zstd
3333+
PYTHON_BINARY: /opt/python/3.11/bin/python3
3334+
- name: zstd-compression-rhel8-py3.12
3335+
tasks:
3336+
- name: .standalone !.4.0
3337+
display_name: zstd compression RHEL8 py3.12
3338+
run_on:
3339+
- rhel87-small
3340+
expansions:
3341+
COMPRESSORS: zstd
3342+
PYTHON_BINARY: /opt/python/3.12/bin/python3
3343+
- name: zstd-compression-rhel8-pypy3.9
3344+
tasks:
3345+
- name: .standalone !.4.0
3346+
display_name: zstd compression RHEL8 pypy3.9
3347+
run_on:
3348+
- rhel87-small
3349+
expansions:
3350+
COMPRESSORS: zstd
3351+
PYTHON_BINARY: /opt/python/pypy3.9/bin/python3
3352+
- name: zstd-compression-rhel8-pypy3.10
3353+
tasks:
3354+
- name: .standalone !.4.0
3355+
display_name: zstd compression RHEL8 pypy3.10
3356+
run_on:
3357+
- rhel87-small
3358+
expansions:
3359+
COMPRESSORS: zstd
3360+
PYTHON_BINARY: /opt/python/pypy3.10/bin/python3
3361+
31283362
- matrix_name: "tests-fips"
31293363
matrix_spec:
31303364
platform:
@@ -3214,38 +3448,6 @@ buildvariants:
32143448
- ".4.2"
32153449
- ".4.0"
32163450

3217-
- matrix_name: "tests-python-version-rhel8-compression"
3218-
matrix_spec:
3219-
platform: rhel8
3220-
python-version: "*"
3221-
c-extensions: "*"
3222-
compression: "*"
3223-
exclude_spec:
3224-
# These interpreters are always tested without extensions.
3225-
- platform: rhel8
3226-
python-version: ["pypy3.9", "pypy3.10"]
3227-
c-extensions: "with-c-extensions"
3228-
compression: "*"
3229-
display_name: "${compression} ${c-extensions} ${python-version} ${platform}"
3230-
tasks:
3231-
- "test-latest-standalone"
3232-
- "test-8.0-standalone"
3233-
- "test-7.0-standalone"
3234-
- "test-6.0-standalone"
3235-
- "test-5.0-standalone"
3236-
- "test-4.4-standalone"
3237-
- "test-4.2-standalone"
3238-
- "test-4.0-standalone"
3239-
rules:
3240-
# Server version 4.0 supports snappy and zlib but not zstd.
3241-
- if:
3242-
python-version: "*"
3243-
c-extensions: "*"
3244-
compression: ["zstd"]
3245-
then:
3246-
remove_tasks:
3247-
- "test-4.0-standalone"
3248-
32493451
- matrix_name: "tests-python-version-green-framework-rhel8"
32503452
matrix_spec:
32513453
platform: rhel8

.evergreen/scripts/generate_config.py

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@
3030
BATCHTIME_WEEK = 10080
3131
AUTH_SSLS = [("auth", "ssl"), ("noauth", "ssl"), ("noauth", "nossl")]
3232
TOPOLOGIES = ["standalone", "replica_set", "sharded_cluster"]
33+
C_EXTS = ["with_ext", "without_ext"]
3334
SYNCS = ["sync", "async"]
3435
DISPLAY_LOOKUP = dict(
3536
ssl=dict(ssl="SSL", nossl="NoSSL"),
3637
auth=dict(auth="Auth", noauth="NoAuth"),
3738
test_suites=dict(default="Sync", default_async="Async"),
3839
coverage=dict(coverage="cov"),
40+
no_ext={"1": "No C"},
3941
)
4042
HOSTS = dict()
4143

@@ -137,6 +139,12 @@ def zip_cycle(*iterables, empty_default=None):
137139
yield tuple(next(i, empty_default) for i in cycles)
138140

139141

142+
def handle_c_ext(c_ext, expansions):
143+
"""Handle c extension option."""
144+
if c_ext == C_EXTS[0]:
145+
expansions["NO_EXT"] = "1"
146+
147+
140148
def generate_yaml(tasks=None, variants=None):
141149
"""Generate the yaml for a given set of tasks and variants."""
142150
project = EvgProject(tasks=tasks, buildvariants=variants)
@@ -337,8 +345,48 @@ def create_load_balancer_variants():
337345
return variants
338346

339347

348+
def create_compression_variants():
349+
# Compression tests - standalone versions of each server, across python versions, with and without c extensions.
350+
# PyPy interpreters are always tested without extensions.
351+
host = "rhel8"
352+
task_names = dict(snappy=[".standalone"], zlib=[".standalone"], zstd=[".standalone !.4.0"])
353+
variants = []
354+
for compressor, python, c_ext in product(["snappy", "zlib", "zstd"], MIN_MAX_PYTHON, C_EXTS):
355+
expansions = dict(COMPRESSORS=compressor)
356+
handle_c_ext(c_ext, expansions)
357+
base_name = f"{compressor} compression"
358+
display_name = get_display_name(base_name, host, python=python, **expansions)
359+
variant = create_variant(
360+
task_names[compressor],
361+
display_name,
362+
python=python,
363+
host=host,
364+
expansions=expansions,
365+
)
366+
variants.append(variant)
367+
368+
other_pythons = [p for p in CPYTHONS if p not in MIN_MAX_PYTHON] + PYPYS
369+
for compressor, python in product(["snappy", "zlib", "zstd"], other_pythons):
370+
expansions = dict(COMPRESSORS=compressor)
371+
handle_c_ext(c_ext, expansions)
372+
base_name = f"{compressor} compression"
373+
display_name = get_display_name(base_name, host, python=python, **expansions)
374+
variant = create_variant(
375+
task_names[compressor],
376+
display_name,
377+
python=python,
378+
host=host,
379+
expansions=expansions,
380+
)
381+
variants.append(variant)
382+
383+
return variants
384+
385+
340386
##################
341387
# Generate Config
342388
##################
343389

344-
generate_yaml(variants=create_load_balancer_variants())
390+
variants = create_compression_variants()
391+
# print(len(variants))
392+
generate_yaml(variants=variants)

0 commit comments

Comments
 (0)