Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 54a9df7

Browse files
gctuckerMiloCasagrande
authored andcommitted
Always expect the test suite boot log to be in the test suite data
Now that the test suite data is separated from boots, there is never any boot entry associated with test suite entries. So always expect the boot log to be found directly in the test suite entry. Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
1 parent 2fe0d5c commit 54a9df7

1 file changed

Lines changed: 36 additions & 49 deletions

File tree

app/dashboard/static/js/app/view-tests-suite-id.2017.12.js

Lines changed: 36 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
/*!
22
* kernelci dashboard.
3-
*
3+
*
44
* Copyright (C) 2014, 2015, 2016, 2017 Linaro Ltd.
55
* Copyright (c) 2017 BayLibre, SAS.
66
* Author: Loys Ollivier <lollivier@baylibre.com>
7-
*
7+
*
88
* This program is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU Affero General Public License as
1010
* published by the Free Software Foundation, either version 3 of the
1111
* License, or (at your option) any later version.
12-
*
12+
*
1313
* This program is distributed in the hope that it will be useful,
1414
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1515
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1616
* GNU Affero General Public License for more details.
17-
*
17+
*
1818
* You should have received a copy of the GNU Affero General Public License
1919
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2020
*/
@@ -176,7 +176,7 @@ require([
176176
tableNode.id = 'table-set-' + setId;
177177
tableCaption = tableNode.createCaption();
178178
tableCaption.innerHTML = 'Test set:&nbsp;' + setName;
179-
179+
180180
tableBody = document.createElement('tbody');
181181
tableNode.appendChild(tableBody);
182182

@@ -538,60 +538,47 @@ require([
538538

539539
function getBootLog(response) {
540540
var bootLog;
541-
var deferred;
542541
var pathURI;
543542
var result;
544543
var serverURI;
545544
var serverURL;
546545
var translatedURI;
547546
var lab;
548-
// We only have one result.
549-
result = response.result[0];
550-
bootLog = null;
551-
552-
function bootLogDone(bootResponse) {
553-
var bootResult;
554547

555-
bootResult = bootResponse.result[0];
556-
serverURL = result.file_server_url;
557-
lab = result.lab_name;
558-
559-
if (!serverURL) {
560-
serverURL = gFileServer;
561-
}
548+
result = response.result[0]; // We only have one result.
549+
serverURL = result.file_server_url;
550+
lab = result.lab_name;
562551

563-
translatedURI = u.createFileServerURL(serverURL, bootResult);
564-
serverURI = translatedURI[0];
565-
pathURI = translatedURI[1];
566-
567-
bootLog = tboot.createBootLog(
568-
bootResult.boot_log,
569-
bootResult.boot_log_html,
570-
lab,
571-
serverURI,
572-
pathURI
573-
);
574-
gLogHref = u.getHref(serverURI, [
575-
pathURI,
576-
lab,
577-
bootResult.boot_log_html
578-
]);
579-
if (bootLog) {
580-
html.replaceContent(
581-
document.getElementById('dd-suite-test-log'), bootLog);
582-
} else {
583-
html.replaceContent(
584-
document.getElementById('dd-suite-test-log'), html.nonavail());
585-
}
586-
setTimeout(getTestSetAndCaseData, 25);
552+
if (!serverURL) {
553+
serverURL = gFileServer;
587554
}
588555

589-
// Boot & Test Log
590-
if (result.boot_id) {
591-
deferred = request.get('/_ajax/boot', {id: result.boot_id.$oid});
592-
$.when(deferred)
593-
.done(bootLogDone);
556+
translatedURI = u.createFileServerURL(serverURL, result);
557+
serverURI = translatedURI[0];
558+
pathURI = translatedURI[1];
559+
560+
bootLog = tboot.createBootLog(
561+
result.boot_log,
562+
result.boot_log_html,
563+
lab,
564+
serverURI,
565+
pathURI
566+
);
567+
gLogHref = u.getHref(serverURI, [
568+
pathURI,
569+
lab,
570+
result.boot_log_html
571+
]);
572+
573+
if (bootLog) {
574+
html.replaceContent(
575+
document.getElementById('dd-suite-test-log'), bootLog);
576+
} else {
577+
html.replaceContent(
578+
document.getElementById('dd-suite-test-log'), html.nonavail());
594579
}
580+
581+
setTimeout(getTestSetAndCaseData, 25);
595582
}
596583

597584
function getSuiteData() {
@@ -618,4 +605,4 @@ require([
618605

619606
setTimeout(getSuiteData, 10);
620607

621-
});
608+
});

0 commit comments

Comments
 (0)