Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show link to original test when viewing a rescheduled test #665

Merged
merged 1 commit into from
May 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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