From af7270cb237a823f218028418123b18d56d8a7f7 Mon Sep 17 00:00:00 2001 From: William Hesse Date: Fri, 14 Feb 2020 13:25:25 +0000 Subject: [PATCH] [infra] Construct 'not run' records in results.json when tests disappear Cloud functions and test results app need to handle these new results before the CL can be landed. Bug: https://github.com/dart-lang/dart_ci/issues/72 Change-Id: I64d9238767f0a5aea41e4b7524120bd58a5bf625 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134324 Commit-Queue: William Hesse Reviewed-by: Alexander Thomas --- tools/bots/extend_results.dart | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tools/bots/extend_results.dart b/tools/bots/extend_results.dart index d00c0cdb53f..f8ba5c1b69c 100644 --- a/tools/bots/extend_results.dart +++ b/tools/bots/extend_results.dart @@ -10,6 +10,8 @@ import 'dart:io'; import 'results.dart'; +const skipped = 'skipped'; + main(List args) async { final resultsPath = args[0]; final priorResultsPath = args[1]; @@ -28,6 +30,11 @@ main(List args) async { final firstPriorResult = priorResults.isEmpty ? null : priorResults.values.first; + priorResults.forEach((key, priorResult) { + if (priorResult['result'] != skipped) { + results.putIfAbsent(key, () => constructNotRunResult(priorResult)); + } + }); for (final String key in results.keys) { final Map result = results[key]; final Map priorResult = priorResults[key]; @@ -57,3 +64,18 @@ main(List args) async { } sink.close(); } + +Map constructNotRunResult(Map previous) => { + for (final key in [ + 'name', + 'configuration', + 'suite', + 'test_name', + 'expected' + ]) + key: previous[key], + 'time_ms': 0, + 'result': skipped, + 'matches': true, + 'bot_name': '', + };