-
Notifications
You must be signed in to change notification settings - Fork 5
/
__main__.py
58 lines (45 loc) · 1.34 KB
/
__main__.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
import argparse
import sys
from github import GithubClient
from testrail import TestRailClient
from utils.constants import PROJECTS_ABBREV, REPORT_TYPES
def parse_args(cmdln_args):
parser = argparse.ArgumentParser(
description="Retrieve and update mobile project test data"
)
parser.add_argument(
"--project",
help="Indicate project",
required=True,
choices=PROJECTS_ABBREV
)
parser.add_argument(
"--report-type",
help="Indicate report type",
required=True,
choices=REPORT_TYPES
)
parser.add_argument(
"--num-days",
help="Indicate number of historic days of records to include",
required=False
)
return parser.parse_args(args=cmdln_args)
def main():
args = parse_args(sys.argv[1:])
if args.report_type == 'test-case-coverage':
h = TestRailClient()
h.data_pump(args.project.lower())
if args.report_type == 'test-run-counts':
h = TestRailClient()
if args.num_days:
num_days = args.num_days
else:
num_days = ''
h.testrail_run_counts_update(args.project, num_days)
if args.report_type == 'issue-regression':
h = GithubClient()
h.github_issue_regression(args.project)
h = GithubClient()
if __name__ == '__main__':
main()