Skip to content

Commit

Permalink
cron: pr job: Pass estimated test cases only if limit provided
Browse files Browse the repository at this point in the history
If the requested test case prefixes were not found in cached list of
test cases, the test_cases list was empty and autopts bot
was triggered to run all test cases from PTS workspace.
  • Loading branch information
mkasenberg committed Aug 9, 2024
1 parent f997bc5 commit 725788d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tools/cron/autopts_cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,16 +231,19 @@ def schedule_pr_job(cron, pr_info, job_config):
test_cases, est_duration = get_estimations(cfg_dict, included_tc, excluded_tc,
job_config['test_case_limit'])

job_config.pop('test_case_limit')
job_config['included'] = test_cases

test_case_count = len(test_cases)
estimations = f', test case count: {test_case_count}, '\
f'estimated duration: {est_duration}'

if test_case_count > 0:
if job_config['test_case_limit']:
job_config['included'] = test_cases

estimations = f', test case count: {test_case_count}, ' \
f'estimated duration: {est_duration}'
estimations += f'<details><summary>Test cases to be run</summary>{"<br>".join(test_cases)}</details>\n'
else:
estimations = f', test case count: estimation not available'

job_config.pop('test_case_limit')
job_config['estimated_duration'] = est_duration
except Exception as e:
# Probably the configuration missed some parameters,
Expand Down

0 comments on commit 725788d

Please sign in to comment.