Skip to content

Commit

Permalink
[infra] Fix warning when pre-approving an already approved failure.
Browse files Browse the repository at this point in the history
This can happen if a test is approved as failing, it then is fixed, and a
changelist needs to break it again, and the new failure is pre-approved.
This causes approve_results to warn that it can't properly change an approval
from one outcome to the exact same outcome, which is of course wrong, it can
do that.

Change-Id: Ib9ea1d4ea5a204b66808a1789c31fe6ec9c2c9d2
Reviewed-on: https://dart-review.googlesource.com/c/86920
Reviewed-by: William Hesse <whesse@google.com>
  • Loading branch information
sortie committed Dec 11, 2018
1 parent b924d75 commit 4d63202
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tools/approve_results.dart
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,14 @@ Future<List<Test>> loadResultsFromBot(String bot, ArgResults options,
// there is no approved result yet, use the latest result from the
// builder instead.
final baseResult = approvedResult ?? result;
if ((!wasFlake &&
if (!wasFlake &&
!tryResult["matches"] &&
tryResult["result"] != result["result"])) {
tryResult["result"] != result["result"]) {
// The approved_results.json format currently does not natively
// support preapproval, so preapproving turning one failure into
// another will turn the builder in question red until the CL lands.
if (!baseResult["matches"]) {
if (!baseResult["matches"] &&
tryResult["result"] != baseResult["result"]) {
print("Warning: Preapproving changed failure modes will turn the "
"CI red until the CL is submitted: $bot: $key: "
"${baseResult["result"]} -> ${tryResult["result"]}");
Expand Down

0 comments on commit 4d63202

Please sign in to comment.