This repository has been archived by the owner on Oct 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.py
78 lines (62 loc) · 2.21 KB
/
start.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
'''Starter of the Test'''
import argparse
import sys
from pytest import Session
import pytest
import config.config
# import conftest
from tests.test_google import *
from utils.enums import ExecutionType
def ParseArguments():
'''
Parses the program arguments
Returns
-------
args
'''
parser = argparse.ArgumentParser(
description='Collect data from repositories and put it in a spreadsheet',
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)
parser.add_argument('-5', '--only5',
help='Execute the test with only step 5',
required=False,
action='store_true')
parser.add_argument('-6', '--only6',
help='Execute the test with only step 6',
required=False,
action='store_true')
parser.add_argument('-v', '--skip_verification',
help='Execute the test without step 4',
required=False,
action='store_true')
parser.add_argument('-f', '--full',
help='Execute the test with only step 5',
required=False,
action='store_true')
args = parser.parse_args()
return args
if __name__ == '__main__':
'''
The main executor
'''
args = ParseArguments()
if args.only5:
config.config.Config.Selected_Option = ExecutionType.ONLY5
print(f'Test execution with only step 5 verification selected!')
elif args.only6:
config.config.Config.Selected_Option = ExecutionType.ONLY6
print(f'Test execution with only step 6 verification selected!')
elif args.skip_verification:
config.config.Config.Selected_Option = ExecutionType.NO_VERIFICATION
print(f'Test execution with only step 6 verification selected!')
else:
config.config.Config.Selected_Option = ExecutionType.FULL
print(f'Full execution selected!')
exit_code = pytest.main(['-s'])
if exit_code == 0:
print('All tests passed!')
else:
print('Some tests failed.')
print(f'Exit_code: "{exit_code}"')
sys.exit(exit_code)