Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelrios committed Jan 14, 2025
1 parent 3810e86 commit 48b334c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
5 changes: 2 additions & 3 deletions __main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ def parse_args(cmdln_args):
def validate_project(platform, project, report_type):
# Conditionally require --platform and --project
# if --report-type is 'test-case-coverage'
# if report_type == 'test-case-coverage':
if report_type in ('test-case-coverage', 'milestones'):
if report_type in ('test-case-coverage', 'testrail-milestones'):
if not project:
print("--project is required for the report selected")
if not platform:
Expand Down Expand Up @@ -75,7 +74,7 @@ def main():
else:
num_days = ''
h.testrail_run_counts_update(args.project, num_days)
if args.report_type == 'milestones':
if args.report_type == 'testrail-milestones':
h = TestRailClient()
h.test_rail_milestones()
if args.report_type == 'issue-regression':
Expand Down
1 change: 0 additions & 1 deletion testrail.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def __init__(self):
self.client = APIClient(TESTRAIL_HOST)
self.client.user = os.environ['TESTRAIL_USERNAME']
self.client.password = os.environ['TESTRAIL_PASSWORD']

except KeyError:
print("ERROR: Missing testrail env var")
sys.exit(1)
Expand Down
2 changes: 1 addition & 1 deletion utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
'jira-qa-requests',
'jira-qa-needed',
'bugzilla-qe-verify',
'milestones'
'testrail-milestones'
]

# JQL query All QA Requests since 2022 filter_id: 13856
Expand Down
7 changes: 2 additions & 5 deletions utils/datetime_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@ def convert_datetime_to_epoch(str_date):
return int(t)

def convert_epoch_to_datetime(int_epoch_date):
if int_epoch_date == '' or int_epoch_date == 0 or int_epoch_date == 'NaN': # noqa
return None
else:
ts = datetime.fromtimestamp(int_epoch_date)
return ts.strftime(format_date)
ts = datetime.fromtimestamp(int_epoch_date)
return ts.strftime(format_date)

def convert_to_utc(datetime_str):
"""Convert datetime string with timezone offset to UTC."""
Expand Down

0 comments on commit 48b334c

Please sign in to comment.