Skip to content

Commit ba07979

Browse files
authored
CDRIVER-3620 Add SASL, CSE, and Sanitizers matrices (#1201)
* Remove unused __hash__ from Distro class * Relocate DarwinSSL SASL tests to config_generator * Relocate WinSSL SASL tests to config_generator * Relocate Static OpenSSL SASL tests to config_generator * Relocate OpenSSL SASL tests to config_generator * Relocate NoSSL SASL tests to config_generator * Relocate DarwinSSL CSE tests to config_generator * Relocate WinSSL CSE tests to config_generator * Relocate Static OpenSSL CSE tests to config_generator * Relocate OpenSSL CSE tests to config_generator * Relocate ASAN tests to config_generator * Relocate TSAN tests to config_generator * Remove UBSAN tasks in favor of ASAN+UBSAN * Clean up IntegrationTask -> CoverageTask * Relocate C11 compatibility tests to config_generator * Merge macos-1100-arm64 compile task into sasl.darwinssl * Remove compile tasks without dependent test task * Also ensure EXTRA_CONFIGURE_FLAGS are being used when compiling on Windows * Remove unused SSPI compile functions * Fix missing handling of MARCH variable in compile-unix.sh * Move Static OpenSSL compile coverage into seperate component * Update cse.openssl.TEST_MATRIX as suggested * Update cse.winssl.TEST_MATRIX as suggested * Update cse.darwinssl.TEST_MATRIX as suggested * Update sasl.nossl.TEST_MATRIX as suggested * Remove noauth from test matrices * Update sasl.openssl.TEST_MATRIX as suggested * Update sasl.winssl.TEST_MATRIX as suggested * Update std.std_c11.COMPILE_MATRIX as suggested * Add C17 compile coverage * Silence file exists warning in upload-test-results * Limit tests executed to /client_side_encryption for CSE tasks * Remove 4.2 and 4.4 tests on rhel83-zseries * CDRIVER-4347 Remove skipped tests due to OCSP verification failure * Revenge of scan-build warnings of tmp->tm_mon * Explicitly forbid SASL for SaslOff tasks for compile-unix.sh vs. compile-windows.sh consistency * Move cse.darwinssl tasks from macos-1014 to macos-1015 * Rename EvgTaskWithRunOn to Task and add field disable * Disable cse.darwinssl tasks
1 parent 6a7692a commit ba07979

35 files changed

+5660
-13410
lines changed
+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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.etc.distros import find_large_distro
6+
from config_generator.etc.distros import make_distro_str
7+
from config_generator.etc.distros import to_cc
8+
from config_generator.etc.function import Function
9+
from config_generator.etc.utils import bash_exec
10+
from config_generator.etc.utils import Task
11+
12+
13+
TAG = 'std-matrix'
14+
15+
16+
# pylint: disable=line-too-long
17+
# fmt: off
18+
MATRIX = [
19+
('archlinux', 'clang', None, [11, ]),
20+
('debian81', 'clang', None, [11, ]),
21+
('debian92', 'clang', None, [11, ]),
22+
('ubuntu1604', 'clang', 'i686', [11, ]),
23+
('ubuntu1604', 'clang', None, [11, ]),
24+
('ubuntu1804', 'clang', 'i686', [11, ]),
25+
('ubuntu1804', 'gcc', None, [11, ]),
26+
('debian10', 'clang', None, [11, ]),
27+
('debian10', 'gcc', None, [11, 17]),
28+
('debian11', 'clang', None, [11, ]),
29+
('debian11', 'gcc', None, [11, 17]),
30+
('ubuntu2004', 'clang', None, [11, ]),
31+
('ubuntu2004', 'gcc', None, [11, ]),
32+
]
33+
# fmt: on
34+
# pylint: enable=line-too-long
35+
36+
37+
class StdCompile(Function):
38+
name = 'std-compile'
39+
commands = [
40+
bash_exec(
41+
command_type=EvgCommandType.TEST,
42+
add_expansions_to_env=True,
43+
working_dir='mongoc',
44+
script='.evergreen/scripts/compile-std.sh',
45+
),
46+
]
47+
48+
@classmethod
49+
def call(cls, **kwargs):
50+
return cls.default_call(**kwargs)
51+
52+
53+
def functions():
54+
return StdCompile.defn()
55+
56+
57+
def tasks():
58+
res = []
59+
60+
for distro_name, compiler, arch, stds in MATRIX:
61+
tags = [TAG, distro_name, compiler, 'compile']
62+
63+
distro = find_large_distro(distro_name)
64+
65+
compile_vars = None
66+
compile_vars = {'CC': to_cc(compiler)}
67+
68+
if arch:
69+
tags.append(arch)
70+
compile_vars.update({'MARCH': arch})
71+
72+
distro_str = make_distro_str(distro_name, compiler, arch)
73+
74+
for std in stds:
75+
with_std = {}
76+
77+
if std >= 17:
78+
# CMake 3.21 or newer is required to use CMAKE_C_STANDARD to
79+
# specify C17 or newer.
80+
with_std = {'CFLAGS': f'-std=c{std}'}
81+
else:
82+
with_std = {'C_STD_VERSION': std}
83+
84+
task_name = f'std-c{std}-{distro_str}-compile'
85+
86+
res.append(
87+
Task(
88+
name=task_name,
89+
run_on=distro.name,
90+
tags=tags + [f'std-c{std}'],
91+
commands=[StdCompile.call(vars=compile_vars | with_std)],
92+
)
93+
)
94+
95+
return res
96+
97+
98+
def variants():
99+
return [
100+
BuildVariant(
101+
name=TAG,
102+
display_name=TAG,
103+
tasks=[EvgTaskRef(name=f'.{TAG}')],
104+
),
105+
]
+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
from shrub.v3.evg_build_variant import BuildVariant
2+
from shrub.v3.evg_task import EvgTaskRef
3+
4+
from config_generator.etc.compile import generate_compile_tasks
5+
6+
from config_generator.etc.cse.compile import CompileCommon
7+
from config_generator.etc.cse.test import generate_test_tasks
8+
9+
10+
SSL = 'darwinssl'
11+
TAG = f'cse-matrix-{SSL}'
12+
13+
14+
# pylint: disable=line-too-long
15+
# fmt: off
16+
COMPILE_MATRIX = [
17+
('macos-1015', 'clang', None, ['cyrus']),
18+
]
19+
20+
# TODO (CDRIVER-3789): test cse with the 'sharded' topology.
21+
TEST_MATRIX = [
22+
('macos-1015', 'clang', None, 'cyrus', ['auth'], ['server', 'replica' ], ['4.2', '4.4', '5.0']),
23+
24+
# Test 6.0+ with a replica set since Queryable Encryption does not support the 'server' topology.
25+
('macos-1015', 'clang', None, 'cyrus', ['auth'], ['server', 'replica' ], ['6.0', 'latest']),
26+
]
27+
# fmt: on
28+
# pylint: enable=line-too-long
29+
30+
31+
class DarwinSSLCompileCommon(CompileCommon):
32+
ssl = 'DARWIN'
33+
34+
35+
class SaslCyrusDarwinSSLCompile(DarwinSSLCompileCommon):
36+
name = 'cse-sasl-cyrus-darwinssl-compile'
37+
commands = DarwinSSLCompileCommon.compile_commands(sasl='CYRUS')
38+
39+
40+
def functions():
41+
return SaslCyrusDarwinSSLCompile.defn()
42+
43+
44+
def tasks():
45+
res = []
46+
47+
SASL_TO_FUNC = {
48+
'cyrus': SaslCyrusDarwinSSLCompile,
49+
}
50+
51+
MORE_TAGS = ['cse']
52+
53+
res += generate_compile_tasks(
54+
SSL, TAG, SASL_TO_FUNC, COMPILE_MATRIX, MORE_TAGS
55+
)
56+
57+
res += generate_test_tasks(SSL, TAG, TEST_MATRIX)
58+
59+
# TODO: remove once MONGOCRYPT-443 is resolved.
60+
for task in res:
61+
task.disable = True
62+
63+
return res
64+
65+
66+
def variants():
67+
expansions = {
68+
'CLIENT_SIDE_ENCRYPTION': 'on',
69+
'DEBUG': 'ON',
70+
}
71+
72+
return [
73+
BuildVariant(
74+
name=TAG,
75+
display_name=TAG,
76+
tasks=[EvgTaskRef(name=f'.{TAG}')],
77+
expansions=expansions,
78+
),
79+
]
+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
from shrub.v3.evg_build_variant import BuildVariant
2+
from shrub.v3.evg_task import EvgTaskRef
3+
4+
from config_generator.etc.compile import generate_compile_tasks
5+
from config_generator.etc.function import merge_defns
6+
7+
from config_generator.etc.cse.compile import CompileCommon
8+
from config_generator.etc.cse.test import generate_test_tasks
9+
10+
11+
SSL = 'openssl'
12+
TAG = f'cse-matrix-{SSL}'
13+
14+
15+
# pylint: disable=line-too-long
16+
# fmt: off
17+
COMPILE_MATRIX = [
18+
('debian10', 'gcc', None, ['cyrus']),
19+
('debian11', 'gcc', None, ['cyrus']),
20+
('debian92', 'clang', None, ['cyrus']),
21+
('debian92', 'gcc', None, ['cyrus']),
22+
('rhel80', 'gcc', None, ['cyrus']),
23+
('rhel83-zseries', 'gcc', None, ['cyrus']),
24+
('ubuntu1604', 'clang', None, ['cyrus']),
25+
('ubuntu1804-arm64', 'gcc', None, ['cyrus']),
26+
('ubuntu1804', 'gcc', None, ['cyrus']),
27+
('ubuntu2004', 'gcc', None, ['cyrus']),
28+
('windows-64-vs2017', 'vs2017x64', None, ['cyrus']),
29+
]
30+
31+
# TODO (CDRIVER-3789): test cse with the 'sharded' topology.
32+
TEST_MATRIX = [
33+
# 4.2 and 4.4 not available on rhel83-zseries.
34+
('rhel83-zseries', 'gcc', None, 'cyrus', ['auth'], ['server'], ['5.0']),
35+
36+
('ubuntu1804-arm64', 'gcc', None, 'cyrus', ['auth'], ['server'], ['4.2', '4.4', '5.0']),
37+
('ubuntu1804', 'gcc', None, 'cyrus', ['auth'], ['server'], ['4.2', '4.4', '5.0']),
38+
('windows-64-vs2017', 'vs2017x64', None, 'cyrus', ['auth'], ['server'], ['4.2', '4.4', '5.0']),
39+
40+
# Test 6.0+ with a replica set since Queryable Encryption does not support the 'server' topology.
41+
('ubuntu1804', 'gcc', None, 'cyrus', ['auth'], ['server', 'replica'], ['6.0', 'latest']),
42+
('rhel83-zseries', 'gcc', None, 'cyrus', ['auth'], ['server', 'replica'], ['6.0', 'latest']),
43+
('ubuntu1804-arm64', 'gcc', None, 'cyrus', ['auth'], ['server', 'replica'], ['6.0', 'latest']),
44+
('windows-64-vs2017', 'vs2017x64', None, 'cyrus', ['auth'], ['server', 'replica'], ['6.0', 'latest']),
45+
]
46+
# fmt: on
47+
# pylint: enable=line-too-long
48+
49+
50+
class OpenSSLCompileCommon(CompileCommon):
51+
ssl = 'OPENSSL'
52+
53+
54+
class SaslCyrusOpenSSLCompile(OpenSSLCompileCommon):
55+
name = 'cse-sasl-cyrus-openssl-compile'
56+
commands = OpenSSLCompileCommon.compile_commands(sasl='CYRUS')
57+
58+
59+
def functions():
60+
return merge_defns(
61+
SaslCyrusOpenSSLCompile.defn(),
62+
)
63+
64+
65+
def tasks():
66+
res = []
67+
68+
SASL_TO_FUNC = {
69+
'cyrus': SaslCyrusOpenSSLCompile,
70+
}
71+
72+
MORE_TAGS = ['cse']
73+
74+
res += generate_compile_tasks(
75+
SSL, TAG, SASL_TO_FUNC, COMPILE_MATRIX, MORE_TAGS
76+
)
77+
78+
res += generate_test_tasks(SSL, TAG, TEST_MATRIX)
79+
80+
return res
81+
82+
83+
def variants():
84+
expansions = {
85+
'CLIENT_SIDE_ENCRYPTION': 'on',
86+
'DEBUG': 'ON',
87+
}
88+
89+
return [
90+
BuildVariant(
91+
name=TAG,
92+
display_name=TAG,
93+
tasks=[EvgTaskRef(name=f'.{TAG}')],
94+
expansions=expansions,
95+
),
96+
]

Diff for: .evergreen/config_generator/components/cse/winssl.py

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
from shrub.v3.evg_build_variant import BuildVariant
2+
from shrub.v3.evg_task import EvgTaskRef
3+
4+
from config_generator.etc.compile import generate_compile_tasks
5+
6+
from config_generator.etc.cse.compile import CompileCommon
7+
from config_generator.etc.cse.test import generate_test_tasks
8+
9+
10+
SSL = 'winssl'
11+
TAG = f'cse-matrix-{SSL}'
12+
13+
14+
# pylint: disable=line-too-long
15+
# fmt: off
16+
COMPILE_MATRIX = [
17+
('windows-64-vs2015', 'vs2015x64', None, ['cyrus']),
18+
('windows-64-vs2017', 'vs2017x64', None, ['cyrus']),
19+
]
20+
21+
# TODO (CDRIVER-3789): test cse with the 'sharded' topology.
22+
TEST_MATRIX = [
23+
('windows-64-vs2017', 'vs2017x64', None, 'cyrus', ['auth'], ['server'], ['4.2', '4.4', '5.0']),
24+
25+
# Test 6.0+ with a replica set since Queryable Encryption does not support the 'server' topology.
26+
('windows-64-vs2017', 'vs2017x64', None, 'cyrus', ['auth'], ['server', 'replica' ], ['6.0', 'latest']),
27+
]
28+
# fmt: on
29+
# pylint: enable=line-too-long
30+
31+
32+
class WinSSLCompileCommon(CompileCommon):
33+
ssl = 'WINDOWS'
34+
35+
36+
class SaslCyrusWinSSLCompile(WinSSLCompileCommon):
37+
name = 'cse-sasl-cyrus-winssl-compile'
38+
commands = WinSSLCompileCommon.compile_commands(sasl='CYRUS')
39+
40+
41+
def functions():
42+
return SaslCyrusWinSSLCompile.defn()
43+
44+
45+
def tasks():
46+
res = []
47+
48+
SASL_TO_FUNC = {
49+
'cyrus': SaslCyrusWinSSLCompile,
50+
}
51+
52+
MORE_TAGS = ['cse']
53+
54+
res += generate_compile_tasks(
55+
SSL, TAG, SASL_TO_FUNC, COMPILE_MATRIX, MORE_TAGS
56+
)
57+
58+
res += generate_test_tasks(SSL, TAG, TEST_MATRIX)
59+
60+
return res
61+
62+
63+
def variants():
64+
expansions = {
65+
'CLIENT_SIDE_ENCRYPTION': 'on',
66+
'DEBUG': 'ON',
67+
}
68+
69+
return [
70+
BuildVariant(
71+
name=TAG,
72+
display_name=TAG,
73+
tasks=[EvgTaskRef(name=f'.{TAG}')],
74+
expansions=expansions,
75+
),
76+
]

Diff for: .evergreen/config_generator/components/funcs/upload_test_results.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class UploadTestResults(Function):
1010
# Ensure attach_results does not fail even if no tests results exist.
1111
bash_exec(
1212
script='''\
13-
mkdir mongoc
13+
mkdir -p mongoc
1414
touch mongoc/test-results.json
1515
'''
1616
),

0 commit comments

Comments
 (0)