Skip to content

Commit

Permalink
Show link to original test when viewing a rescheduled test
Browse files Browse the repository at this point in the history
Implements vondele's suggestion here:
official-stockfish#625 (comment)
  • Loading branch information
linrock committed May 10, 2020
1 parent ed2672e commit c525a94
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fishtest/fishtest/rundb.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def new_run(self, base_tag, new_tag, num_games, tc, book, book_depth,
msg_new='',
base_signature='',
new_signature='',
rescheduled_from=None,
base_same_as_master=None,
start_time=None,
sprt=None,
Expand Down Expand Up @@ -130,6 +131,9 @@ def new_run(self, base_tag, new_tag, num_games, tc, book, book_depth,
'approver': '',
}

if rescheduled_from:
new_run['rescheduled_from'] = rescheduled_from

return self.runs.insert_one(new_run).inserted_id

def get_machines(self):
Expand Down
4 changes: 4 additions & 0 deletions fishtest/fishtest/templates/tests_run.mak
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@
<input type="hidden" name="msg_base" value="${args.get('msg_base', '')}">
<input type="hidden" name="msg_new" value="${args.get('msg_new', '')}">
%endif

%if is_rerun:
<input type="hidden" name="rescheduled_from" value="${rescheduled_from}">
%endif
</form>

<script type="text/javascript">
Expand Down
10 changes: 10 additions & 0 deletions fishtest/fishtest/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@ def validate_form(request):
'info': request.POST['run-info'],
}

if request.POST.get('rescheduled_from'):
data['rescheduled_from'] = request.POST['rescheduled_from']

def strip_message(m):
s = re.sub(r"[Bb]ench[ :]+[0-9]{7}\s*", "", m)
s = re.sub(r"[ \t]+", " ", s)
Expand Down Expand Up @@ -496,6 +499,7 @@ def tests_run(request):

return {'args': run_args,
'is_rerun': len(run_args) > 0,
'rescheduled_from': request.params['id'] if 'id' in request.params else None,
'tests_repo': u.get('tests_repo', ''),
'bench': get_master_bench()}

Expand Down Expand Up @@ -679,6 +683,12 @@ def tests_view(request):
results = request.rundb.get_results(run)
run['results_info'] = format_results(results, run)
run_args = [('id', str(run['_id']), '')]
if run.get('rescheduled_from'):
run_args.append((
'rescheduled_from',
run['rescheduled_from'],
'/tests/view/{}'.format(run['rescheduled_from'])
))

for name in ['new_tag', 'new_signature', 'new_options', 'resolved_new',
'base_tag', 'base_signature', 'base_options', 'resolved_base',
Expand Down

0 comments on commit c525a94

Please sign in to comment.