Skip to content

Commit b9ca36f

Browse files
authored
CDRIVER-4645 add mock-server-test variant (#1277)
* remove unused TOPOLOGY * remove `authentication-tests-openssl-static` * remove `debug-compile-asan-openssl-cse` Seems redundant with `asan-cse-sasl-cyrus-openssl-ubuntu1804-clang-compile` * remove `debug-compile-sasl-darwinssl-cse` Seems redundant with `cse-sasl-cyrus-darwinssl-macos-1100-clang-compile`. * remove `debug-compile-sasl-openssl-cse` Seems redundant with `cse-sasl-cyrus-openssl-*` tasks. * remove `debug-compile-sasl-winssl` Seems redundant with `sasl-cyrus-winssl-*` tasks. * remove `debug-compile-sasl-winssl-cse` Seems redundant with `cse-sasl-cyrus-winssl-*` tasks. * add `TestSuite_CheckLive` to `/counters` tests * expect `hello` and OP_MSG for load balanced tests CDRIVER-4193 changes to use OP_MSG and hello for handshake when in loadbalanced * add mock-server-test variant * remove `test-asan-memcheck-mock-server` Replaced by the new `mock-server-test` task. * format test-mongoc-loadbalanced.c * move `match_loadBalanced` declarations up * remove `run mock server tests` from legacy config
1 parent f5c6487 commit b9ca36f

File tree

8 files changed

+106
-169
lines changed

8 files changed

+106
-169
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
from shrub.v3.evg_build_variant import BuildVariant
2+
from shrub.v3.evg_command import EvgCommandType
3+
from shrub.v3.evg_task import EvgTaskRef
4+
5+
from config_generator.components.funcs.fetch_det import FetchDET
6+
from config_generator.components.funcs.run_simple_http_server import RunSimpleHTTPServer
7+
from config_generator.etc.utils import Task
8+
from config_generator.etc.utils import bash_exec
9+
10+
def tasks():
11+
return [
12+
Task(
13+
name="mock-server-test",
14+
run_on="ubuntu2204-small",
15+
commands=[
16+
# Call fetch-det to define PYTHON3_BINARY expansion required for run-simple-http-server.
17+
FetchDET.call(),
18+
RunSimpleHTTPServer.call(),
19+
bash_exec(
20+
command_type=EvgCommandType.TEST,
21+
add_expansions_to_env=True,
22+
working_dir='mongoc',
23+
script='.evergreen/scripts/compile.sh',
24+
),
25+
bash_exec(
26+
command_type=EvgCommandType.TEST,
27+
working_dir='mongoc',
28+
script='.evergreen/scripts/run-mock-server-tests.sh',
29+
)
30+
],
31+
)
32+
]
33+
34+
def variants():
35+
return [
36+
BuildVariant(
37+
name="mock-server-test",
38+
display_name="Mock Server Test",
39+
tasks=[EvgTaskRef(name='mock-server-test')],
40+
expansions={
41+
'CC': 'gcc',
42+
'ASAN': 'on',
43+
'CFLAGS': '-fno-omit-frame-pointer',
44+
'EXTRA_CONFIGURE_FLAGS': '-DENABLE_EXTRA_ALIGNMENT=OFF',
45+
'SANITIZE': 'address,undefined',
46+
}
47+
),
48+
]

.evergreen/generated_configs/legacy-config.yml

Lines changed: 0 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,6 @@ functions:
8181
script: |-
8282
set -o errexit
8383
bash .evergreen/scripts/run-auth-tests.sh
84-
run mock server tests:
85-
- command: shell.exec
86-
type: test
87-
params:
88-
working_dir: mongoc
89-
add_expansions_to_env: true
90-
shell: bash
91-
script: |-
92-
set -o errexit
93-
bash .evergreen/scripts/run-mock-server-tests.sh
9484
link sample program:
9585
- command: shell.exec
9686
type: test
@@ -640,22 +630,6 @@ tasks:
640630
set -o errexit
641631
env DEBUG="ON" SASL="AUTO" SSL="DARWIN" bash .evergreen/scripts/compile.sh
642632
- func: upload-build
643-
- name: debug-compile-sasl-winssl
644-
tags:
645-
- debug-compile
646-
- sasl
647-
- winssl
648-
commands:
649-
- command: shell.exec
650-
type: test
651-
params:
652-
working_dir: mongoc
653-
add_expansions_to_env: true
654-
shell: bash
655-
script: |-
656-
set -o errexit
657-
env DEBUG="ON" SASL="CYRUS" SSL="WINDOWS" bash .evergreen/scripts/compile.sh
658-
- func: upload-build
659633
- name: debug-compile-sspi-nossl
660634
tags:
661635
- debug-compile
@@ -1036,24 +1010,6 @@ tasks:
10361010
set -o errexit
10371011
env CFLAGS="-Werror -Wno-cast-align" DEBUG="ON" bash .evergreen/scripts/compile.sh
10381012
- func: upload-build
1039-
- name: debug-compile-sasl-openssl-cse
1040-
tags:
1041-
- client-side-encryption
1042-
- debug-compile
1043-
- openssl
1044-
- sasl
1045-
- special
1046-
commands:
1047-
- command: shell.exec
1048-
type: test
1049-
params:
1050-
working_dir: mongoc
1051-
add_expansions_to_env: true
1052-
shell: bash
1053-
script: |-
1054-
set -o errexit
1055-
env COMPILE_LIBMONGOCRYPT="ON" DEBUG="ON" EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON" SASL="AUTO" SSL="OPENSSL" bash .evergreen/scripts/compile.sh
1056-
- func: upload-build
10571013
- name: debug-compile-sasl-openssl-static-cse
10581014
tags:
10591015
- client-side-encryption
@@ -1072,58 +1028,6 @@ tasks:
10721028
set -o errexit
10731029
env COMPILE_LIBMONGOCRYPT="ON" DEBUG="ON" EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON" SASL="AUTO" SSL="OPENSSL_STATIC" bash .evergreen/scripts/compile.sh
10741030
- func: upload-build
1075-
- name: debug-compile-sasl-darwinssl-cse
1076-
tags:
1077-
- client-side-encryption
1078-
- darwinssl
1079-
- debug-compile
1080-
- sasl
1081-
- special
1082-
commands:
1083-
- command: shell.exec
1084-
type: test
1085-
params:
1086-
working_dir: mongoc
1087-
add_expansions_to_env: true
1088-
shell: bash
1089-
script: |-
1090-
set -o errexit
1091-
env COMPILE_LIBMONGOCRYPT="ON" DEBUG="ON" EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON" SASL="AUTO" SSL="DARWIN" bash .evergreen/scripts/compile.sh
1092-
- func: upload-build
1093-
- name: debug-compile-sasl-winssl-cse
1094-
tags:
1095-
- client-side-encryption
1096-
- debug-compile
1097-
- sasl
1098-
- special
1099-
- winssl
1100-
commands:
1101-
- command: shell.exec
1102-
type: test
1103-
params:
1104-
working_dir: mongoc
1105-
add_expansions_to_env: true
1106-
shell: bash
1107-
script: |-
1108-
set -o errexit
1109-
env COMPILE_LIBMONGOCRYPT="ON" DEBUG="ON" EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON" SASL="AUTO" SSL="WINDOWS" bash .evergreen/scripts/compile.sh
1110-
- func: upload-build
1111-
- name: debug-compile-asan-openssl-cse
1112-
tags:
1113-
- asan-clang
1114-
- client-side-encryption
1115-
- debug-compile
1116-
commands:
1117-
- command: shell.exec
1118-
type: test
1119-
params:
1120-
working_dir: mongoc
1121-
add_expansions_to_env: true
1122-
shell: bash
1123-
script: |-
1124-
set -o errexit
1125-
env CFLAGS="-fno-omit-frame-pointer" CHECK_LOG="ON" COMPILE_LIBMONGOCRYPT="ON" DEBUG="ON" EXTRA_CONFIGURE_FLAGS="-DENABLE_EXTRA_ALIGNMENT=OFF" PATH="/usr/lib/llvm-3.8/bin:$PATH" SANITIZE="address" SSL="OPENSSL" bash .evergreen/scripts/compile.sh
1126-
- func: upload-build
11271031
- name: debug-compile-nosasl-openssl-1.0.1
11281032
commands:
11291033
- func: install ssl
@@ -1485,19 +1389,6 @@ tasks:
14851389
BUILD_NAME: debug-compile-sasl-openssl
14861390
- func: prepare-kerberos
14871391
- func: run auth tests
1488-
- name: authentication-tests-openssl-static
1489-
tags:
1490-
- authentication-tests
1491-
- openssl-static
1492-
- sasl
1493-
depends_on:
1494-
name: debug-compile-sasl-openssl-static
1495-
commands:
1496-
- func: fetch-build
1497-
vars:
1498-
BUILD_NAME: debug-compile-sasl-openssl-static
1499-
- func: prepare-kerberos
1500-
- func: run auth tests
15011392
- name: authentication-tests-darwinssl
15021393
tags:
15031394
- authentication-tests
@@ -1537,19 +1428,6 @@ tasks:
15371428
BUILD_NAME: debug-compile-nosasl-openssl
15381429
- func: prepare-kerberos
15391430
- func: run auth tests
1540-
- name: test-asan-memcheck-mock-server
1541-
tags:
1542-
- test-asan
1543-
depends_on:
1544-
name: debug-compile-asan-clang
1545-
commands:
1546-
- func: fetch-build
1547-
vars:
1548-
BUILD_NAME: debug-compile-asan-clang
1549-
- func: run mock server tests
1550-
vars:
1551-
ASAN: 'on'
1552-
SSL: ssl
15531431
- name: test-mongohouse
15541432
depends_on:
15551433
name: debug-compile-sasl-openssl

.evergreen/generated_configs/tasks.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,6 +1743,28 @@ tasks:
17431743
- func: upload-man-pages
17441744
- func: upload-build
17451745
- func: upload-release
1746+
- name: mock-server-test
1747+
run_on: ubuntu2204-small
1748+
commands:
1749+
- func: fetch-det
1750+
- func: run-simple-http-server
1751+
- command: subprocess.exec
1752+
type: test
1753+
params:
1754+
binary: bash
1755+
working_dir: mongoc
1756+
add_expansions_to_env: true
1757+
args:
1758+
- -c
1759+
- .evergreen/scripts/compile.sh
1760+
- command: subprocess.exec
1761+
type: test
1762+
params:
1763+
binary: bash
1764+
working_dir: mongoc
1765+
args:
1766+
- -c
1767+
- .evergreen/scripts/run-mock-server-tests.sh
17461768
- name: openssl-static-compile-debian10-gcc
17471769
run_on: debian10-large
17481770
tags: [openssl-static-matrix, debian10, gcc]

.evergreen/generated_configs/variants.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ buildvariants:
2020
DEBUG: "ON"
2121
tasks:
2222
- name: .cse-matrix-winssl
23+
- name: mock-server-test
24+
display_name: Mock Server Test
25+
expansions:
26+
ASAN: "on"
27+
CC: gcc
28+
CFLAGS: -fno-omit-frame-pointer
29+
EXTRA_CONFIGURE_FLAGS: -DENABLE_EXTRA_ALIGNMENT=OFF
30+
SANITIZE: address,undefined
31+
tasks:
32+
- name: mock-server-test
2333
- name: openssl-static-matrix
2434
display_name: openssl-static-matrix
2535
tasks:

.evergreen/legacy_config_generator/evergreen_config_lib/functions.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@
6262
bash .evergreen/scripts/run-auth-tests.sh
6363
''', add_expansions_to_env=True),
6464
)),
65-
('run mock server tests', Function(
66-
shell_mongoc(r'''
67-
bash .evergreen/scripts/run-mock-server-tests.sh
68-
''', add_expansions_to_env=True),
69-
)),
7065
('link sample program', Function(
7166
shell_mongoc(r'''
7267
# Compile a program that links dynamically or statically to libmongoc,

.evergreen/legacy_config_generator/evergreen_config_lib/tasks.py

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ def __init__(
9696
self.compile_sh_opt["ENABLE_RDTSCP"] = ENABLE_RDTSCP
9797
if SRV:
9898
self.compile_sh_opt["SRV"] = SRV
99-
if TOPOLOGY:
100-
self.compile_sh_opt["TOPOLOGY"] = TOPOLOGY
10199

102100
if compression != "default":
103101
self.compile_sh_opt["SNAPPY"] = "ON" if compression in ("all", "snappy") else "OFF"
@@ -238,13 +236,6 @@ def __init__(
238236
SSL="OPENSSL_STATIC",
239237
),
240238
CompileTask("debug-compile-sasl-darwinssl", tags=["debug-compile", "sasl", "darwinssl"], SASL="AUTO", SSL="DARWIN"),
241-
CompileTask(
242-
"debug-compile-sasl-winssl",
243-
tags=["debug-compile", "sasl", "winssl"],
244-
# Explicitly use CYRUS.
245-
SASL="CYRUS",
246-
SSL="WINDOWS",
247-
),
248239
CompileTask("debug-compile-sspi-nossl", tags=["debug-compile", "sspi", "nossl"], SASL="SSPI", SSL="OFF"),
249240
CompileTask("debug-compile-sspi-openssl", tags=["debug-compile", "sspi", "openssl"], SASL="SSPI", SSL="OPENSSL"),
250241
CompileTask(
@@ -380,24 +371,12 @@ def __init__(
380371
],
381372
),
382373
CompileTask("debug-compile-with-warnings", CFLAGS="-Werror -Wno-cast-align"),
383-
CompileWithClientSideEncryption(
384-
"debug-compile-sasl-openssl-cse", tags=["debug-compile", "sasl", "openssl"], SASL="AUTO", SSL="OPENSSL"
385-
),
386374
CompileWithClientSideEncryption(
387375
"debug-compile-sasl-openssl-static-cse",
388376
tags=["debug-compile", "sasl", "openssl-static"],
389377
SASL="AUTO",
390378
SSL="OPENSSL_STATIC",
391379
),
392-
CompileWithClientSideEncryption(
393-
"debug-compile-sasl-darwinssl-cse", tags=["debug-compile", "sasl", "darwinssl"], SASL="AUTO", SSL="DARWIN"
394-
),
395-
CompileWithClientSideEncryption(
396-
"debug-compile-sasl-winssl-cse", tags=["debug-compile", "sasl", "winssl"], SASL="AUTO", SSL="WINDOWS"
397-
),
398-
CompileWithClientSideEncryptionAsan(
399-
"debug-compile-asan-openssl-cse", tags=["debug-compile", "asan-clang"], SSL="OPENSSL", sanitize=["address"]
400-
),
401380
CompileTask(
402381
"debug-compile-nosasl-openssl-1.0.1",
403382
prefix_commands=[func("install ssl", SSL="openssl-1.0.1u")],
@@ -675,7 +654,7 @@ def pre_commands(self) -> Iterable[Value]:
675654

676655

677656
class AuthTask(MatrixTask):
678-
axes = OD([("sasl", ["sasl", "sspi", False]), ("ssl", ["openssl", "openssl-static", "darwinssl", "winssl"])])
657+
axes = OD([("sasl", ["sasl", "sspi", False]), ("ssl", ["openssl", "darwinssl", "winssl"])])
679658

680659
name_prefix = "authentication-tests"
681660

@@ -725,12 +704,6 @@ def pre_commands(self) -> Iterable[Value]:
725704
all_tasks = chain(
726705
all_tasks,
727706
[
728-
PostCompileTask(
729-
"test-asan-memcheck-mock-server",
730-
tags=["test-asan"],
731-
get_build="debug-compile-asan-clang",
732-
commands=[func("run mock server tests", ASAN="on", SSL="ssl")],
733-
),
734707
PostCompileTask(
735708
"test-mongohouse",
736709
tags=[],

src/libmongoc/tests/test-mongoc-counters.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,13 +1555,15 @@ test_counters_install (TestSuite *suite)
15551555
test_counters_op_msg,
15561556
NULL,
15571557
NULL,
1558-
test_framework_skip_if_compressors);
1558+
test_framework_skip_if_compressors,
1559+
TestSuite_CheckLive);
15591560
TestSuite_AddFull (suite,
15601561
"/counters/op_compressed",
15611562
test_counters_op_compressed,
15621563
NULL,
15631564
NULL,
1564-
test_framework_skip_if_no_compressors);
1565+
test_framework_skip_if_no_compressors,
1566+
TestSuite_CheckLive);
15651567
TestSuite_AddLive (suite, "/counters/cursors", test_counters_cursors);
15661568
TestSuite_AddLive (suite, "/counters/clients", test_counters_clients);
15671569
TestSuite_AddFull (suite,

0 commit comments

Comments
 (0)