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:
#625 (comment)
  • Loading branch information
linrock authored and ppigazzini committed May 11, 2020
1 parent 52c51ab commit 6e764ee
Show file tree
Hide file tree
Showing 4 changed files with 16 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
2 changes: 2 additions & 0 deletions fishtest/fishtest/templates/tests_view.mak
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
</td>
%elif arg[0] in ['resolved_new', 'resolved_base']:
<td>${arg[1][:7]}</td>
%elif arg[0] == 'rescheduled_from':
<td><a href="/tests/view/${arg[1]}">${arg[1]}</a></td>
%else:
<td>${str(markupsafe.Markup(arg[1])).replace('\n', '<br>') | n}</td>
%endif
Expand Down
6 changes: 6 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,8 @@ 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'], ''))

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 6e764ee

Please sign in to comment.