diff --git a/assets/javascripts/job_next_previous.js b/assets/javascripts/job_next_previous.js index 929a1892864..c198413d83e 100644 --- a/assets/javascripts/job_next_previous.js +++ b/assets/javascripts/job_next_previous.js @@ -28,7 +28,7 @@ function setupJobNextPrevious() { paging: true, ordering: false, deferRender: true, - columns: [{width: '5%'}, {data: 'result'}, {data: 'build'}, {data: 'finished'}], + columns: [{width: '5%'}, {data: 'result'}, {data: 'build'}, {data: 'assigned_worker'}, {data: 'finished'}], processing: false, order: false, columnDefs: [ @@ -41,7 +41,8 @@ function setupJobNextPrevious() { render: renderJobResults }, {targets: 2, render: renderBuild}, - {targets: 3, render: renderFinishTime} + {targets: 3, render: renderWorker}, + {targets: 4, render: renderFinishTime} ], initComplete: function (settings, json) { setPage(json); @@ -119,6 +120,11 @@ function renderBuild(data, type, row) { return "" + row.build + ''; } +function renderWorker(data, type, row) { + var link = '/admin/workers/' + data; + return "" + data + ''; +} + function renderFinishTime(data, type, row) { var html = ''; if (data != null) { diff --git a/lib/OpenQA/WebAPI/Controller/Test.pm b/lib/OpenQA/WebAPI/Controller/Test.pm index 8c00c4bf535..846580214c8 100644 --- a/lib/OpenQA/WebAPI/Controller/Test.pm +++ b/lib/OpenQA/WebAPI/Controller/Test.pm @@ -571,6 +571,7 @@ sub job_next_previous_ajax ($self) { DT_RowId => 'job_result_' . $job_id, id => $job_id, name => $job->name, + assigned_worker => $job->assigned_worker->name, distri => $job->DISTRI, version => $job->VERSION, build => $job->BUILD, diff --git a/t/ui/16-tests_job_next_previous.t b/t/ui/16-tests_job_next_previous.t index aa794a9a96c..2dedfe00873 100644 --- a/t/ui/16-tests_job_next_previous.t +++ b/t/ui/16-tests_job_next_previous.t @@ -111,6 +111,7 @@ my @tds = $driver->find_child_elements($job99946, 'td'); is((shift @tds)->get_text(), 'C', '99946 is current job'); is((shift @tds)->get_text(), 'zypper_up', 'failed module of 99946'); is((shift @tds)->get_text(), '0091', 'build of 99946 is 0091'); +(shift @tds)->get_text(); # Worker is((shift @tds)->get_text(), 'about 3 hours ago ( 01:00 hours )', 'finished and duration of 99946'); my $job99947 = $driver->find_element('#job_next_previous_table #job_result_99947'); @@ -141,6 +142,7 @@ is((shift @tds)->get_text(), 'C', '99901 is current job'); $state = $driver->find_child_element(shift @tds, '.status', 'css'); is($state->get_attribute('title'), 'Done: passed', 'the latest job 99901 was passed'); is((shift @tds)->get_text(), '0091', 'build of 99901 is 0091'); +(shift @tds)->get_text(); # Worker is((shift @tds)->get_text(), 'about 4 hours ago ( 01:00 hours )', 'finished and duration of 99901'); is(scalar @{$driver->find_elements('#job_next_previous_table #job_result_99902')}, 1, 'found nearest next job 99902'); $driver->find_element_by_link_text('Previous')->click(); @@ -160,6 +162,7 @@ is((shift @tds)->get_text(), 'C&L', '99947 is current and the latest job'); $state = $driver->find_child_element(shift @tds, '.status', 'css'); is($state->get_attribute('title'), 'Done: passed', 'the latest job 99947 was passed'); is((shift @tds)->get_text(), '0092', 'build of 99947 is 0092'); +(shift @tds)->get_text(); # Worker is((shift @tds)->get_text(), 'about 2 hours ago ( 01:58 hours )', 'finished and duration of 99947'); is(scalar @{$driver->find_elements('#job_next_previous_table #job_result_99946')}, 1, 'found nearest previous job 99946'); @@ -189,6 +192,7 @@ is((shift @tds)->get_text(), 'C&L', '99963 is current and the latest job'); $state = $driver->find_child_element(shift @tds, '.status', 'css'); is($state->get_attribute('title'), 'running', 'job 99963 was running'); is((shift @tds)->get_text(), '0091', 'build of 99963 is 0091'); +(shift @tds)->get_text(); # Worker is((shift @tds)->get_text(), 'Not yet: running', '99963 is not yet finished'); is(scalar @{$driver->find_elements('#job_next_previous_table #job_result_99962')}, 1, 'found previous job 99962'); @@ -205,6 +209,7 @@ is((shift @tds)->get_text(), 'C&L', '99928 is current and the latest job'); $state = $driver->find_child_element(shift @tds, '.status', 'css'); is($state->get_attribute('title'), 'scheduled', 'job 99928 was scheduled'); is((shift @tds)->get_text(), '0091', 'build of 99928 is 0091'); +(shift @tds)->get_text(); # Worker is((shift @tds)->get_text(), 'Not yet: scheduled', '99928 is not yet finished'); # check job next and previous under tests/latest route diff --git a/templates/webapi/test/job_next_previous.html.ep b/templates/webapi/test/job_next_previous.html.ep index 6a693f7427d..1d0751434f3 100644 --- a/templates/webapi/test/job_next_previous.html.ep +++ b/templates/webapi/test/job_next_previous.html.ep @@ -42,6 +42,7 @@ Result Build + Worker Finished