[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 <whesse@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
This commit is contained in:
William Hesse 2020-02-14 13:25:25 +00:00 committed by commit-bot@chromium.org
parent 2b22c37be7
commit af7270cb23

View file

@ -10,6 +10,8 @@ import 'dart:io';
import 'results.dart';
const skipped = 'skipped';
main(List<String> args) async {
final resultsPath = args[0];
final priorResultsPath = args[1];
@ -28,6 +30,11 @@ main(List<String> 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<String, dynamic> result = results[key];
final Map<String, dynamic> priorResult = priorResults[key];
@ -57,3 +64,18 @@ main(List<String> args) async {
}
sink.close();
}
Map<String, dynamic> constructNotRunResult(Map<String, dynamic> previous) => {
for (final key in [
'name',
'configuration',
'suite',
'test_name',
'expected'
])
key: previous[key],
'time_ms': 0,
'result': skipped,
'matches': true,
'bot_name': '',
};