@simpright/portal 0.0.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +47 -1
- package/dist/bugs.d.ts +3 -0
- package/dist/bugs.js +112 -0
- package/dist/build-pages.d.ts +3 -0
- package/dist/build-pages.js +28 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +145 -0
- package/dist/preview.d.ts +13 -0
- package/dist/preview.js +85 -0
- package/dist/publish-run.d.ts +19 -0
- package/dist/publish-run.js +78 -0
- package/dist/run-summaries.d.ts +8 -0
- package/dist/run-summaries.js +91 -0
- package/dist/site.d.ts +34 -0
- package/dist/site.js +63 -0
- package/dist/test-cases.d.ts +3 -0
- package/dist/test-cases.js +155 -0
- package/package.json +41 -5
- package/pages/bugs.html +1240 -0
- package/pages/dashboard.html +1230 -0
- package/pages/test-cases.html +1287 -0
- package/sample/.nojekyll +0 -0
- package/sample/api-regression/run-1/index.html +10 -0
- package/sample/api-regression/run-1/run-summary.json +1 -0
- package/sample/api-regression/run-10/index.html +10 -0
- package/sample/api-regression/run-10/run-summary.json +1 -0
- package/sample/api-regression/run-2/index.html +10 -0
- package/sample/api-regression/run-2/run-summary.json +1 -0
- package/sample/api-regression/run-3/index.html +10 -0
- package/sample/api-regression/run-3/run-summary.json +1 -0
- package/sample/api-regression/run-4/index.html +10 -0
- package/sample/api-regression/run-4/run-summary.json +1 -0
- package/sample/api-regression/run-5/index.html +10 -0
- package/sample/api-regression/run-5/run-summary.json +1 -0
- package/sample/api-regression/run-6/index.html +10 -0
- package/sample/api-regression/run-6/run-summary.json +1 -0
- package/sample/api-regression/run-7/index.html +10 -0
- package/sample/api-regression/run-7/run-summary.json +1 -0
- package/sample/api-regression/run-8/index.html +10 -0
- package/sample/api-regression/run-8/run-summary.json +1 -0
- package/sample/api-regression/run-9/index.html +10 -0
- package/sample/api-regression/run-9/run-summary.json +1 -0
- package/sample/api-regression-history.json +1 -0
- package/sample/api-regression-manifest.json +12 -0
- package/sample/bugs/bugs-data.js +130 -0
- package/sample/custom-ui/run-1/index.html +10 -0
- package/sample/custom-ui/run-1/run-summary.json +1 -0
- package/sample/custom-ui/run-2/index.html +10 -0
- package/sample/custom-ui/run-2/run-summary.json +1 -0
- package/sample/custom-ui-history.json +1 -0
- package/sample/custom-ui-manifest.json +4 -0
- package/sample/latest/api-regression/index.html +10 -0
- package/sample/latest/api-regression/run-summary.json +1 -0
- package/sample/latest/custom-ui/index.html +10 -0
- package/sample/latest/custom-ui/run-summary.json +1 -0
- package/sample/latest/smoke/index.html +10 -0
- package/sample/latest/smoke/run-summary.json +1 -0
- package/sample/latest/ui-regression/index.html +10 -0
- package/sample/latest/ui-regression/run-summary.json +1 -0
- package/sample/portal.json +37 -0
- package/sample/site.json +3 -0
- package/sample/smoke/run-1/index.html +10 -0
- package/sample/smoke/run-1/run-summary.json +1 -0
- package/sample/smoke/run-2/index.html +10 -0
- package/sample/smoke/run-2/run-summary.json +1 -0
- package/sample/smoke/run-3/index.html +10 -0
- package/sample/smoke/run-3/run-summary.json +1 -0
- package/sample/smoke/run-4/index.html +10 -0
- package/sample/smoke/run-4/run-summary.json +1 -0
- package/sample/smoke-history.json +1 -0
- package/sample/smoke-manifest.json +6 -0
- package/sample/test-cases/api/scenarios-data.js +169 -0
- package/sample/test-cases/ui/scenarios-data.js +191 -0
- package/sample/ui-regression/run-1/index.html +10 -0
- package/sample/ui-regression/run-1/run-summary.json +1 -0
- package/sample/ui-regression/run-10/index.html +10 -0
- package/sample/ui-regression/run-10/run-summary.json +1 -0
- package/sample/ui-regression/run-2/index.html +10 -0
- package/sample/ui-regression/run-2/run-summary.json +1 -0
- package/sample/ui-regression/run-3/index.html +10 -0
- package/sample/ui-regression/run-3/run-summary.json +1 -0
- package/sample/ui-regression/run-4/index.html +10 -0
- package/sample/ui-regression/run-4/run-summary.json +1 -0
- package/sample/ui-regression/run-5/index.html +10 -0
- package/sample/ui-regression/run-5/run-summary.json +1 -0
- package/sample/ui-regression/run-6/index.html +10 -0
- package/sample/ui-regression/run-6/run-summary.json +1 -0
- package/sample/ui-regression/run-7/index.html +10 -0
- package/sample/ui-regression/run-7/run-summary.json +1 -0
- package/sample/ui-regression/run-8/index.html +10 -0
- package/sample/ui-regression/run-8/run-summary.json +1 -0
- package/sample/ui-regression/run-9/index.html +10 -0
- package/sample/ui-regression/run-9/run-summary.json +1 -0
- package/sample/ui-regression-history.json +1 -0
- package/sample/ui-regression-manifest.json +12 -0
|
@@ -0,0 +1,1230 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Automation Portal</title>
|
|
7
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
8
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
9
|
+
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap" rel="stylesheet">
|
|
10
|
+
<!-- The README banner's logo, inline: the publish copies only this file, so there's no favicon file on the site. -->
|
|
11
|
+
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Crect width='44' height='44' rx='10' fill='%233fb950'/%3E%3Cpath d='M11 23l8 8l15-17' fill='none' stroke='%23fff' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E">
|
|
12
|
+
<!-- Pinned with its hash; deferred, so the page and its data load while it downloads. -->
|
|
13
|
+
<script defer src="https://cdn.jsdelivr.net/npm/chart.js@4.5.1/dist/chart.umd.min.js" integrity="sha384-jb8JQMbMoBUzgWatfe6COACi2ljcDdZQ2OxczGA3bGNeWe+6DChMTBJemed7ZnvJ" crossorigin="anonymous"></script>
|
|
14
|
+
<style>
|
|
15
|
+
/* The palette of the README banner (.github/assets/banner-dark.svg): GitHub's dark greys and greens. */
|
|
16
|
+
:root {
|
|
17
|
+
--bg: #0d1117;
|
|
18
|
+
--bg-end: #0e1813;
|
|
19
|
+
--surface: #161b22;
|
|
20
|
+
--surface-2: #21262d;
|
|
21
|
+
--line: #30363d;
|
|
22
|
+
--line-soft: #21262d;
|
|
23
|
+
--text: #e6edf3;
|
|
24
|
+
--text-strong: #f0f6fc;
|
|
25
|
+
--muted: #9198a1;
|
|
26
|
+
--green: #3fb950;
|
|
27
|
+
--green-hover: #56d364;
|
|
28
|
+
--green-bg: rgba(63, 185, 80, 0.12);
|
|
29
|
+
--green-line: rgba(63, 185, 80, 0.4);
|
|
30
|
+
--red: #f85149;
|
|
31
|
+
--red-text: #ffa198;
|
|
32
|
+
--red-bg: rgba(248, 81, 73, 0.1);
|
|
33
|
+
--red-line: rgba(248, 81, 73, 0.4);
|
|
34
|
+
--amber: #d29922;
|
|
35
|
+
--amber-text: #e3b341;
|
|
36
|
+
--amber-bg: rgba(210, 153, 34, 0.12);
|
|
37
|
+
--amber-line: rgba(210, 153, 34, 0.4);
|
|
38
|
+
--blue: #58a6ff;
|
|
39
|
+
--mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
* { box-sizing: border-box; }
|
|
43
|
+
|
|
44
|
+
/* Class rules below set display, which would otherwise override the hidden attribute. */
|
|
45
|
+
[hidden] { display: none !important; }
|
|
46
|
+
|
|
47
|
+
body {
|
|
48
|
+
margin: 0;
|
|
49
|
+
line-height: 1.5;
|
|
50
|
+
font-family: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
51
|
+
min-height: 100vh;
|
|
52
|
+
background-color: var(--bg);
|
|
53
|
+
background-image: linear-gradient(180deg, var(--bg) 0%, var(--bg-end) 100%);
|
|
54
|
+
color: var(--text);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
a { color: var(--green); }
|
|
58
|
+
a:hover { color: var(--green-hover); }
|
|
59
|
+
|
|
60
|
+
h1, h2, h3 { line-height: 1.2; color: var(--text-strong); }
|
|
61
|
+
|
|
62
|
+
.page {
|
|
63
|
+
display: grid;
|
|
64
|
+
grid-template-columns: 264px minmax(0, 1fr);
|
|
65
|
+
min-height: 100vh;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Side panel */
|
|
69
|
+
.sidebar {
|
|
70
|
+
position: sticky;
|
|
71
|
+
top: 0;
|
|
72
|
+
height: 100vh;
|
|
73
|
+
overflow-y: auto;
|
|
74
|
+
padding: 28px 20px;
|
|
75
|
+
border-right: 1px solid var(--line-soft);
|
|
76
|
+
background: rgba(13, 17, 23, 0.85);
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
gap: 28px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.brand {
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
gap: 12px;
|
|
86
|
+
text-decoration: none;
|
|
87
|
+
}
|
|
88
|
+
.brand svg { flex: none; }
|
|
89
|
+
.brand-name {
|
|
90
|
+
display: block;
|
|
91
|
+
font-size: 22px;
|
|
92
|
+
font-weight: 700;
|
|
93
|
+
line-height: 1.1;
|
|
94
|
+
letter-spacing: -0.01em;
|
|
95
|
+
color: var(--text-strong);
|
|
96
|
+
}
|
|
97
|
+
.brand-name span { color: var(--green); }
|
|
98
|
+
.brand-sub {
|
|
99
|
+
display: block;
|
|
100
|
+
margin-top: 4px;
|
|
101
|
+
font-size: 12px;
|
|
102
|
+
line-height: 1.1;
|
|
103
|
+
color: var(--muted);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.side-nav {
|
|
107
|
+
display: flex;
|
|
108
|
+
flex-direction: column;
|
|
109
|
+
gap: 6px;
|
|
110
|
+
}
|
|
111
|
+
.side-nav h2 {
|
|
112
|
+
margin: 0 0 6px;
|
|
113
|
+
font-size: 12px;
|
|
114
|
+
font-weight: 600;
|
|
115
|
+
text-transform: uppercase;
|
|
116
|
+
letter-spacing: 0.1em;
|
|
117
|
+
color: var(--muted);
|
|
118
|
+
}
|
|
119
|
+
.side-link {
|
|
120
|
+
display: flex;
|
|
121
|
+
align-items: center;
|
|
122
|
+
gap: 10px;
|
|
123
|
+
min-height: 44px;
|
|
124
|
+
padding: 10px 12px;
|
|
125
|
+
border-radius: 8px;
|
|
126
|
+
border: 1px solid transparent;
|
|
127
|
+
background: rgba(240, 246, 252, 0.03);
|
|
128
|
+
color: var(--text);
|
|
129
|
+
font-size: 14px;
|
|
130
|
+
font-weight: 600;
|
|
131
|
+
text-decoration: none;
|
|
132
|
+
transition: background .15s ease, border-color .15s ease;
|
|
133
|
+
}
|
|
134
|
+
.side-link:hover {
|
|
135
|
+
color: var(--text);
|
|
136
|
+
background: rgba(240, 246, 252, 0.06);
|
|
137
|
+
border-color: var(--line);
|
|
138
|
+
}
|
|
139
|
+
.side-link svg { flex: none; color: var(--muted); }
|
|
140
|
+
.side-link .text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
|
|
141
|
+
.side-link .sub { font-size: 12px; font-weight: 400; color: var(--muted); }
|
|
142
|
+
|
|
143
|
+
/* A family's latest run: green healthy or without failures, red unhealthy or with failures, grey unknown. */
|
|
144
|
+
.run-dot {
|
|
145
|
+
width: 8px;
|
|
146
|
+
height: 8px;
|
|
147
|
+
border-radius: 50%;
|
|
148
|
+
flex: none;
|
|
149
|
+
background: var(--muted);
|
|
150
|
+
}
|
|
151
|
+
.run-dot.good { background: var(--green); }
|
|
152
|
+
.run-dot.bad { background: var(--red); }
|
|
153
|
+
|
|
154
|
+
.side-note {
|
|
155
|
+
margin: auto 0 0;
|
|
156
|
+
font-size: 12px;
|
|
157
|
+
color: var(--muted);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* Main column */
|
|
161
|
+
.content {
|
|
162
|
+
padding: 32px 40px 48px;
|
|
163
|
+
max-width: 1240px;
|
|
164
|
+
display: flex;
|
|
165
|
+
flex-direction: column;
|
|
166
|
+
gap: 28px;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.intro { display: flex; flex-direction: column; gap: 18px; }
|
|
170
|
+
.intro h1 {
|
|
171
|
+
margin: 0 0 8px;
|
|
172
|
+
font-size: 36px;
|
|
173
|
+
font-weight: 700;
|
|
174
|
+
letter-spacing: -0.02em;
|
|
175
|
+
}
|
|
176
|
+
.intro p {
|
|
177
|
+
margin: 0;
|
|
178
|
+
max-width: 64ch;
|
|
179
|
+
color: var(--muted);
|
|
180
|
+
font-size: 16px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
|
|
184
|
+
|
|
185
|
+
.button {
|
|
186
|
+
display: inline-flex;
|
|
187
|
+
align-items: center;
|
|
188
|
+
justify-content: center;
|
|
189
|
+
gap: 8px;
|
|
190
|
+
min-height: 40px;
|
|
191
|
+
padding: 0 16px;
|
|
192
|
+
border-radius: 8px;
|
|
193
|
+
border: 1px solid var(--line);
|
|
194
|
+
background: var(--surface-2);
|
|
195
|
+
color: var(--text-strong);
|
|
196
|
+
font: inherit;
|
|
197
|
+
font-size: 14px;
|
|
198
|
+
font-weight: 600;
|
|
199
|
+
text-decoration: none;
|
|
200
|
+
cursor: pointer;
|
|
201
|
+
transition: background .15s ease, border-color .15s ease;
|
|
202
|
+
}
|
|
203
|
+
.button:hover {
|
|
204
|
+
color: var(--text-strong);
|
|
205
|
+
background: #292e36;
|
|
206
|
+
border-color: #8b949e;
|
|
207
|
+
}
|
|
208
|
+
.button svg { flex: none; color: var(--green); transition: transform .2s ease; }
|
|
209
|
+
.button[aria-expanded="true"] svg { transform: rotate(180deg); }
|
|
210
|
+
|
|
211
|
+
/* Status cards */
|
|
212
|
+
.status-row {
|
|
213
|
+
display: grid;
|
|
214
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
215
|
+
gap: 14px;
|
|
216
|
+
}
|
|
217
|
+
/* Fewer cards than four (a project with one layer, or without coverage) share the row without an empty slot. */
|
|
218
|
+
.status-row.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
219
|
+
.status-row.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
220
|
+
.status-row.cards-1 { grid-template-columns: minmax(0, 1fr); }
|
|
221
|
+
.status-card {
|
|
222
|
+
padding: 18px;
|
|
223
|
+
border-radius: 12px;
|
|
224
|
+
background: var(--surface);
|
|
225
|
+
border: 1px solid var(--line);
|
|
226
|
+
display: flex;
|
|
227
|
+
flex-direction: column;
|
|
228
|
+
gap: 10px;
|
|
229
|
+
}
|
|
230
|
+
.card-label {
|
|
231
|
+
font-size: 12px;
|
|
232
|
+
font-weight: 600;
|
|
233
|
+
text-transform: uppercase;
|
|
234
|
+
letter-spacing: 0.08em;
|
|
235
|
+
color: var(--muted);
|
|
236
|
+
}
|
|
237
|
+
.card-value {
|
|
238
|
+
font-size: 28px;
|
|
239
|
+
font-weight: 700;
|
|
240
|
+
line-height: 1;
|
|
241
|
+
color: var(--text-strong);
|
|
242
|
+
}
|
|
243
|
+
.card-sub { font-size: 13px; color: var(--muted); }
|
|
244
|
+
|
|
245
|
+
.status-chip {
|
|
246
|
+
align-self: flex-start;
|
|
247
|
+
display: inline-flex;
|
|
248
|
+
align-items: center;
|
|
249
|
+
gap: 6px;
|
|
250
|
+
padding: 4px 10px;
|
|
251
|
+
border-radius: 999px;
|
|
252
|
+
font-size: 14px;
|
|
253
|
+
font-weight: 600;
|
|
254
|
+
color: var(--muted);
|
|
255
|
+
border: 1px solid var(--line);
|
|
256
|
+
}
|
|
257
|
+
.status-chip svg { display: none; }
|
|
258
|
+
.status-chip.healthy { color: var(--green); background: var(--green-bg); border-color: var(--green-line); }
|
|
259
|
+
.status-chip.healthy .icon-healthy { display: block; }
|
|
260
|
+
.status-chip.unhealthy { color: var(--red-text); background: var(--red-bg); border-color: var(--red-line); }
|
|
261
|
+
.status-chip.unhealthy .icon-unhealthy { display: block; }
|
|
262
|
+
|
|
263
|
+
.meter {
|
|
264
|
+
display: block;
|
|
265
|
+
height: 6px;
|
|
266
|
+
border-radius: 3px;
|
|
267
|
+
background: var(--surface-2);
|
|
268
|
+
overflow: hidden;
|
|
269
|
+
}
|
|
270
|
+
.meter span {
|
|
271
|
+
display: block;
|
|
272
|
+
height: 100%;
|
|
273
|
+
width: 0;
|
|
274
|
+
background: var(--green);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/* Sections */
|
|
278
|
+
.panel {
|
|
279
|
+
padding: 22px;
|
|
280
|
+
border-radius: 12px;
|
|
281
|
+
background: var(--surface);
|
|
282
|
+
border: 1px solid var(--line);
|
|
283
|
+
display: flex;
|
|
284
|
+
flex-direction: column;
|
|
285
|
+
gap: 16px;
|
|
286
|
+
scroll-margin-top: 16px;
|
|
287
|
+
}
|
|
288
|
+
.panel-head { display: flex; flex-direction: column; gap: 2px; }
|
|
289
|
+
.panel-head h2 {
|
|
290
|
+
margin: 0;
|
|
291
|
+
font-size: 20px;
|
|
292
|
+
font-weight: 700;
|
|
293
|
+
display: flex;
|
|
294
|
+
align-items: center;
|
|
295
|
+
gap: 10px;
|
|
296
|
+
}
|
|
297
|
+
.panel-head p { margin: 0; font-size: 14px; color: var(--muted); }
|
|
298
|
+
|
|
299
|
+
.count-badge {
|
|
300
|
+
padding: 2px 8px;
|
|
301
|
+
border-radius: 999px;
|
|
302
|
+
font-size: 12px;
|
|
303
|
+
font-weight: 600;
|
|
304
|
+
color: var(--amber-text);
|
|
305
|
+
background: var(--amber-bg);
|
|
306
|
+
border: 1px solid var(--amber-line);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.stats-row {
|
|
310
|
+
display: grid;
|
|
311
|
+
grid-template-columns: repeat(6, minmax(0, 1fr));
|
|
312
|
+
gap: 10px;
|
|
313
|
+
}
|
|
314
|
+
.stat {
|
|
315
|
+
padding: 12px 14px;
|
|
316
|
+
border-radius: 10px;
|
|
317
|
+
background: var(--bg);
|
|
318
|
+
border: 1px solid var(--line-soft);
|
|
319
|
+
text-decoration: none;
|
|
320
|
+
min-width: 0;
|
|
321
|
+
}
|
|
322
|
+
.stat .label { display: block; font-size: 12px; color: var(--muted); }
|
|
323
|
+
.stat .value { font-size: 22px; font-weight: 700; color: var(--text-strong); }
|
|
324
|
+
.stat .avg { font-size: 14px; font-weight: 500; color: var(--muted); }
|
|
325
|
+
a.stat.failed:hover { border-color: var(--line); }
|
|
326
|
+
/* Only the number turns red, and only when the run has failures. */
|
|
327
|
+
a.stat.failed .value.has-failures { color: var(--red); }
|
|
328
|
+
|
|
329
|
+
.trend-toggle { align-self: flex-start; }
|
|
330
|
+
|
|
331
|
+
.chart-grid {
|
|
332
|
+
display: grid;
|
|
333
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
334
|
+
gap: 16px;
|
|
335
|
+
}
|
|
336
|
+
.chart-card {
|
|
337
|
+
padding: 16px;
|
|
338
|
+
border-radius: 10px;
|
|
339
|
+
background: var(--bg);
|
|
340
|
+
border: 1px solid var(--line-soft);
|
|
341
|
+
min-width: 0;
|
|
342
|
+
}
|
|
343
|
+
.chart-card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
|
|
344
|
+
.chart-container { position: relative; height: 240px; }
|
|
345
|
+
|
|
346
|
+
/* Known issues */
|
|
347
|
+
.table-scroll { overflow-x: auto; }
|
|
348
|
+
table {
|
|
349
|
+
width: 100%;
|
|
350
|
+
min-width: 640px;
|
|
351
|
+
border-collapse: collapse;
|
|
352
|
+
font-size: 14px;
|
|
353
|
+
}
|
|
354
|
+
th {
|
|
355
|
+
text-align: left;
|
|
356
|
+
padding: 10px 12px;
|
|
357
|
+
font-size: 12px;
|
|
358
|
+
font-weight: 600;
|
|
359
|
+
text-transform: uppercase;
|
|
360
|
+
letter-spacing: 0.08em;
|
|
361
|
+
color: var(--muted);
|
|
362
|
+
border-bottom: 1px solid var(--line);
|
|
363
|
+
}
|
|
364
|
+
td {
|
|
365
|
+
padding: 12px;
|
|
366
|
+
border-bottom: 1px solid var(--line-soft);
|
|
367
|
+
vertical-align: top;
|
|
368
|
+
color: var(--text);
|
|
369
|
+
}
|
|
370
|
+
td.issue-text { color: var(--muted); }
|
|
371
|
+
tbody tr:hover td { background: rgba(240, 246, 252, 0.02); }
|
|
372
|
+
.area-chip {
|
|
373
|
+
display: inline-block;
|
|
374
|
+
padding: 2px 8px;
|
|
375
|
+
border-radius: 6px;
|
|
376
|
+
font-size: 12px;
|
|
377
|
+
font-weight: 600;
|
|
378
|
+
background: var(--surface-2);
|
|
379
|
+
color: var(--text);
|
|
380
|
+
}
|
|
381
|
+
.bug-link {
|
|
382
|
+
font-family: var(--mono);
|
|
383
|
+
font-size: 13px;
|
|
384
|
+
white-space: nowrap;
|
|
385
|
+
}
|
|
386
|
+
.no-data {
|
|
387
|
+
padding: 20px;
|
|
388
|
+
text-align: center;
|
|
389
|
+
color: var(--muted);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/* Run history */
|
|
393
|
+
.history-list { display: flex; flex-direction: column; gap: 8px; }
|
|
394
|
+
details {
|
|
395
|
+
border-radius: 10px;
|
|
396
|
+
background: var(--bg);
|
|
397
|
+
border: 1px solid var(--line-soft);
|
|
398
|
+
}
|
|
399
|
+
summary {
|
|
400
|
+
display: flex;
|
|
401
|
+
flex-wrap: wrap;
|
|
402
|
+
align-items: center;
|
|
403
|
+
gap: 14px;
|
|
404
|
+
min-height: 44px;
|
|
405
|
+
padding: 12px 14px;
|
|
406
|
+
cursor: pointer;
|
|
407
|
+
list-style: none;
|
|
408
|
+
}
|
|
409
|
+
summary::-webkit-details-marker { display: none; }
|
|
410
|
+
summary .name { flex: 1 1 180px; display: flex; flex-direction: column; }
|
|
411
|
+
summary .name strong { font-size: 15px; color: var(--text-strong); }
|
|
412
|
+
summary .name small { font-size: 12px; color: var(--muted); }
|
|
413
|
+
summary .more { font-size: 13px; font-weight: 600; color: var(--green); }
|
|
414
|
+
details[open] summary .more::before { content: 'Hide runs'; }
|
|
415
|
+
details:not([open]) summary .more::before { content: 'Show runs'; }
|
|
416
|
+
|
|
417
|
+
/* One square per run, oldest to newest. */
|
|
418
|
+
.run-strip { display: flex; gap: 4px; }
|
|
419
|
+
.run-strip span {
|
|
420
|
+
width: 14px;
|
|
421
|
+
height: 14px;
|
|
422
|
+
border-radius: 3px;
|
|
423
|
+
background: var(--surface-2);
|
|
424
|
+
}
|
|
425
|
+
.run-strip span.good { background: var(--green); }
|
|
426
|
+
.run-strip span.bad { background: var(--red); }
|
|
427
|
+
|
|
428
|
+
.run-list {
|
|
429
|
+
list-style: none;
|
|
430
|
+
margin: 0;
|
|
431
|
+
padding: 0 14px 14px;
|
|
432
|
+
display: flex;
|
|
433
|
+
flex-direction: column;
|
|
434
|
+
gap: 6px;
|
|
435
|
+
}
|
|
436
|
+
.run-link {
|
|
437
|
+
display: flex;
|
|
438
|
+
align-items: center;
|
|
439
|
+
gap: 10px;
|
|
440
|
+
padding: 10px 12px;
|
|
441
|
+
border-radius: 8px;
|
|
442
|
+
background: var(--surface);
|
|
443
|
+
border: 1px solid transparent;
|
|
444
|
+
color: var(--text);
|
|
445
|
+
font-family: var(--mono);
|
|
446
|
+
font-size: 13px;
|
|
447
|
+
text-decoration: none;
|
|
448
|
+
}
|
|
449
|
+
.run-link:hover { color: var(--text); border-color: var(--line); }
|
|
450
|
+
.run-link .run-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
|
|
451
|
+
.run-link .run-result { font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; color: var(--muted); }
|
|
452
|
+
.run-link .open { font-family: 'IBM Plex Sans', sans-serif; font-weight: 600; color: var(--green); }
|
|
453
|
+
.run-empty { color: var(--muted); font-size: 14px; padding: 4px 0; }
|
|
454
|
+
|
|
455
|
+
.footer-note {
|
|
456
|
+
margin: 0;
|
|
457
|
+
color: var(--muted);
|
|
458
|
+
font-size: 13px;
|
|
459
|
+
text-align: center;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
@media (max-width: 1100px) {
|
|
463
|
+
.status-row, .status-row.cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
464
|
+
.stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
465
|
+
.chart-grid { grid-template-columns: 1fr; }
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
/* The side panel moves above the content, its link lists side by side. */
|
|
469
|
+
@media (max-width: 900px) {
|
|
470
|
+
.page { grid-template-columns: minmax(0, 1fr); }
|
|
471
|
+
.sidebar {
|
|
472
|
+
position: static;
|
|
473
|
+
height: auto;
|
|
474
|
+
border-right: 0;
|
|
475
|
+
border-bottom: 1px solid var(--line-soft);
|
|
476
|
+
display: grid;
|
|
477
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
478
|
+
gap: 20px;
|
|
479
|
+
}
|
|
480
|
+
.sidebar .brand, .side-note { grid-column: 1 / -1; }
|
|
481
|
+
.content { padding: 24px 16px 40px; }
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
@media (max-width: 600px) {
|
|
485
|
+
.sidebar { grid-template-columns: 1fr; padding: 20px 16px; }
|
|
486
|
+
.intro h1 { font-size: 28px; }
|
|
487
|
+
.status-row, .status-row.cards-3, .status-row.cards-2 { grid-template-columns: 1fr; }
|
|
488
|
+
.stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
489
|
+
.panel { padding: 16px; }
|
|
490
|
+
}
|
|
491
|
+
</style>
|
|
492
|
+
</head>
|
|
493
|
+
<body>
|
|
494
|
+
<div class="page">
|
|
495
|
+
<aside class="sidebar">
|
|
496
|
+
<a class="brand" href="#">
|
|
497
|
+
<svg width="40" height="40" viewBox="0 0 44 44" aria-hidden="true"><rect width="44" height="44" rx="10" fill="#3fb950"/><path d="M11 23l8 8l15-17" fill="none" stroke="#fff" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
|
498
|
+
<!-- The brand comes from portal.json (simpright.yml portal), like everything else that names the project. -->
|
|
499
|
+
<span><span class="brand-name" id="brand-name"></span><span class="brand-sub" id="brand-tagline"></span></span>
|
|
500
|
+
</a>
|
|
501
|
+
|
|
502
|
+
<nav class="side-nav" aria-label="Navigate">
|
|
503
|
+
<h2>Navigate</h2>
|
|
504
|
+
<a class="side-link" href="#known-issues">
|
|
505
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 8v4M12 16h.01"/></svg>
|
|
506
|
+
Known issues
|
|
507
|
+
</a>
|
|
508
|
+
<a class="side-link" href="#history">
|
|
509
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></svg>
|
|
510
|
+
Run history
|
|
511
|
+
</a>
|
|
512
|
+
<!-- Repository links: shown once portal.json names the repository the site was published from, so forks link to their own. -->
|
|
513
|
+
<a class="side-link" data-repo-link="actions" target="_blank" rel="noreferrer" hidden>
|
|
514
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" aria-hidden="true"><path d="M6 4l14 8-14 8z"/></svg>
|
|
515
|
+
Schedule a test run
|
|
516
|
+
</a>
|
|
517
|
+
<a class="side-link" data-repo-link="wiki" target="_blank" rel="noreferrer" hidden>
|
|
518
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 5a2 2 0 0 1 2-2h12v16H6a2 2 0 0 0-2 2z"/><path d="M4 19V5"/></svg>
|
|
519
|
+
Wiki
|
|
520
|
+
</a>
|
|
521
|
+
</nav>
|
|
522
|
+
|
|
523
|
+
<!-- One link per run in portal.json (simpright.yml runs), with a dot for its latest result. -->
|
|
524
|
+
<nav class="side-nav" aria-label="Latest reports" id="latest-reports">
|
|
525
|
+
<h2>Latest reports</h2>
|
|
526
|
+
</nav>
|
|
527
|
+
|
|
528
|
+
<p class="side-note" id="portal-description" hidden></p>
|
|
529
|
+
</aside>
|
|
530
|
+
|
|
531
|
+
<main class="content">
|
|
532
|
+
<section class="intro">
|
|
533
|
+
<div>
|
|
534
|
+
<h1>Automation Portal</h1>
|
|
535
|
+
<!-- renderIntro() names what the portal has: its regressions' layers and, when it's published, the API coverage. -->
|
|
536
|
+
<p id="intro-text">Latest reports, API coverage, trends, known issues and the history of every UI and API run, published by GitHub Actions.</p>
|
|
537
|
+
</div>
|
|
538
|
+
<div class="actions">
|
|
539
|
+
<!-- Coverage elements stay hidden until latest/api-coverage/totals.json exists (the coverage tool is optional). -->
|
|
540
|
+
<a class="button" data-coverage hidden href="latest/api-coverage/" target="_blank" rel="noreferrer">API coverage</a>
|
|
541
|
+
<!-- The Test Cases pages (simpright-portal build-pages) stay hidden until they're published. -->
|
|
542
|
+
<a class="button" data-test-cases="ui" hidden href="test-cases/ui/" target="_blank" rel="noreferrer">UI test cases</a>
|
|
543
|
+
<a class="button" data-test-cases="api" hidden href="test-cases/api/" target="_blank" rel="noreferrer">API test cases</a>
|
|
544
|
+
<!-- The Bugs page (simpright-portal build-pages) is published with the Test Cases pages and stays hidden until it exists. -->
|
|
545
|
+
<a class="button" data-bugs hidden href="bugs/" target="_blank" rel="noreferrer">Bugs</a>
|
|
546
|
+
</div>
|
|
547
|
+
</section>
|
|
548
|
+
|
|
549
|
+
<!-- A layer's card and trends show its regression: the run with that trend in portal.json; without one they're hidden. -->
|
|
550
|
+
<section class="status-row" aria-label="Status">
|
|
551
|
+
<div class="status-card" data-layer="ui">
|
|
552
|
+
<span class="card-label" id="ui-label">UI regression</span>
|
|
553
|
+
<span class="status-chip" id="ui-status">
|
|
554
|
+
<svg class="icon-healthy" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12l5 5L20 7"/></svg>
|
|
555
|
+
<svg class="icon-unhealthy" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" aria-hidden="true"><path d="M6 6l12 12M18 6L6 18"/></svg>
|
|
556
|
+
<span class="text">No data</span>
|
|
557
|
+
</span>
|
|
558
|
+
<span class="card-sub">Total – <span id="ui-total-tests">-</span> tests</span>
|
|
559
|
+
</div>
|
|
560
|
+
<div class="status-card" data-layer="api">
|
|
561
|
+
<span class="card-label" id="api-label">API regression</span>
|
|
562
|
+
<span class="status-chip" id="api-status">
|
|
563
|
+
<svg class="icon-healthy" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12l5 5L20 7"/></svg>
|
|
564
|
+
<svg class="icon-unhealthy" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" aria-hidden="true"><path d="M6 6l12 12M18 6L6 18"/></svg>
|
|
565
|
+
<span class="text">No data</span>
|
|
566
|
+
</span>
|
|
567
|
+
<span class="card-sub">Total – <span id="api-total-tests">-</span> tests</span>
|
|
568
|
+
</div>
|
|
569
|
+
<div class="status-card" data-coverage hidden>
|
|
570
|
+
<span class="card-label">API contract coverage</span>
|
|
571
|
+
<span class="card-value" id="api-contract-coverage">-</span>
|
|
572
|
+
<span class="meter" aria-hidden="true"><span id="api-coverage-meter"></span></span>
|
|
573
|
+
<span class="card-sub">Against the API contracts</span>
|
|
574
|
+
</div>
|
|
575
|
+
<div class="status-card" data-coverage hidden>
|
|
576
|
+
<span class="card-label">Endpoints covered</span>
|
|
577
|
+
<span class="card-value" id="api-endpoint-coverage">-</span>
|
|
578
|
+
<a class="card-sub" href="latest/api-coverage/" target="_blank" rel="noreferrer">Open the coverage report</a>
|
|
579
|
+
</div>
|
|
580
|
+
</section>
|
|
581
|
+
|
|
582
|
+
<!-- One section per regression; the charts are built the first time they're shown. -->
|
|
583
|
+
<section class="panel" id="ui-trends" data-layer="ui">
|
|
584
|
+
<div class="panel-head">
|
|
585
|
+
<h2>UI trends</h2>
|
|
586
|
+
<p id="ui-trends-sub">Latest 10 runs of the UI regression, oldest to newest</p>
|
|
587
|
+
</div>
|
|
588
|
+
<div class="stats-row">
|
|
589
|
+
<div class="stat"><span class="label">Total</span><span class="value" id="ui-total">-</span></div>
|
|
590
|
+
<div class="stat"><span class="label">Passed</span><span class="value" id="ui-passed">-</span></div>
|
|
591
|
+
<a class="stat failed" id="ui-failed-link" target="_blank" rel="noreferrer"><span class="label">Failed</span><span class="value" id="ui-failed">-</span></a>
|
|
592
|
+
<div class="stat"><span class="label">Run duration</span><span class="value" id="ui-duration">-</span></div>
|
|
593
|
+
<div class="stat"><span class="label">Average duration</span><span class="value" id="ui-avg-duration">-</span></div>
|
|
594
|
+
<div class="stat"><span class="label">Failure rate (avg)</span><span class="value" id="ui-failure-rate">-</span> <span class="avg" id="ui-avg-failure-rate"></span></div>
|
|
595
|
+
</div>
|
|
596
|
+
<button type="button" class="button trend-toggle" data-trends="ui" aria-expanded="false" aria-controls="ui-charts">
|
|
597
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg>
|
|
598
|
+
<span>Show trends</span>
|
|
599
|
+
</button>
|
|
600
|
+
<div class="chart-grid" id="ui-charts" hidden>
|
|
601
|
+
<div class="chart-card">
|
|
602
|
+
<h3>Failure rate per run</h3>
|
|
603
|
+
<div class="chart-container"><canvas id="uiFailureRateChart" role="img" aria-label="Failure rate per run of the UI regression"></canvas></div>
|
|
604
|
+
</div>
|
|
605
|
+
<div class="chart-card">
|
|
606
|
+
<h3>Duration per run</h3>
|
|
607
|
+
<div class="chart-container"><canvas id="uiDurationChart" role="img" aria-label="Duration per run of the UI regression"></canvas></div>
|
|
608
|
+
</div>
|
|
609
|
+
</div>
|
|
610
|
+
</section>
|
|
611
|
+
|
|
612
|
+
<section class="panel" id="api-trends" data-layer="api">
|
|
613
|
+
<div class="panel-head">
|
|
614
|
+
<h2>API trends</h2>
|
|
615
|
+
<p id="api-trends-sub">Latest 10 runs of the API regression, oldest to newest</p>
|
|
616
|
+
</div>
|
|
617
|
+
<div class="stats-row">
|
|
618
|
+
<div class="stat"><span class="label">Total</span><span class="value" id="api-total">-</span></div>
|
|
619
|
+
<div class="stat"><span class="label">Passed</span><span class="value" id="api-passed">-</span></div>
|
|
620
|
+
<a class="stat failed" id="api-failed-link" target="_blank" rel="noreferrer"><span class="label">Failed</span><span class="value" id="api-failed">-</span></a>
|
|
621
|
+
<div class="stat"><span class="label">Run duration</span><span class="value" id="api-duration">-</span></div>
|
|
622
|
+
<div class="stat"><span class="label">Average duration</span><span class="value" id="api-avg-duration">-</span></div>
|
|
623
|
+
<div class="stat"><span class="label">Failure rate (avg)</span><span class="value" id="api-failure-rate">-</span> <span class="avg" id="api-avg-failure-rate"></span></div>
|
|
624
|
+
</div>
|
|
625
|
+
<button type="button" class="button trend-toggle" data-trends="api" aria-expanded="false" aria-controls="api-charts">
|
|
626
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg>
|
|
627
|
+
<span>Show trends</span>
|
|
628
|
+
</button>
|
|
629
|
+
<div class="chart-grid" id="api-charts" hidden>
|
|
630
|
+
<div class="chart-card">
|
|
631
|
+
<h3>Failure rate per run</h3>
|
|
632
|
+
<div class="chart-container"><canvas id="apiFailureRateChart" role="img" aria-label="Failure rate per run of the API regression"></canvas></div>
|
|
633
|
+
</div>
|
|
634
|
+
<div class="chart-card">
|
|
635
|
+
<h3>Duration per run</h3>
|
|
636
|
+
<div class="chart-container"><canvas id="apiDurationChart" role="img" aria-label="Duration per run of the API regression"></canvas></div>
|
|
637
|
+
</div>
|
|
638
|
+
</div>
|
|
639
|
+
</section>
|
|
640
|
+
|
|
641
|
+
<section class="panel" id="known-issues">
|
|
642
|
+
<div class="panel-head">
|
|
643
|
+
<h2>Known issues <span class="count-badge" id="known-issues-count" hidden></span></h2>
|
|
644
|
+
</div>
|
|
645
|
+
<div class="table-scroll">
|
|
646
|
+
<table id="knownIssuesTable">
|
|
647
|
+
<thead>
|
|
648
|
+
<tr>
|
|
649
|
+
<th>Area</th>
|
|
650
|
+
<th>Test</th>
|
|
651
|
+
<th>Bug</th>
|
|
652
|
+
<th>Issue</th>
|
|
653
|
+
</tr>
|
|
654
|
+
</thead>
|
|
655
|
+
<tbody id="knownIssuesBody">
|
|
656
|
+
<tr>
|
|
657
|
+
<td colspan="4" class="no-data">Loading...</td>
|
|
658
|
+
</tr>
|
|
659
|
+
</tbody>
|
|
660
|
+
</table>
|
|
661
|
+
</div>
|
|
662
|
+
<!-- Collapsed by default to the first rows (KNOWN_ISSUES_PREVIEW); shown only when there are more. -->
|
|
663
|
+
<button type="button" class="button trend-toggle" id="knownIssuesToggle" aria-controls="knownIssuesTable" aria-expanded="false" hidden></button>
|
|
664
|
+
</section>
|
|
665
|
+
|
|
666
|
+
<section class="panel" id="history">
|
|
667
|
+
<div class="panel-head">
|
|
668
|
+
<h2>Run history</h2>
|
|
669
|
+
<p>The latest 10 runs of each family. One square per run, newest on the right: green without failures, red with failures, grey without results.</p>
|
|
670
|
+
</div>
|
|
671
|
+
<!-- One row per run in portal.json. -->
|
|
672
|
+
<div class="history-list" id="history-list">
|
|
673
|
+
<p class="run-empty">Loading...</p>
|
|
674
|
+
</div>
|
|
675
|
+
</section>
|
|
676
|
+
|
|
677
|
+
<p class="footer-note">Published by GitHub Actions. Each report family keeps its latest 10 runs, unless its workflow sets another number.</p>
|
|
678
|
+
</main>
|
|
679
|
+
</div>
|
|
680
|
+
|
|
681
|
+
<script>
|
|
682
|
+
// The page's colors, for the charts (Chart.js draws on a canvas, so it can't read the CSS variables).
|
|
683
|
+
const COLORS = {
|
|
684
|
+
green: '#3fb950',
|
|
685
|
+
red: '#f85149',
|
|
686
|
+
blue: '#58a6ff',
|
|
687
|
+
muted: '#9198a1',
|
|
688
|
+
text: '#e6edf3',
|
|
689
|
+
grid: 'rgba(240, 246, 252, 0.08)'
|
|
690
|
+
};
|
|
691
|
+
|
|
692
|
+
// A layer's latest regression is healthy when its failure rate is below its threshold (portal.json healthThreshold).
|
|
693
|
+
const DEFAULT_THRESHOLD = 1;
|
|
694
|
+
|
|
695
|
+
function formatDuration(durationMs) {
|
|
696
|
+
const seconds = durationMs / 1000;
|
|
697
|
+
return seconds < 60 ? `${seconds.toFixed(1)}s` : `${(seconds / 60).toFixed(2)}m`;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
function toSeconds(durationMs) {
|
|
701
|
+
return +(durationMs / 1000).toFixed(1);
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
function translucent(hex, alpha) {
|
|
705
|
+
const [r, g, b] = [1, 3, 5].map(i => parseInt(hex.slice(i, i + 2), 16));
|
|
706
|
+
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
function setText(id, value) {
|
|
710
|
+
const el = document.getElementById(id);
|
|
711
|
+
if (el) el.textContent = value;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
function chartOptions(yTitle, legend) {
|
|
715
|
+
return {
|
|
716
|
+
responsive: true,
|
|
717
|
+
maintainAspectRatio: false,
|
|
718
|
+
interaction: { mode: 'index', intersect: false },
|
|
719
|
+
plugins: {
|
|
720
|
+
legend: {
|
|
721
|
+
display: legend,
|
|
722
|
+
labels: { color: COLORS.text, usePointStyle: true, boxWidth: 8, padding: 16, font: { family: 'IBM Plex Sans', size: 12 } }
|
|
723
|
+
}
|
|
724
|
+
},
|
|
725
|
+
scales: {
|
|
726
|
+
x: {
|
|
727
|
+
grid: { display: false },
|
|
728
|
+
ticks: { color: COLORS.muted, font: { family: 'IBM Plex Sans' } }
|
|
729
|
+
},
|
|
730
|
+
y: {
|
|
731
|
+
beginAtZero: true,
|
|
732
|
+
title: { display: true, text: yTitle, color: COLORS.muted, font: { family: 'IBM Plex Sans' } },
|
|
733
|
+
grid: { color: COLORS.grid },
|
|
734
|
+
ticks: { color: COLORS.muted, font: { family: 'IBM Plex Sans' } }
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
};
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
function lineDataset(label, data, color, pointColors) {
|
|
741
|
+
return {
|
|
742
|
+
label,
|
|
743
|
+
data,
|
|
744
|
+
borderColor: color,
|
|
745
|
+
backgroundColor: translucent(color, 0.12),
|
|
746
|
+
borderWidth: 2,
|
|
747
|
+
tension: 0.4,
|
|
748
|
+
fill: true,
|
|
749
|
+
pointBackgroundColor: pointColors || color,
|
|
750
|
+
pointBorderColor: pointColors || color,
|
|
751
|
+
pointRadius: 3,
|
|
752
|
+
pointHoverRadius: 5
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
function createChart(canvasId, labels, datasets, options) {
|
|
757
|
+
const ctx = document.getElementById(canvasId).getContext('2d');
|
|
758
|
+
return new Chart(ctx, { type: 'line', data: { labels, datasets }, options });
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
function createDurationChart(canvasId, series) {
|
|
762
|
+
createChart(canvasId, series.map(item => item.run), [
|
|
763
|
+
lineDataset('Duration (seconds)', series.map(item => toSeconds(item.duration)), COLORS.blue)
|
|
764
|
+
], chartOptions('seconds', false));
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
// Each point is green below the health threshold and red above it; the line takes the latest run's color.
|
|
768
|
+
function createFailureRateChart(canvasId, series, threshold) {
|
|
769
|
+
const rates = series.map(item => +item.failureRate.toFixed(2));
|
|
770
|
+
const pointColors = rates.map(rate => rate < threshold ? COLORS.green : COLORS.red);
|
|
771
|
+
const latestRate = rates.length > 0 ? rates[rates.length - 1] : 0;
|
|
772
|
+
const options = chartOptions('% failed', true);
|
|
773
|
+
options.scales.y.suggestedMax = threshold * 2;
|
|
774
|
+
createChart(canvasId, series.map(item => item.run), [
|
|
775
|
+
lineDataset('Failure rate %', rates, latestRate < threshold ? COLORS.green : COLORS.red, pointColors),
|
|
776
|
+
{
|
|
777
|
+
label: `Healthy below ${threshold}%`,
|
|
778
|
+
data: rates.map(() => threshold),
|
|
779
|
+
borderColor: COLORS.muted,
|
|
780
|
+
borderWidth: 1,
|
|
781
|
+
borderDash: [4, 4],
|
|
782
|
+
pointRadius: 0,
|
|
783
|
+
pointHoverRadius: 0,
|
|
784
|
+
fill: false
|
|
785
|
+
}
|
|
786
|
+
], options);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
// portal.json, written next to this page on every publish (@simpright/portal, from simpright.yml): the brand and
|
|
790
|
+
// description, the repository, the health thresholds, and the runs, each a report family published by
|
|
791
|
+
// simpright-portal publish-run; a run with a trend is its layer's regression. Null when it's missing.
|
|
792
|
+
async function loadPortal() {
|
|
793
|
+
try {
|
|
794
|
+
const response = await fetch('portal.json');
|
|
795
|
+
return response.ok ? await response.json() : null;
|
|
796
|
+
} catch (error) {
|
|
797
|
+
console.error('Error loading portal.json:', error);
|
|
798
|
+
return null;
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
// The title, with its accent (the end of it, such as "Right") in green, and the tagline and description.
|
|
803
|
+
function renderBrand(portal) {
|
|
804
|
+
document.title = `${portal.title} - Automation Portal`;
|
|
805
|
+
const accent = portal.titleAccent && portal.title.endsWith(portal.titleAccent) ? portal.titleAccent : '';
|
|
806
|
+
const name = document.getElementById('brand-name');
|
|
807
|
+
name.textContent = portal.title.slice(0, portal.title.length - accent.length);
|
|
808
|
+
if (accent) {
|
|
809
|
+
const span = document.createElement('span');
|
|
810
|
+
span.textContent = accent;
|
|
811
|
+
name.appendChild(span);
|
|
812
|
+
}
|
|
813
|
+
setText('brand-tagline', portal.tagline || '');
|
|
814
|
+
const description = document.getElementById('portal-description');
|
|
815
|
+
description.textContent = portal.description || '';
|
|
816
|
+
description.hidden = !portal.description;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
// Latest reports: one link per run, with a dot for its latest result.
|
|
820
|
+
function renderLatestReports(runs) {
|
|
821
|
+
const nav = document.getElementById('latest-reports');
|
|
822
|
+
runs.forEach((run) => {
|
|
823
|
+
const link = document.createElement('a');
|
|
824
|
+
link.className = 'side-link';
|
|
825
|
+
link.href = `latest/${run.id}/`;
|
|
826
|
+
link.target = '_blank';
|
|
827
|
+
link.rel = 'noreferrer';
|
|
828
|
+
const dot = document.createElement('span');
|
|
829
|
+
dot.className = 'run-dot';
|
|
830
|
+
dot.dataset.familyDot = run.id;
|
|
831
|
+
const text = document.createElement('span');
|
|
832
|
+
text.className = 'text';
|
|
833
|
+
text.textContent = run.label;
|
|
834
|
+
if (run.note) {
|
|
835
|
+
const sub = document.createElement('span');
|
|
836
|
+
sub.className = 'sub';
|
|
837
|
+
sub.textContent = run.note;
|
|
838
|
+
text.appendChild(sub);
|
|
839
|
+
}
|
|
840
|
+
link.append(dot, text);
|
|
841
|
+
nav.appendChild(link);
|
|
842
|
+
});
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
// Run history: one row per run; renderHistoryList fills it in.
|
|
846
|
+
function renderHistoryRows(runs) {
|
|
847
|
+
document.getElementById('history-list').replaceChildren(...runs.map((run) => {
|
|
848
|
+
const details = document.createElement('details');
|
|
849
|
+
const summary = document.createElement('summary');
|
|
850
|
+
const name = document.createElement('span');
|
|
851
|
+
name.className = 'name';
|
|
852
|
+
const label = document.createElement('strong');
|
|
853
|
+
label.textContent = run.label;
|
|
854
|
+
const limit = document.createElement('small');
|
|
855
|
+
limit.textContent = 'Latest 10 runs';
|
|
856
|
+
name.append(label, limit);
|
|
857
|
+
const strip = document.createElement('span');
|
|
858
|
+
strip.className = 'run-strip';
|
|
859
|
+
strip.id = `history-${run.id}-strip`;
|
|
860
|
+
const more = document.createElement('span');
|
|
861
|
+
more.className = 'more';
|
|
862
|
+
summary.append(name, strip, more);
|
|
863
|
+
const list = document.createElement('ul');
|
|
864
|
+
list.className = 'run-list';
|
|
865
|
+
list.id = `history-${run.id}-list`;
|
|
866
|
+
const loading = document.createElement('li');
|
|
867
|
+
loading.className = 'run-empty';
|
|
868
|
+
loading.textContent = 'Loading...';
|
|
869
|
+
list.appendChild(loading);
|
|
870
|
+
details.append(summary, list);
|
|
871
|
+
return details;
|
|
872
|
+
}));
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
// Each layer's regression (the run with that trend) labels its status card and trends; a layer without one is hidden.
|
|
876
|
+
function renderLayers(regressions) {
|
|
877
|
+
['ui', 'api'].forEach((layer) => {
|
|
878
|
+
const run = regressions[layer];
|
|
879
|
+
document.querySelectorAll(`[data-layer="${layer}"]`).forEach((el) => { el.hidden = !run; });
|
|
880
|
+
if (!run) return;
|
|
881
|
+
setText(`${layer}-label`, run.label);
|
|
882
|
+
setText(`${layer}-trends-sub`, `Latest 10 runs of the ${run.label}, oldest to newest`);
|
|
883
|
+
document.getElementById(`${layer}-failed-link`).href = `latest/${run.id}/#?q=s%3Afailed`;
|
|
884
|
+
});
|
|
885
|
+
fitStatusRow();
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
// The status row's columns follow its visible cards (a hidden layer or missing coverage leaves no empty slot); with
|
|
889
|
+
// none, the row goes.
|
|
890
|
+
function fitStatusRow() {
|
|
891
|
+
const row = document.querySelector('.status-row');
|
|
892
|
+
const visible = [...row.children].filter((card) => !card.hidden).length;
|
|
893
|
+
row.classList.remove('cards-1', 'cards-2', 'cards-3');
|
|
894
|
+
if (visible > 0 && visible < 4) row.classList.add(`cards-${visible}`);
|
|
895
|
+
row.hidden = visible === 0;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
// The intro names what this portal has: the layers with a regression, and the API coverage when it's published.
|
|
899
|
+
function renderIntro(layers, hasCoverage) {
|
|
900
|
+
const names = ['ui', 'api'].filter((layer) => layers.includes(layer)).map((layer) => layer.toUpperCase());
|
|
901
|
+
const parts = ['Latest reports', ...(hasCoverage ? ['API coverage'] : []), ...(names.length ? ['trends', 'known issues'] : [])];
|
|
902
|
+
const runs = names.length ? `every ${names.join(' and ')} run` : 'every run';
|
|
903
|
+
setText('intro-text', `${parts.join(', ')} and the history of ${runs}, published by GitHub Actions.`);
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
function showMissingPortal() {
|
|
907
|
+
const message = 'No portal.json next to this page: simpright-portal writes it on every publish.';
|
|
908
|
+
document.querySelectorAll('[data-layer]').forEach((el) => { el.hidden = true; });
|
|
909
|
+
fitStatusRow();
|
|
910
|
+
document.getElementById('knownIssuesBody').innerHTML = `<tr><td colspan="4" class="no-data">${message}</td></tr>`;
|
|
911
|
+
document.getElementById('history-list').innerHTML = `<p class="run-empty">${message}</p>`;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
// A family's <family>-history.json, written at publish time by @simpright/portal's run summaries: every kept run,
|
|
915
|
+
// newest first, with its Playwright stats (null when the run has no results), and the newest run's known issues.
|
|
916
|
+
// The page never downloads a run's results.json (an API regression's is about 8 MB). Null when nothing is published.
|
|
917
|
+
async function loadHistory(family) {
|
|
918
|
+
try {
|
|
919
|
+
const response = await fetch(`${family}-history.json`);
|
|
920
|
+
if (!response.ok) return null;
|
|
921
|
+
return await response.json();
|
|
922
|
+
} catch (error) {
|
|
923
|
+
console.error(`Error loading ${family}-history.json:`, error);
|
|
924
|
+
return null;
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
// A run's counts from its Playwright stats. A known-issue test that fails as expected counts as passed.
|
|
929
|
+
function countsOf(stats) {
|
|
930
|
+
const passed = stats.expected || 0;
|
|
931
|
+
const failed = stats.unexpected || 0;
|
|
932
|
+
const skipped = stats.skipped || 0;
|
|
933
|
+
const flaky = stats.flaky || 0;
|
|
934
|
+
const total = passed + failed + skipped + flaky;
|
|
935
|
+
const duration = stats.duration || 0;
|
|
936
|
+
const failureRate = total > 0 ? ((failed / total) * 100) : 0;
|
|
937
|
+
return { passed, failed, total, duration, failureRate, flaky };
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
// The latest `limit` runs that have results, oldest first.
|
|
941
|
+
function toSeries(history, limit = 10) {
|
|
942
|
+
if (!history) return [];
|
|
943
|
+
return history.runs.filter(item => item.stats).slice(0, limit).reverse().map(({ run, stats }) => ({ run, ...countsOf(stats) }));
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
// How many known issues the collapsed table shows.
|
|
947
|
+
const KNOWN_ISSUES_PREVIEW = 3;
|
|
948
|
+
|
|
949
|
+
// Lists the tests of the latest regressions with an annotation containing "Known issue", e.g.
|
|
950
|
+
// test.fail(true, 'Known issue BUG-003: ...'); the bug ID links to the Bugs page.
|
|
951
|
+
// Collapsed by default: the first KNOWN_ISSUES_PREVIEW rows and a button that shows the rest.
|
|
952
|
+
function renderKnownIssues(histories) {
|
|
953
|
+
const tbody = document.getElementById('knownIssuesBody');
|
|
954
|
+
const knownIssues = [];
|
|
955
|
+
histories.forEach(history => (history?.knownIssues || []).forEach(issue => {
|
|
956
|
+
const exists = knownIssues.some(known => known.testName === issue.testName && known.description === issue.description);
|
|
957
|
+
if (!exists) knownIssues.push(issue);
|
|
958
|
+
}));
|
|
959
|
+
|
|
960
|
+
const count = document.getElementById('known-issues-count');
|
|
961
|
+
count.textContent = `${knownIssues.length} open`;
|
|
962
|
+
count.hidden = knownIssues.length === 0;
|
|
963
|
+
|
|
964
|
+
tbody.innerHTML = '';
|
|
965
|
+
if (knownIssues.length === 0) {
|
|
966
|
+
tbody.innerHTML = '<tr><td colspan="4" class="no-data">No known issues.</td></tr>';
|
|
967
|
+
return;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
knownIssues.forEach(issue => {
|
|
971
|
+
const row = document.createElement('tr');
|
|
972
|
+
const bug = /^Known issue ([A-Z]+-\d+):/.exec(issue.description)?.[1];
|
|
973
|
+
const text = issue.description.replace(/^Known issue( [A-Z]+-\d+)?: /, '');
|
|
974
|
+
[issue.area, issue.testName, bug, text].forEach((value, index) => {
|
|
975
|
+
const cell = document.createElement('td');
|
|
976
|
+
if (index === 0 && value) {
|
|
977
|
+
const chip = document.createElement('span');
|
|
978
|
+
chip.className = 'area-chip';
|
|
979
|
+
chip.textContent = value;
|
|
980
|
+
cell.appendChild(chip);
|
|
981
|
+
} else if (index === 2 && value) {
|
|
982
|
+
const link = document.createElement('a');
|
|
983
|
+
link.href = `bugs/#bug=${encodeURIComponent(value)}`;
|
|
984
|
+
link.target = '_blank';
|
|
985
|
+
link.rel = 'noreferrer';
|
|
986
|
+
link.className = 'bug-link';
|
|
987
|
+
link.textContent = value;
|
|
988
|
+
cell.appendChild(link);
|
|
989
|
+
} else {
|
|
990
|
+
cell.textContent = value || '-';
|
|
991
|
+
}
|
|
992
|
+
if (index === 3) cell.className = 'issue-text';
|
|
993
|
+
row.appendChild(cell);
|
|
994
|
+
});
|
|
995
|
+
tbody.appendChild(row);
|
|
996
|
+
});
|
|
997
|
+
|
|
998
|
+
const toggle = document.getElementById('knownIssuesToggle');
|
|
999
|
+
const rows = [...tbody.rows];
|
|
1000
|
+
const setExpanded = (expanded) => {
|
|
1001
|
+
rows.forEach((row, index) => { row.hidden = !expanded && index >= KNOWN_ISSUES_PREVIEW; });
|
|
1002
|
+
toggle.setAttribute('aria-expanded', String(expanded));
|
|
1003
|
+
toggle.textContent = expanded ? `Show only the first ${KNOWN_ISSUES_PREVIEW}` : `Show all ${rows.length} known issues`;
|
|
1004
|
+
};
|
|
1005
|
+
toggle.hidden = rows.length <= KNOWN_ISSUES_PREVIEW;
|
|
1006
|
+
toggle.onclick = () => {
|
|
1007
|
+
const expand = toggle.getAttribute('aria-expanded') !== 'true';
|
|
1008
|
+
setExpanded(expand);
|
|
1009
|
+
// Collapsing a long table would leave the reader far below it: bring the button back into view.
|
|
1010
|
+
if (!expand) toggle.scrollIntoView({ block: 'nearest' });
|
|
1011
|
+
};
|
|
1012
|
+
setExpanded(false);
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
// prefix: 'ui-' or 'api-', the ids of the regression's Trends section.
|
|
1016
|
+
function updateStats(prefix, series) {
|
|
1017
|
+
const latest = series[series.length - 1];
|
|
1018
|
+
const averageDuration = series.reduce((sum, item) => sum + item.duration, 0) / series.length;
|
|
1019
|
+
const averageFailureRate = series.reduce((sum, item) => sum + item.failureRate, 0) / series.length;
|
|
1020
|
+
|
|
1021
|
+
setText(`${prefix}total`, latest.total);
|
|
1022
|
+
setText(`${prefix}passed`, latest.passed + (latest.flaky || 0));
|
|
1023
|
+
setText(`${prefix}failed`, latest.failed);
|
|
1024
|
+
document.getElementById(`${prefix}failed`)?.classList.toggle('has-failures', latest.failed > 0);
|
|
1025
|
+
setText(`${prefix}duration`, formatDuration(latest.duration));
|
|
1026
|
+
setText(`${prefix}avg-duration`, formatDuration(averageDuration));
|
|
1027
|
+
setText(`${prefix}failure-rate`, `${latest.failureRate.toFixed(2)}%`);
|
|
1028
|
+
setText(`${prefix}avg-failure-rate`, `(${averageFailureRate.toFixed(2)}%)`);
|
|
1029
|
+
setText(`${prefix}total-tests`, latest.total);
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
function isHealthy(series, threshold) {
|
|
1033
|
+
return series[series.length - 1].failureRate < threshold;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
// The status card's chip and the regression's dot in Latest reports.
|
|
1037
|
+
function updateStatus(layer, family, series, threshold) {
|
|
1038
|
+
const chip = document.getElementById(`${layer}-status`);
|
|
1039
|
+
if (series.length === 0) return;
|
|
1040
|
+
const healthy = isHealthy(series, threshold);
|
|
1041
|
+
chip.classList.add(healthy ? 'healthy' : 'unhealthy');
|
|
1042
|
+
chip.querySelector('.text').textContent = healthy ? 'Healthy' : 'Unhealthy';
|
|
1043
|
+
setDot(family, healthy, `Latest run ${healthy ? 'healthy' : 'unhealthy'}: ${series[series.length - 1].failureRate.toFixed(2)}% failed`);
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
function setDot(family, good, title) {
|
|
1047
|
+
const dot = document.querySelector(`[data-family-dot="${family}"]`);
|
|
1048
|
+
if (!dot) return;
|
|
1049
|
+
dot.classList.add(good ? 'good' : 'bad');
|
|
1050
|
+
dot.title = title;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
// totals.json holds summary.json's totals without the per-endpoint detail (@simpright/portal's run summaries).
|
|
1054
|
+
// True when the coverage is published.
|
|
1055
|
+
async function loadApiCoverage() {
|
|
1056
|
+
try {
|
|
1057
|
+
const response = await fetch('latest/api-coverage/totals.json');
|
|
1058
|
+
if (!response.ok) return false;
|
|
1059
|
+
|
|
1060
|
+
const summary = await response.json();
|
|
1061
|
+
if (typeof summary.overallCoveragePct === 'number') {
|
|
1062
|
+
setText('api-contract-coverage', `${summary.overallCoveragePct}%`);
|
|
1063
|
+
document.getElementById('api-coverage-meter').style.width = `${Math.min(100, Math.max(0, summary.overallCoveragePct))}%`;
|
|
1064
|
+
}
|
|
1065
|
+
if (typeof summary.coveredEndpoints === 'number' && typeof summary.totalEndpoints === 'number') {
|
|
1066
|
+
setText('api-endpoint-coverage', `${summary.coveredEndpoints} / ${summary.totalEndpoints}`);
|
|
1067
|
+
}
|
|
1068
|
+
document.querySelectorAll('[data-coverage]').forEach((el) => { el.hidden = false; });
|
|
1069
|
+
fitStatusRow();
|
|
1070
|
+
return true;
|
|
1071
|
+
} catch {
|
|
1072
|
+
console.debug('No API coverage summary available yet');
|
|
1073
|
+
return false;
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
async function loadTestCaseLinks() {
|
|
1078
|
+
await Promise.all([...document.querySelectorAll('[data-test-cases]')].map(async (link) => {
|
|
1079
|
+
try {
|
|
1080
|
+
const response = await fetch(`test-cases/${link.dataset.testCases}/scenarios-data.js`, { method: 'HEAD' });
|
|
1081
|
+
link.hidden = !response.ok;
|
|
1082
|
+
} catch {
|
|
1083
|
+
console.debug(`No ${link.dataset.testCases} test cases published yet`);
|
|
1084
|
+
}
|
|
1085
|
+
}));
|
|
1086
|
+
try {
|
|
1087
|
+
const response = await fetch('bugs/bugs-data.js', { method: 'HEAD' });
|
|
1088
|
+
document.querySelectorAll('[data-bugs]').forEach((link) => { link.hidden = !response.ok; });
|
|
1089
|
+
} catch {
|
|
1090
|
+
console.debug('No Bugs page published yet');
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
// The repository the site was published from (portal.json), so a fork's portal links to the fork.
|
|
1095
|
+
// The repository's pages in the side panel: its workflows, and its wiki when the project publishes one.
|
|
1096
|
+
function setRepoLinks(repository, { wiki }) {
|
|
1097
|
+
if (!repository) return;
|
|
1098
|
+
document.querySelectorAll('[data-repo-link]').forEach((link) => {
|
|
1099
|
+
link.href = `${repository}/${link.dataset.repoLink}`;
|
|
1100
|
+
link.hidden = link.dataset.repoLink === 'wiki' && !wiki;
|
|
1101
|
+
});
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
// Show trends / Hide trends: the charts of a regression are created the first time they're shown,
|
|
1105
|
+
// so Chart.js measures a visible canvas, and only when Chart.js has loaded (chartsReady).
|
|
1106
|
+
function bindTrendToggles(seriesByLayer, chartsReady, thresholds) {
|
|
1107
|
+
const built = new Set();
|
|
1108
|
+
document.querySelectorAll('[data-trends]').forEach((button) => {
|
|
1109
|
+
const layer = button.dataset.trends;
|
|
1110
|
+
const charts = document.getElementById(`${layer}-charts`);
|
|
1111
|
+
button.addEventListener('click', async () => {
|
|
1112
|
+
if (!seriesByLayer[layer]) return;
|
|
1113
|
+
const open = button.getAttribute('aria-expanded') !== 'true';
|
|
1114
|
+
button.setAttribute('aria-expanded', String(open));
|
|
1115
|
+
button.querySelector('span').textContent = open ? 'Hide trends' : 'Show trends';
|
|
1116
|
+
charts.hidden = !open;
|
|
1117
|
+
if (!open || built.has(layer)) return;
|
|
1118
|
+
built.add(layer);
|
|
1119
|
+
await chartsReady;
|
|
1120
|
+
const series = await seriesByLayer[layer];
|
|
1121
|
+
createFailureRateChart(`${layer}FailureRateChart`, series, thresholds[layer] ?? DEFAULT_THRESHOLD);
|
|
1122
|
+
createDurationChart(`${layer}DurationChart`, series);
|
|
1123
|
+
});
|
|
1124
|
+
});
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
function renderRegression(layer, family, series, threshold) {
|
|
1128
|
+
updateStatus(layer, family, series, threshold);
|
|
1129
|
+
if (series.length > 0) updateStats(`${layer}-`, series);
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
// A run's square and result: good without failures, bad with failures, none without results.
|
|
1133
|
+
function runResult(stats) {
|
|
1134
|
+
if (!stats) return { kind: '', text: 'No results' };
|
|
1135
|
+
const { failed, total } = countsOf(stats);
|
|
1136
|
+
return failed > 0
|
|
1137
|
+
? { kind: 'bad', text: `${failed} of ${total} failed` }
|
|
1138
|
+
: { kind: 'good', text: `${total} passed` };
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
function renderHistoryList(run, history, limit = 10) {
|
|
1142
|
+
const family = run.id;
|
|
1143
|
+
const list = document.getElementById(`history-${family}-list`);
|
|
1144
|
+
const strip = document.getElementById(`history-${family}-strip`);
|
|
1145
|
+
const runs = history ? history.runs.slice(0, limit) : [];
|
|
1146
|
+
|
|
1147
|
+
if (runs.length === 0) {
|
|
1148
|
+
const li = document.createElement('li');
|
|
1149
|
+
li.className = 'run-empty';
|
|
1150
|
+
li.textContent = history ? 'No runs found' : 'No runs published yet';
|
|
1151
|
+
list.replaceChildren(li);
|
|
1152
|
+
strip.replaceChildren();
|
|
1153
|
+
return;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
const results = runs.map(item => runResult(item.stats));
|
|
1157
|
+
// The strip runs oldest to newest, like the charts.
|
|
1158
|
+
strip.replaceChildren(...runs.map((item, index) => {
|
|
1159
|
+
const square = document.createElement('span');
|
|
1160
|
+
if (results[index].kind) square.className = results[index].kind;
|
|
1161
|
+
square.title = `${item.run}: ${results[index].text}`;
|
|
1162
|
+
return square;
|
|
1163
|
+
}).reverse());
|
|
1164
|
+
const withFailures = results.filter(result => result.kind === 'bad').length;
|
|
1165
|
+
strip.setAttribute('role', 'img');
|
|
1166
|
+
strip.setAttribute('aria-label', `${withFailures} of the latest ${runs.length} runs had failures`);
|
|
1167
|
+
|
|
1168
|
+
// The family's newest run sets its dot in Latest reports; the regressions' dots (runs with a trend) show their health instead.
|
|
1169
|
+
if (!run.trend && results[0].kind) {
|
|
1170
|
+
setDot(family, results[0].kind === 'good', `Latest run: ${results[0].text}`);
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
list.replaceChildren(...runs.map((item, index) => {
|
|
1174
|
+
const li = document.createElement('li');
|
|
1175
|
+
const link = document.createElement('a');
|
|
1176
|
+
link.className = 'run-link';
|
|
1177
|
+
link.href = `${family}/${item.run}/`;
|
|
1178
|
+
link.target = '_blank';
|
|
1179
|
+
link.rel = 'noreferrer';
|
|
1180
|
+
const name = document.createElement('span');
|
|
1181
|
+
name.className = 'run-name';
|
|
1182
|
+
name.textContent = item.run;
|
|
1183
|
+
const result = document.createElement('span');
|
|
1184
|
+
result.className = 'run-result';
|
|
1185
|
+
result.textContent = results[index].text;
|
|
1186
|
+
const open = document.createElement('span');
|
|
1187
|
+
open.className = 'open';
|
|
1188
|
+
open.textContent = 'Open report';
|
|
1189
|
+
link.append(name, result, open);
|
|
1190
|
+
li.appendChild(link);
|
|
1191
|
+
return li;
|
|
1192
|
+
}));
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
// This script runs after the page's markup, so the data loads at once, in parallel with the deferred Chart.js:
|
|
1196
|
+
// portal.json first (it names the runs), then every run's history. Only the charts wait for DOMContentLoaded,
|
|
1197
|
+
// which fires after Chart.js has run.
|
|
1198
|
+
const chartsReady = new Promise(resolve => document.addEventListener('DOMContentLoaded', resolve));
|
|
1199
|
+
const coverage = loadApiCoverage();
|
|
1200
|
+
loadTestCaseLinks();
|
|
1201
|
+
const portalLoaded = loadPortal();
|
|
1202
|
+
// The intro waits for both, so it's written once.
|
|
1203
|
+
Promise.all([portalLoaded, coverage]).then(([portal, hasCoverage]) => {
|
|
1204
|
+
if (portal) renderIntro(portal.runs.map((run) => run.trend).filter(Boolean), hasCoverage);
|
|
1205
|
+
});
|
|
1206
|
+
portalLoaded.then((portal) => {
|
|
1207
|
+
if (!portal) {
|
|
1208
|
+
showMissingPortal();
|
|
1209
|
+
return;
|
|
1210
|
+
}
|
|
1211
|
+
renderBrand(portal);
|
|
1212
|
+
setRepoLinks(portal.repository, { wiki: portal.wiki === true });
|
|
1213
|
+
renderLatestReports(portal.runs);
|
|
1214
|
+
renderHistoryRows(portal.runs);
|
|
1215
|
+
const regressions = Object.fromEntries(portal.runs.filter(run => run.trend).map(run => [run.trend, run]));
|
|
1216
|
+
const thresholds = portal.healthThreshold || {};
|
|
1217
|
+
renderLayers(regressions);
|
|
1218
|
+
|
|
1219
|
+
const histories = Object.fromEntries(portal.runs.map(run => [run.id, loadHistory(run.id)]));
|
|
1220
|
+
portal.runs.forEach(run => histories[run.id].then(history => renderHistoryList(run, history)));
|
|
1221
|
+
const seriesByLayer = Object.fromEntries(Object.entries(regressions).map(([layer, run]) => [layer, histories[run.id].then(history => toSeries(history))]));
|
|
1222
|
+
bindTrendToggles(seriesByLayer, chartsReady, thresholds);
|
|
1223
|
+
Object.entries(regressions).forEach(([layer, run]) => {
|
|
1224
|
+
seriesByLayer[layer].then(series => renderRegression(layer, run.id, series, thresholds[layer] ?? DEFAULT_THRESHOLD));
|
|
1225
|
+
});
|
|
1226
|
+
Promise.all(Object.values(regressions).map(run => histories[run.id])).then(renderKnownIssues);
|
|
1227
|
+
});
|
|
1228
|
+
</script>
|
|
1229
|
+
</body>
|
|
1230
|
+
</html>
|