@@ -132,7 +132,7 @@ void main() {
132132 '"ResultData":{},'
133133 '"BenchmarkScoreKeys":[]}' ;
134134 fs.file (resultsPath).writeAsStringSync (updateTaskJson);
135- await cocoon.sendTaskStatus (resultsPath: resultsPath);
135+ await cocoon.sendResultsPath (resultsPath: resultsPath);
136136 });
137137
138138 test ('uploads expected update task payload from results file' , () async {
@@ -154,7 +154,7 @@ void main() {
154154 '"ResultData":{"i":0.0,"j":0.0,"not_a_metric":"something"},'
155155 '"BenchmarkScoreKeys":["i","j"]}' ;
156156 fs.file (resultsPath).writeAsStringSync (updateTaskJson);
157- await cocoon.sendTaskStatus (resultsPath: resultsPath);
157+ await cocoon.sendResultsPath (resultsPath: resultsPath);
158158 });
159159
160160 test ('Verify retries for task result upload' , () async {
@@ -186,7 +186,7 @@ void main() {
186186 '"ResultData":{"i":0.0,"j":0.0,"not_a_metric":"something"},'
187187 '"BenchmarkScoreKeys":["i","j"]}' ;
188188 fs.file (resultsPath).writeAsStringSync (updateTaskJson);
189- await cocoon.sendTaskStatus (resultsPath: resultsPath);
189+ await cocoon.sendResultsPath (resultsPath: resultsPath);
190190 });
191191
192192 test ('Verify timeout and retry for task result upload' , () async {
@@ -221,7 +221,7 @@ void main() {
221221 '"ResultData":{"i":0.0,"j":0.0,"not_a_metric":"something"},'
222222 '"BenchmarkScoreKeys":["i","j"]}' ;
223223 fs.file (resultsPath).writeAsStringSync (updateTaskJson);
224- await cocoon.sendTaskStatus (resultsPath: resultsPath);
224+ await cocoon.sendResultsPath (resultsPath: resultsPath);
225225 });
226226
227227 test ('Verify timeout does not trigger for result upload' , () async {
@@ -256,7 +256,7 @@ void main() {
256256 '"ResultData":{"i":0.0,"j":0.0,"not_a_metric":"something"},'
257257 '"BenchmarkScoreKeys":["i","j"]}' ;
258258 fs.file (resultsPath).writeAsStringSync (updateTaskJson);
259- await cocoon.sendTaskStatus (resultsPath: resultsPath);
259+ await cocoon.sendResultsPath (resultsPath: resultsPath);
260260 });
261261
262262 test ('Verify failure without retries for task result upload' , () async {
@@ -288,7 +288,7 @@ void main() {
288288 '"ResultData":{"i":0.0,"j":0.0,"not_a_metric":"something"},'
289289 '"BenchmarkScoreKeys":["i","j"]}' ;
290290 fs.file (resultsPath).writeAsStringSync (updateTaskJson);
291- expect (() => cocoon.sendTaskStatus (resultsPath: resultsPath), throwsA (isA <ClientException >()));
291+ expect (() => cocoon.sendResultsPath (resultsPath: resultsPath), throwsA (isA <ClientException >()));
292292 });
293293
294294 test ('throws client exception on non-200 responses' , () async {
@@ -310,10 +310,10 @@ void main() {
310310 '"ResultData":{"i":0.0,"j":0.0,"not_a_metric":"something"},'
311311 '"BenchmarkScoreKeys":["i","j"]}' ;
312312 fs.file (resultsPath).writeAsStringSync (updateTaskJson);
313- expect (() => cocoon.sendTaskStatus (resultsPath: resultsPath), throwsA (isA <ClientException >()));
313+ expect (() => cocoon.sendResultsPath (resultsPath: resultsPath), throwsA (isA <ClientException >()));
314314 });
315315
316- test ('does not update on non-supported branches' , () async {
316+ test ('does not upload results on non-supported branches' , () async {
317317 // Any network failure would cause the upoad to fail
318318 mockClient = MockClient ((Request request) async => Response ('' , 500 ));
319319
@@ -335,32 +335,7 @@ void main() {
335335 fs.file (resultsPath).writeAsStringSync (updateTaskJson);
336336
337337 // This will fail if it decided to upload results
338- await cocoon.sendTaskStatus (resultsPath: resultsPath);
339- });
340-
341- test ('does not update for staging test' , () async {
342- // Any network failure would cause the upoad to fail
343- mockClient = MockClient ((Request request) async => Response ('' , 500 ));
344-
345- cocoon = Cocoon (
346- serviceAccountTokenPath: serviceAccountTokenPath,
347- fs: fs,
348- httpClient: mockClient,
349- requestRetryLimit: 0 ,
350- );
351-
352- const String resultsPath = 'results.json' ;
353- const String updateTaskJson = '{'
354- '"CommitBranch":"master",'
355- '"CommitSha":"$commitSha ",'
356- '"BuilderName":"Linux_staging_test",'
357- '"NewStatus":"Succeeded",'
358- '"ResultData":{"i":0.0,"j":0.0,"not_a_metric":"something"},'
359- '"BenchmarkScoreKeys":["i","j"]}' ;
360- fs.file (resultsPath).writeAsStringSync (updateTaskJson);
361-
362- // This will fail if it decided to upload results
363- await cocoon.sendTaskStatus (resultsPath: resultsPath);
338+ await cocoon.sendResultsPath (resultsPath: resultsPath);
364339 });
365340 });
366341
0 commit comments