Skip to content
This repository was archived by the owner on Apr 17, 2019. It is now read-only.

Commit 295d33a

Browse files
authored
Merge pull request #1203 from eparis/yellow-e2e-status
Display when the test are 'yellow'
2 parents 9815b6b + d32dd54 commit 295d33a

File tree

5 files changed

+60
-38
lines changed

5 files changed

+60
-38
lines changed

mungegithub/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ help:
9191
@echo " deploy: launches/updates the app on a kubernetes cluster"
9292
@echo " local_dryrun: tries to launch the container locally with docker"
9393
@echo " deployment: updates $(APP)/deployment.yaml and places results in $(APP)/local.deployment.yaml"
94+
@echo " ui-stub: grab upstream submit-queue data and launch the web ui on port 8000"
9495
@echo " secret: updates $(APP)/secret.yaml with TOKEN an creates $(APP)/local.secret.yaml"
9596
@echo " clean: deletes the binary and local files (does not delete old containers)"
9697

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/github-e2e-queue
2+
/google-internal-ci
3+
/health
4+
/history
5+
/merge-info
6+
/priority-info
7+
/prs
8+
/sq-stats
9+
/stats

mungegithub/submit-queue/www/index.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
<h1 class="md-display-2">Submit Queue Status</h1>
2222
<a ng-href="https://k8s.io"><img src="https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo.png" alt="kubernetes logo" class="titleLogo"></a>
2323
</md-toolbar>
24-
<md-toolbar class="md-warn" ng-show="cntl.failedBuild">
24+
<md-toolbar class="md-warn md-hue-1" ng-show="cntl.testResults.yellowBuilds">
25+
<h2 class="md-toolbar-tools">E2E Tests Are Troubled But Not Failing</h2>
26+
</md-toolbar>
27+
<md-toolbar class="md-warn" ng-show="cntl.testResults.redBuilds">
2528
<h2 class="md-toolbar-tools">E2E Tests Failing. Entire submit queue blocked. Last merge&nbsp;<span am-time-ago="cntl.lastMergeTime"></span>.</h2>
2629
</md-toolbar>
2730
<md-content class="md-padding">
@@ -142,21 +145,21 @@ <h4 class="md-body-2">{{pr.Reason}}</h4>
142145

143146
<md-tab md-on-select="cntl.selectTab('e2e')">
144147
<md-tab-label>
145-
<span ng-class="{'redTab':cntl.failedBuild}">E2E Tests</span>
148+
<span ng-class="{'redTab':cntl.testResults.redBuilds , 'yellowTab':cntl.testResults.yellowBuilds}">E2E Tests</span>
146149
</md-tab-label>
147150
<md-tab-body>
148151
<md-toolbar class="md-whiteframe-z2">
149152
<h2 class="md-toolbar-tools">End-to-End Results</h2>
150153
</md-toolbar>
151-
<h2 class="md-title" ng-show="cntl.builds.length > 0">Queue-Blocking Builds</h2>
152-
<md-chips ng-model="cntl.builds" readonly="true">
154+
<h2 class="md-title" ng-show="cntl.testResults.blockingBuilds.length > 0">Queue-Blocking Builds</h2>
155+
<md-chips ng-model="cntl.testResults.blockingBuilds" readonly="true">
153156
<md-chip-template title="{{$chip.msg}}">
154157
<span style="color: {{$chip.color}}">{{$chip.state}}</span> <a ng-href="http://ci-test.k8s.io/{{$chip.name}}/{{$chip.id}}/">{{$chip.name}}</a>
155158
<span style="color: {{$chip.color}}">{{$chip.msg}}</span> <span title="Job stability">{{$chip.stability}}</span>
156159
</md-chip-template>
157160
</md-chips>
158-
<h2 class="md-title" ng-show="cntl.nonBlockingBuilds.length > 0">Non-Queue-Blocking Builds</h2>
159-
<md-chips ng-model="cntl.nonBlockingBuilds" readonly="true">
161+
<h2 class="md-title" ng-show="cntl.testResults.nonBlockingBuilds.length > 0">Non-Queue-Blocking Builds</h2>
162+
<md-chips ng-model="cntl.testResults.nonBlockingBuilds" readonly="true">
160163
<md-chip-template title="{{$chip.msg}}">
161164
<span style="color: {{$chip.color}}">{{$chip.state}}</span> <a ng-href="http://ci-test.k8s.io/{{$chip.name}}/{{$chip.id}}/">{{$chip.name}}</a>
162165
<span style="color: {{$chip.color}}">{{$chip.msg}}</span> <span title="Job stability">{{$chip.stability}}</span>

mungegithub/submit-queue/www/script.js

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ app.controller('SQCntl', ['DataService', '$interval', '$location', SQCntl]);
1010
function SQCntl(dataService, $interval, $location) {
1111
var self = this;
1212
self.prs = {};
13-
self.builds = {};
14-
self.nonBlockingBuilds = {};
1513
self.health = {};
14+
self.testResults = {};
1615
self.lastMergeTime = Date();
1716
self.prQuerySearch = prQuerySearch;
1817
self.historyQuerySearch = historyQuerySearch;
@@ -102,8 +101,8 @@ function SQCntl(dataService, $interval, $location) {
102101

103102
// This data is shown in a top banner (when the Queue is blocked),
104103
// so it's always loaded.
105-
refreshGoogleInternalCI();
106-
$interval(refreshGoogleInternalCI, 60000); // Refresh every minute
104+
refreshContinuousTests();
105+
$interval(refreshContinuousTests, 60000); // Refresh every minute
107106

108107
// Request Avatars that are only as large necessary (CSS limits them to 40px)
109108
function fixPRAvatars(prs) {
@@ -166,24 +165,22 @@ function SQCntl(dataService, $interval, $location) {
166165
var percentStable = self.health.NumStable * 100.0 / self.health.TotalLoops;
167166
self.OverallHealth = Math.round(percentStable) + "%";
168167
}
169-
updateBuildStability(self.builds, self.nonBlockingBuilds, self.health);
168+
updateBuildStability(self.testResults.blockingBuilds, self.testResults.nonBlockingBuilds, self.health);
170169
});
171170
}
172171

173-
function refreshGoogleInternalCI() {
172+
function refreshContinuousTests() {
174173
dataService.getData('google-internal-ci').then(function successCallback(response) {
175-
var result = getE2E(response.data);
176-
self.builds = result.builds;
177-
self.nonBlockingBuilds = result.nonBlockingBuilds;
178-
updateBuildStability(self.builds, self.nonBlockingBuilds, self.health);
179-
self.failedBuild = result.failedBuild;
174+
self.testResults = processTests(response.data);
175+
updateBuildStability(self.testResults.blockingBuilds, self.testResults.nonBlockingBuilds, self.health);
180176
});
181177
}
182178

183-
function getE2E(builds) {
184-
var result = [];
179+
function processTests(builds) {
180+
var blockingResult = [];
185181
var nonBlockingResult = [];
186-
var failedBuild = false;
182+
var redBuilds = false;
183+
var yellowBuilds = false;
187184
angular.forEach(builds, function(job, key) {
188185
var obj = {
189186
'name': key,
@@ -199,19 +196,21 @@ function SQCntl(dataService, $interval, $location) {
199196
// red X mark
200197
obj.state = '\u2716';
201198
obj.color = 'red';
202-
failedBuild = true;
199+
redBuilds = true;
203200
break;
204201
case 'Ignorable flake':
205202
// orange X mark
206203
obj.state = '\u2716';
207-
obj.color = 'orange';
204+
obj.color = '#FF8A65';
208205
obj.msg = 'Flake!';
206+
yellowBuilds = true;
209207
break;
210208
case 'Problem Resolved':
211209
// orange X mark
212210
obj.state = '\u2716';
213-
obj.color = 'orange';
211+
obj.color = '#FF8A65';
214212
obj.msg = 'Manual override';
213+
yellowBuilds = true;
215214
break;
216215
case '[nonblocking] Stable':
217216
// green check mark
@@ -222,41 +221,49 @@ function SQCntl(dataService, $interval, $location) {
222221
case '[nonblocking] Not Stable':
223222
// orange X mark
224223
obj.state = '\u2716';
225-
obj.color = 'orange';
224+
obj.color = '#FF8A65';
226225
obj.msg = '[nonblocking]';
227226
break;
228227
case '[nonblocking] Ignorable flake':
229228
// orange X mark
230229
obj.state = '\u2716';
231-
obj.color = 'orange';
232-
obj.msg = '[nonblocking]';
230+
obj.color = '#FF8A65';
231+
obj.msg = '[nonblocking] Flake!';
233232
break;
234233
default:
235234
obj.state = 'Error';
236235
obj.color = 'red';
237236
obj.msg = job.Status;
238-
failedBuild = true;
237+
redBuilds = true;
239238
}
240239
obj.stability = '';
241240
if (!obj.msg) {
242-
result.push(obj);
241+
blockingResult.push(obj);
243242
} else {
244243
if (obj.msg.includes('[nonblocking]')) {
245244
obj.msg = obj.msg.replace('[nonblocking]', '');
246245
nonBlockingResult.push(obj);
247246
} else {
248-
result.push(obj);
247+
blockingResult.push(obj);
249248
}
250249
}
251250
});
251+
if (redBuilds) {
252+
yellowBuilds = false;
253+
}
252254
return {
253-
builds: result,
255+
blockingBuilds: blockingResult,
254256
nonBlockingBuilds: nonBlockingResult,
255-
failedBuild: failedBuild,
257+
yellowBuilds: yellowBuilds,
258+
redBuilds: redBuilds,
256259
};
257260
}
258261

259262
function updateBuildStabilityHelper(builds, health) {
263+
if (builds === undefined || Object.keys(builds).length === 0 ||
264+
health.TotalLoops === 0 || health.NumStablePerJob === undefined) {
265+
return;
266+
}
260267
angular.forEach(builds, function(build) {
261268
var key = build.name;
262269
if (key in self.health.NumStablePerJob) {
@@ -266,12 +273,8 @@ function SQCntl(dataService, $interval, $location) {
266273
});
267274
}
268275

269-
function updateBuildStability(builds, nonBlockingBuilds, health) {
270-
if (Object.keys(builds).length === 0 ||
271-
health.TotalLoops === 0 || health.NumStablePerJob === undefined) {
272-
return;
273-
}
274-
updateBuildStabilityHelper(builds, health);
276+
function updateBuildStability(blockingBuilds, nonBlockingBuilds, health) {
277+
updateBuildStabilityHelper(blockingBuilds, health);
275278
updateBuildStabilityHelper(nonBlockingBuilds, health);
276279
}
277280

mungegithub/submit-queue/www/style.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ md-list-item > .md-avatar img {
1313
width: 40px;
1414
}
1515

16+
.yellowTab {
17+
padding: 14px;
18+
background-color: #FF8A65;
19+
color: black;
20+
}
21+
1622
.redTab {
1723
padding: 14px;
18-
background-color: #F44336;
24+
background-color: #F4511E;
1925
color: white;
2026
}

0 commit comments

Comments
 (0)