Skip to content

Commit

Permalink
Merge pull request #4488 from Martchus/creation-date
Browse files Browse the repository at this point in the history
Show creation time of scheduled jobs in info panel on job details page
  • Loading branch information
mergify[bot] committed Jan 31, 2022
2 parents db1bec5 + c34dcf3 commit 18c7f1a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions t/ui/18-tests-details.t
Expand Up @@ -469,6 +469,11 @@ subtest 'misc details: title, favicon, go back, go to source view, go to log vie

my $t = Test::Mojo->new('OpenQA::WebAPI');

subtest 'scheduled job' => sub {
$t->get_ok('/tests/99927/infopanel_ajax')->status_is(200);
$t->content_like(qr/scheduled.*, created.*\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d/s, 'creation date displayed');
};

subtest 'route to latest' => sub {
$t->get_ok('/tests/latest?distri=opensuse&version=13.1&flavor=DVD&arch=x86_64&test=kde&machine=64bit')
->status_is(200);
Expand Down
8 changes: 6 additions & 2 deletions templates/webapi/test/infopanel.html.ep
Expand Up @@ -58,11 +58,15 @@
(\
<%= $job->t_started ? format_time_duration($job->t_finished - $job->t_started) : 0 =%>\
)
% } elsif ($job->t_started)
% {
% }
% elsif ($job->t_started) {
<%= ', started' =%>
<abbr class="timeago" title="<%= $job->t_started->datetime() %>Z"><%= format_time($job->t_started) %></abbr>
% }
% else {
<%= ', created' =%>
<abbr class="timeago" title="<%= $job->t_created->datetime() %>Z"><%= format_time($job->t_created) %></abbr>
% }
% if (is_operator && $job->can_be_duplicated) {
<div class = "btn-group btn-group-sm" id="restart-button-group">
%= link_post url_for('apiv1_restart', jobid => $testid) => (class => 'btn btn-link restart-result', 'data-remote' => 'true', id => 'restart-result', 'data-jobid' => $testid) => begin
Expand Down

0 comments on commit 18c7f1a

Please sign in to comment.