forked from memgraph/mage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_e2e
executable file
·39 lines (29 loc) · 978 Bytes
/
test_e2e
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
#!/usr/bin/env python3
import os
import subprocess
import argparse
WORK_DIRECTORY = os.getcwd()
E2E_DIRECTORY = f"{WORK_DIRECTORY}/e2e"
def parse_arguments():
parser = argparse.ArgumentParser(
description="Test MAGE E2E, make sure to have your Memgraph instance ready."
)
parser.add_argument(
"-k", help="Add filter to tests you want to run", type=str, required=False
)
args = parser.parse_args()
return args
#################################################
# End to end tests #
#################################################
def main(test_filter: str = None):
os.environ["PYTHONPATH"] = E2E_DIRECTORY
os.chdir(E2E_DIRECTORY)
command = ["python3", "-m", "pytest", ".", "-vv"]
if test_filter:
command.extend(["-k", test_filter])
subprocess.run(command)
if __name__ == "__main__":
args = parse_arguments()
test_filter = args.k
main(test_filter=test_filter)