-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathrun_all_tests.py
63 lines (50 loc) · 2.33 KB
/
run_all_tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env python3
"""
This script is a hacky workaround the fact that figuring out the right CTest
incantation for a multi-configuration build (i.e. a VS Studio build) is tricky
and calling `cd build; ctest -C Release` was causing a
1/2 Test #1: test_line_sender .................***Not Run 0.00 sec
Start 2: system_test
error.
The CI only ever builds one config, so instead it's perfectly fine to just
look for the `test_line_sender` binary and run it.
"""
import sys
sys.dont_write_bytecode = True
import pathlib
import platform
import subprocess
def run_cmd(*args, cwd=None):
sys.stderr.write(f'About to run: {args!r}:\n')
try:
subprocess.check_call(args, cwd=cwd)
sys.stderr.write(f'Success running: {args!r}.\n')
except subprocess.CalledProcessError as cpe:
sys.stderr.write(f'Command {args!r} failed with return code {cpe.returncode}.\n')
sys.exit(cpe.returncode)
def main():
build_dir = pathlib.Path('build')
exe_suffix = '.exe' if platform.system() == 'Windows' else ''
test_line_sender_path = next(iter(
build_dir.glob(f'**/test_line_sender{exe_suffix}')))
build_cxx20_dir = pathlib.Path('build_CXX20')
test_line_sender_path_CXX20 = next(iter(
build_cxx20_dir.glob(f'**/test_line_sender{exe_suffix}')))
system_test_path = pathlib.Path('system_test') / 'test.py'
#qdb_v = '8.2.3' # The version of QuestDB we'll test against.
run_cmd('cargo', 'test',
'--', '--nocapture', cwd='questdb-rs')
run_cmd('cargo', 'test', '--no-default-features', '--features=aws-lc-crypto,tls-native-certs',
'--', '--nocapture', cwd='questdb-rs')
run_cmd('cargo', 'test', '--no-default-features', '--features=ring-crypto,tls-native-certs,ilp-over-http',
'--', '--nocapture', cwd='questdb-rs')
run_cmd('cargo', 'test', '--features=almost-all-features',
'--', '--nocapture', cwd='questdb-rs')
run_cmd('cargo', 'test', '--features=almost-all-features,protocol-version-1',
'--', '--nocapture', cwd='questdb-rs')
run_cmd(str(test_line_sender_path))
run_cmd(str(test_line_sender_path_CXX20))
#run_cmd('python3', str(system_test_path), 'run', '--versions', qdb_v, '-v')
run_cmd('python3', str(system_test_path), 'run', '--repo', './questdb_nd_arr', '-v')
if __name__ == '__main__':
main()