Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: Tools/GardeningServer/model/ct-failure-group.html

Issue 546433003: Add failed_once category to Sheriff-O-Matic. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: bail loop early, rebased, and fixed style for new text Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Tools/GardeningServer/model/test/ct-failure-group-tests.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!-- 1 <!--
2 Copyright 2014 The Chromium Authors. All rights reserved. 2 Copyright 2014 The Chromium Authors. All rights reserved.
3 Use of this source code is governed by a BSD-style license that can be 3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file. 4 found in the LICENSE file.
5 --> 5 -->
6 6
7 <link rel="import" href="ct-commit-list.html"> 7 <link rel="import" href="ct-commit-list.html">
8 8
9 <script> 9 <script>
10 function CTFailureGroup(key, data) { 10 function CTFailureGroup(key, data) {
(...skipping 26 matching lines...) Expand all
37 bug: bug, 37 bug: bug,
38 }); 38 });
39 }; 39 };
40 40
41 CTFailureGroup.prototype.clearBug = function(bug) { 41 CTFailureGroup.prototype.clearBug = function(bug) {
42 return this._annotate({ 42 return this._annotate({
43 bug: undefined, 43 bug: undefined,
44 }); 44 });
45 }; 45 };
46 46
47 CTFailureGroup.prototype._failedOnce = function() {
48 var totalFailures = 0;
49 for (var i = 0; i < this.data.dataToExamine().length; i++) {
50 var resultNodes = this.data.dataToExamine()[i].resultNodesByBuilder;
51 Object.keys(resultNodes, function(r) {
52 totalFailures += resultNodes[r].failingBuildCount;
53 if (totalFailures > 1)
54 return false;
55 }.bind(this));
56 }
57 return totalFailures == 1;
58 }
59
47 CTFailureGroup.prototype._computeProperties = function() { 60 CTFailureGroup.prototype._computeProperties = function() {
48 this.isSnoozed = Date.now() < this._annotation.snoozeTime; 61 this.isSnoozed = Date.now() < this._annotation.snoozeTime;
49 if (this.isSnoozed) { 62 if (this.isSnoozed) {
50 this.category = 'snoozed'; 63 this.category = 'snoozed';
51 } else { 64 } else {
65 if (this._failedOnce()) {
66 this.category = 'failedOnce';
67 } else {
68 this.category = 'default';
69 }
52 // FIXME: crbug.com/400397 Split into: Whole step failure, Tree closer, Test failure, Flaky tests 70 // FIXME: crbug.com/400397 Split into: Whole step failure, Tree closer, Test failure, Flaky tests
53 this.category = 'default';
54 } 71 }
55 72
56 this.bug = this._annotation.bug; 73 this.bug = this._annotation.bug;
57 // FIXME: Bug labels would be simpler to implement as a filter in the UI. 74 // FIXME: Bug labels would be simpler to implement as a filter in the UI.
58 if (this.bug != null) 75 if (this.bug != null)
59 this.bugLabel = 'Bug ' + /([0-9]{3,})/.exec(this.bug)[0]; 76 this.bugLabel = 'Bug ' + /([0-9]{3,})/.exec(this.bug)[0];
60 else 77 else
61 this.bugLabel = undefined; 78 this.bugLabel = undefined;
62 }; 79 };
63 80
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 }.bind(this)); 126 }.bind(this));
110 }; 127 };
111 128
112 CTFailureGroup.fetchAnnotations = function() { 129 CTFailureGroup.fetchAnnotations = function() {
113 // FIXME: Fetch annotations from frontend. 130 // FIXME: Fetch annotations from frontend.
114 var stored = localStorage.CTFailureGroupAnnotations; 131 var stored = localStorage.CTFailureGroupAnnotations;
115 var annotations = stored ? JSON.parse(stored) : {}; 132 var annotations = stored ? JSON.parse(stored) : {};
116 return Promise.resolve(annotations); 133 return Promise.resolve(annotations);
117 }; 134 };
118 </script> 135 </script>
OLDNEW
« no previous file with comments | « no previous file | Tools/GardeningServer/model/test/ct-failure-group-tests.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698