Skip to content

Commit 96c959d

Browse files
piotrnarajowskisjanc
authored andcommitted
bot: add no_retry_on_regression param
This param will be used on weekly runs. The purpose is to skip retrying test cases that have failed in previous runs. This way we can save some time
1 parent c048831 commit 96c959d

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

autopts/bot/common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ def __init__(self, args, **kwargs):
121121
self.bd_addr = args.get('bd_addr', '')
122122
self.enable_max_logs = args.get('enable_max_logs', False)
123123
self.retry = args.get('retry', 0)
124+
self.no_retry_on_regression = args.get('no_retry_on_regression')
124125
self.repeat_until_fail = args.get('repeat_until_fail', False)
125126
self.stress_test = args.get('stress_test', False)
126127
self.ykush = args.get('ykush', None)

autopts/client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,6 +1336,12 @@ def run_test_cases(ptses, test_case_instances, args, stats, **kwargs):
13361336

13371337
break
13381338

1339+
if args.no_retry_on_regression and status != 'PASS' and test_case not in stats.get_regressions():
1340+
# skip retrying if test fails and this is not regression
1341+
if stats.db:
1342+
stats.db.update_statistics(test_case, duration, status)
1343+
break
1344+
13391345
stats.run_count += 1
13401346

13411347
stats.index += 1

cliparser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ def __init__(self, iut_modes=None, board_names=None, add_help=True, *args, **kwa
8585
help="Repeat test if failed. Parameter specifies "
8686
"maximum repeat count per test")
8787

88+
self.add_argument("--no_retry_on_regression", type=bool,
89+
help="When no_retry_on_regression is used, failed test cases are handled as follows: if test"
90+
" failure is not a regression, test case will not be retried (i.e. retry is ignored). If"
91+
" the failure is regression, test case will be retried for retry number of times. If"
92+
" you set retry to zero, no failed test cases will be retried.")
93+
8894
self.add_argument("--repeat_until_fail", action='store_true', default=False,
8995
help="Repeat test case until non-pass verdict")
9096

0 commit comments

Comments
 (0)