Skip to content

Commit 3507e10

Browse files
committed
This modifies the WPT page to show information about subtests
This is a companion of servo/internal-wpt-dashboard#56 Signed-off-by: Manuel Rego Casasnovas <[email protected]>
1 parent 0a34f95 commit 3507e10

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

assets/js/load-chart.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ function parseDateString (date) {
3838
function toolTip (date, wpt_sha, servo_version, score, engine) {
3939
return `
4040
<b>${formatDate(date)}</b></br>
41-
Score: <b>${score / 10}</b></br>
41+
Score: <b>${score.per_mille / 10}</b></br>
42+
Subtests: <b>${score.per_mille_subtests / 10}%</b></br>
4243
WPT: ${wpt_sha}</br>
4344
Servo (${engine}): ${servo_version}
4445
`
@@ -129,7 +130,8 @@ function setupChart () {
129130
table.addColumn('date', 'runOn')
130131

131132
options.series.push({ color: dark_mode ? '#CC9933' : '#3366CC' })
132-
table.addColumn('number', 'Servo')
133+
table.addColumn('number', 'Score')
134+
table.addColumn('number', 'Subtests')
133135
table.addColumn({ type: 'string', role: 'tooltip', p: { html: true } })
134136

135137
for (const scores_for_run of all_scores.scores) {
@@ -141,7 +143,8 @@ function setupChart () {
141143
}
142144
const row = [
143145
date,
144-
area_score / 1000,
146+
area_score.per_mille / 1000,
147+
area_score.per_mille_subtests / 1000,
145148
toolTip(date, wpt_sha, browser_version, area_score, 'Servo')
146149
]
147150
table.addRow(row)
@@ -166,7 +169,8 @@ function setupChart () {
166169
'beforeend',
167170
`<tr class="${idx % 2 ? 'odd' : 'even'}">
168171
<td>${scores.focus_areas[area]}</td>
169-
<td class="score">${String(recent_score[idx + AREA_SCORE_OFFSET] / 10).padEnd(4, '.0')}%</td>
172+
<td class="score">${String(recent_score[idx + AREA_SCORE_OFFSET].per_mille / 10).padEnd(4, '.0')}</td>
173+
<td class="score">(${String(recent_score[idx + AREA_SCORE_OFFSET].total_subtests_passed)}/${String(recent_score[idx + AREA_SCORE_OFFSET].total_subtests)}) ${String(recent_score[idx + AREA_SCORE_OFFSET].per_mille_subtests / 10).padEnd(4, '.0')}% </td>
170174
</tr>`
171175
)
172176
}

wpt.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ title: WPT Pass Rates
2828
padding: 5px 10px;
2929
}
3030

31+
#score-table th {
32+
text-align: right;
33+
}
3134
#score-table th:nth-child(1) {
3235
text-align: left;
3336
}
@@ -81,17 +84,14 @@ The chart below tracks our pass rates in several *focus areas* of the [Web Platf
8184
</div>
8285
<div id="servo-chart"></div>
8386
<table id="score-table">
84-
<thead id="score-table-header"><tr><th>Test Suite</th><th>Score</th></tr></thead>
87+
<thead id="score-table-header"><tr><th>Test Suite</th><th>Score</th><th>Subtests</th></tr></thead>
8588
<tbody id="score-table-body"></tbody>
8689
</table>
8790
<p id="score-explanation">
88-
Scores are calculated as percentages of total <b>enabled</b>
89-
tests within the suite that pass. A passing test with no
90-
subtests gets a score of 1 while a test with subtests gets a
91-
score between 0 and 1 representing the fraction of passing
92-
subtests within that test. This is different from the
93-
percentages on wpt.fyi which is calculated by giving equal
94-
weight to both top-level tests and subtests.
91+
There results are calculated as percentages of total <b>enabled</b> tests within the suite that pass.<br>
92+
<b>Scores</b> are computed as follows, a passing test with no subtests gets a score of 1
93+
while a test with subtests gets a score between 0 and 1 representing the fraction of passing subtests within that test.<br>
94+
<b>Subtests</b> are calculated by given equal weight to both top-level tests and subtests.
9595
</p>
9696
</div>
9797
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>

0 commit comments

Comments
 (0)