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

Side by Side Diff: Tools/GardeningServer/scripts/model.js

Issue 405853002: Delete dead code now that the polymer port of garden-o-matic is done. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 { 104 {
105 var builders = {}; 105 var builders = {};
106 Object.keys(model.state.resultsByBuilder).forEach(function(builderName) { 106 Object.keys(model.state.resultsByBuilder).forEach(function(builderName) {
107 var results = model.state.resultsByBuilder[builderName]; 107 var results = model.state.resultsByBuilder[builderName];
108 if (parseInt(results.blink_revision) < revision) 108 if (parseInt(results.blink_revision) < revision)
109 builders[builderName] = { actual: 'BUILDING' }; 109 builders[builderName] = { actual: 'BUILDING' };
110 }); 110 });
111 return builders; 111 return builders;
112 }; 112 };
113 113
114 model.latestRevision = function()
115 {
116 return model.state.recentCommits[0].revision;
117 };
118
119 model.latestRevisionWithNoBuildersInFlight = function()
120 {
121 var revision = 0;
122 Object.keys(model.state.resultsByBuilder).forEach(function(builderName) {
123 var results = model.state.resultsByBuilder[builderName];
124 if (!results.blink_revision)
125 return;
126 var testedRevision = parseInt(results.blink_revision);
127 revision = revision ? Math.min(revision, testedRevision) : testedRevisio n;
128 });
129 return revision;
130 }
131
132 model.latestRevisionByBuilder = function()
133 {
134 var revision = {};
135 Object.keys(model.state.resultsByBuilder).forEach(function(builderName) {
136 revision[builderName] = model.state.resultsByBuilder[builderName].blink_ revision;
137 });
138 return revision;
139 }
140
141 model.updateResultsByBuilder = function() 114 model.updateResultsByBuilder = function()
142 { 115 {
143 return results.fetchResultsByBuilder(Object.keys(config.builders)).then(func tion(resultsByBuilder) { 116 return results.fetchResultsByBuilder(Object.keys(config.builders)).then(func tion(resultsByBuilder) {
144 model.state.resultsByBuilder = resultsByBuilder; 117 model.state.resultsByBuilder = resultsByBuilder;
145 }); 118 });
146 }; 119 };
147 120
148 // failureCallback is called multiple times: once for each failure 121 // failureCallback is called multiple times: once for each failure
149 model.analyzeUnexpectedFailures = function(failureCallback) 122 model.analyzeUnexpectedFailures = function(failureCallback)
150 { 123 {
(...skipping 28 matching lines...) Expand all
179 } 152 }
180 153
181 model.state.failureAnalysisByTest[testName] = failureAnalysis; 154 model.state.failureAnalysisByTest[testName] = failureAnalysis;
182 155
183 failureCallback(failureAnalysis, failurePromises.length); 156 failureCallback(failureAnalysis, failurePromises.length);
184 })); 157 }));
185 }); 158 });
186 return Promise.all(failurePromises); 159 return Promise.all(failurePromises);
187 }; 160 };
188 161
189 model.unexpectedFailureInfoForTestName = function(testName)
190 {
191 var resultsByTest = results.unexpectedFailuresByTest(model.state.resultsByBu ilder);
192
193 return Object.keys(resultsByTest[testName]).map(function(builderName) {
194 return results.failureInfoForTestAndBuilder(resultsByTest, testName, bui lderName);
195 });
196 };
197
198 })(); 162 })();
OLDNEW
« no previous file with comments | « Tools/GardeningServer/scripts/config.js ('k') | Tools/GardeningServer/scripts/model_unittests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698