Skip to content

Commit

Permalink
Revert "More compact test results"
Browse files Browse the repository at this point in the history
This reverts commit 5d8643e.
  • Loading branch information
DanTup committed Sep 3, 2019
1 parent 5d8643e commit e37cd19
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 63 deletions.
83 changes: 59 additions & 24 deletions css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -228,54 +228,89 @@ main {
#test-results {
min-width: 100%;

tr {
vertical-align: top;
tr:hover .test-name {
background-color: $dart-green-light;
}

a {
text-decoration: none;
color: #fff;
}

.section-channel {
.suite {
text-transform: capitalize;
font-weight: bold;
font-size: 1.5em;
padding-top: 10px;
white-space: nowrap;

td {
padding-top: 10px;
}
}
.suite {
white-space: nowrap;

.test-name {
padding: 1px 3px;
}

.spacer {
min-width: 30px;
img {
width: 16px;
height: 16px;
}

div.box {
height: 18px;
display: inline-block;
margin: 0 1px 3px 0;
vertical-align: top;
font-size: 12px;
line-height: 18px;
padding: 0 2px;
th {
text-align: left;
padding-bottom: 3px;

&.h {
text-align: center;
}

&.r {
width: 18px;
height: 18px;
}

&.i {
width: 20px;
}

&.pass {
border-bottom: 3px solid $pass;
}
&.fail {
border-bottom: 3px solid $fail;
}
}
td {
empty-cells: show;
max-width: 100px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;

&.pass {
background-color: $pass;
}
&.unknown {
background-color: $unknown;
color: #666;
text-align: center;
position: relative;
&:after {
content: "?";
pointer-events: none;
position: absolute;
width: 20px;
height: 20px;
top: 0;
left: 0;
line-height: 20px;
text-align: center;
}
opacity: 0.2;
}
&.skipped {
background-color: $skipped;
}
&.fail {
padding: 0 2px;
background-color: $fail;
}
a {
display: block;
width: 18px;
height: 18px;
}
}
Expand Down
82 changes: 43 additions & 39 deletions js/test-results.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,45 +121,49 @@ function handleTestResults(branch, hash, os, suite, dartVersion, codeVersion, xm
}

function updateResults() {
var bigSuites = ["dart only", "flutter only"];
var table = document.querySelector("#test-results");
var tbody = table.querySelector("tbody");
results = results.sort((s1, s2) => bigSuites.indexOf(s1.suite) !== -1 ? -1 : 0);
for (var codeVersion of ["stable", "insiders"]) {
for (var dartVersion of ["stable", "dev"]) {
addRow(tbody, 0, 3, dartVersion + " Dart, " + codeVersion + " Code", undefined, "section-channel");
for (var os of ["win", "osx", "linux"]) {
// addRow(tbody, 0, 2, os, "section-os", undefined);
var sharedRow;
var suiteIndex = 0;
for (var suite of results) {
suiteIndex++;
var isBigSuite = bigSuites.indexOf(suite.suite) !== -1;
var row;
if (isBigSuite) {
row = addRow(tbody, 0, 1, os + " " + suite.suite.replace(/ only/, ""), "", "suite");
} else {
if (!sharedRow) {
sharedRow = addRow(tbody, 0, 1, "other", "", "suite");
}
row = sharedRow;
}
var testClassIndex = 0;
for (var testClass of suite.testClasses) {
testClassIndex++;
var testIndex = 0;
for (var test of testClass.tests) {
testIndex++;
var totalCols = 18;
for (var suite of results) {
var row = addRow(tbody, 0, 3, suite.suite, "suite");
for (var codeVersion of ["stable", "insiders"]) {
for (var dartVersion of ["stable", "dev"]) {
// Don't show dev/dev for simplicity.
if (codeVersion == "insiders" && dartVersion == "dev")
continue;
row.appendChild(document.createElement("td"));
for (var os of ["win", "osx", "linux"]) {
// TODO: Finish... We have multiple files here (types of files, but also multiple files for multiple runs)..
// Maybe link to a list of files using the same API we use above?
// TODO: Why is icon rotated?
// var a = row.appendChild(document.createElement("td")).appendChild(document.createElement("a"));
// a.href = bucketRoot + ["logs", suite.branch, suite.hash, os, ".dart_code_logs", suite.name].join("/");
// var img = a.appendChild(document.createElement("img"));
// img.className = "x";
// img.src = "/images/log.svg";
}
row.appendChild(document.createElement("td"));
}
}
for (var testClass of suite.testClasses) {
addRow(tbody, 1, totalCols - 1, testClass.className);
for (var test of testClass.tests) {
var row = addRow(tbody, 2, 1, test.testName, undefined, "test-name");
for (var codeVersion of ["stable", "insiders"]) {
for (var dartVersion of ["stable", "dev"]) {
// Don't show dev/dev for simplicity.
// if (codeVersion == "insiders" && dartVersion == "dev")
// continue;
row.appendChild(document.createElement("td"));
for (var os of ["win", "osx", "linux"]) {
var id = dartVersion + "_" + codeVersion + "_" + os;
var result = test[id];
var resultClassName = "unknown";
var tooltip = testClass.className + " " + test.testName;
var tooltip = "";
var linkToLog = true;
let textContent = undefined;
if (result && result.failure) {
resultClassName = "fail";
tooltip += "\n\n" + result.failure;
textContent = suiteIndex.toString() + ":" + testClassIndex.toString() + ":" + testIndex.toString();
tooltip = result.failure;
} else if (result && result.skipped) {
resultClassName = "skipped";
} else if (result) {
Expand All @@ -173,22 +177,22 @@ function updateResults() {
// record it as unknown, since it wasn't expected to run - we've
// just got it in the list because it failed somewhere else.
resultClassName = undefined;
} else {
textContent = "?";
}

var box = row.appendChild(document.createElement("div"));
box.className = "box " + resultClassName;
box.title = tooltip.trim();
var cell = row.appendChild(document.createElement("td"));
cell.className = resultClassName;
cell.title = tooltip;

let link;
if (linkToLog) {
link = box.appendChild(document.createElement("a"));
var link = cell.appendChild(document.createElement("a"));
link.href = bucketRoot + ["logs", suite.branch, suite.hash, os, filenameSafe(suite.suite + "_" + dartVersion + "_" + codeVersion), filenameSafe(testClass.className + " " + test.testName) + ".txt"].join("/");
}

(link || box).textContent = textContent;
// Add to column header.
if (resultClassName)
document.getElementById(id).classList.add(resultClassName);
}
row.appendChild(document.createElement("td"));
}
}
}
Expand Down
32 changes: 32 additions & 0 deletions test-results.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,38 @@ body-class: big-screen test-results-page

<table id="test-results" class="hide">
<thead>
<tr>
<th colspan="3"></th>
<th colspan="5" class="h">Stable</th>
<th colspan="5" class="h">Dev Dart</th>
<th colspan="5" class="h">Dev Code</th>
<th colspan="5" class="h">Dev/Dev</th>
</tr>
<tr>
<th class="i"></th>
<th class="i"></th>
<th></th>
<th class="r"></th>
<th class="r" id="stable_stable_win"><img class="x" src="/images/win.svg" /></th>
<th class="r" id="stable_stable_osx"><img class="x" src="/images/macos.svg" /></th>
<th class="r" id="stable_stable_linux"><img class="x" src="/images/linux.svg" /></th>
<th class="r"></th>
<th class="r"></th>
<th class="r" id="dev_stable_win"><img class="x" src="/images/win.svg" /></th>
<th class="r" id="dev_stable_osx"><img class="x" src="/images/macos.svg" /></th>
<th class="r" id="dev_stable_linux"><img class="x" src="/images/linux.svg" /></th>
<th class="r"></th>
<th class="r"></th>
<th class="r" id="stable_insiders_win"><img class="x" src="/images/win.svg" /></th>
<th class="r" id="stable_insiders_osx"><img class="x" src="/images/macos.svg" /></th>
<th class="r" id="stable_insiders_linux"><img class="x" src="/images/linux.svg" /></th>
<th class="r"></th>
<th class="r"></th>
<th class="r" id="dev_insiders_win"><img class="x" src="/images/win.svg" /></th>
<th class="r" id="dev_insiders_osx"><img class="x" src="/images/macos.svg" /></th>
<th class="r" id="dev_insiders_linux"><img class="x" src="/images/linux.svg" /></th>
<th class="r"></th>
</tr>
</thead>
<tbody>
</tbody>
Expand Down

0 comments on commit e37cd19

Please sign in to comment.