2020-02-03 23:05:45 +01:00
|
|
|
#!/usr/bin/env python3
|
2017-07-24 22:38:48 +01:00
|
|
|
|
2019-11-12 23:51:27 +00:00
|
|
|
import os
|
|
|
|
|
import subprocess
|
|
|
|
|
import sys
|
2020-06-18 02:00:30 +02:00
|
|
|
from pathlib import Path
|
2017-03-20 23:54:29 +00:00
|
|
|
|
2021-05-03 11:45:43 -04:00
|
|
|
if __name__ == "__main__":
|
2017-09-06 15:07:58 +02:00
|
|
|
# move cwd to the project root
|
2020-06-18 02:00:30 +02:00
|
|
|
os.chdir(Path(__file__).resolve().parents[1])
|
2017-09-01 13:32:34 +01:00
|
|
|
|
2019-11-12 23:51:27 +00:00
|
|
|
# run the unit tests
|
2021-05-03 11:45:43 -04:00
|
|
|
unit_test_args = [sys.executable, "-m", "pytest", "unit_test"]
|
2020-06-28 10:53:03 +01:00
|
|
|
# run the docker unit tests only on Linux
|
2021-05-03 11:45:43 -04:00
|
|
|
if sys.platform.startswith("linux"):
|
|
|
|
|
unit_test_args += ["--run-docker"]
|
2021-02-14 12:56:33 -05:00
|
|
|
subprocess.run(unit_test_args, check=True)
|
2017-09-01 13:32:34 +01:00
|
|
|
|
2019-11-12 23:51:27 +00:00
|
|
|
# run the integration tests
|
2021-04-30 17:56:34 -04:00
|
|
|
subprocess.run(
|
2021-09-20 12:32:05 +02:00
|
|
|
[
|
|
|
|
|
sys.executable,
|
|
|
|
|
"-m",
|
|
|
|
|
"pytest",
|
2022-01-08 11:30:48 +01:00
|
|
|
"--numprocesses=2",
|
2021-09-20 12:32:05 +02:00
|
|
|
"-x",
|
|
|
|
|
"--durations",
|
|
|
|
|
"0",
|
|
|
|
|
"--timeout=2400",
|
|
|
|
|
"test",
|
|
|
|
|
],
|
2021-04-30 17:56:34 -04:00
|
|
|
check=True,
|
|
|
|
|
)
|