forked from RedHatQE/pylero
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tier_tests.py
36 lines (29 loc) · 1.05 KB
/
tier_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
from __future__ import print_function
# this script execute tier testsing for pylero
# if the first argument is "tier0" it tests tier0
# if the first argument is "tier1" it tests tier1
# if the first argument is 'all' it tests tier0+tier1
import subprocess
import sys
def get_command(x):
return {
'tier0': 'attribute_test',
'tier1': 'test_run_test document_test work_item_test plan_test',
'all': 'attribute_test test_run_test document_test'
' work_item_test plan_test'
}.get(x)
if __name__ == "__main__":
nose = 'nose2 --plugin nose2.plugins.junitxml --junit-xml'
coverage = ' --with-coverage --coverage-report xml'
src = ' -s src/unit_tests '
tests = None
if len(sys.argv) == 2:
tests = get_command(sys.argv[1])
if tests:
command = nose + coverage + src + tests
print("Execute " + tests + ":")
sys.exit(subprocess.call(command.split()))
else:
print("Usage: tiertests.py [args]")
print("args: 'tier0' or 'tier1' or 'all'")
sys.exit(1)