mirror of
https://github.com/dart-lang/sdk
synced 2024-09-04 16:03:44 +00:00
[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:
parent
2b22c37be7
commit
af7270cb23
|
@ -10,6 +10,8 @@ import 'dart:io';
|
||||||
|
|
||||||
import 'results.dart';
|
import 'results.dart';
|
||||||
|
|
||||||
|
const skipped = 'skipped';
|
||||||
|
|
||||||
main(List<String> args) async {
|
main(List<String> args) async {
|
||||||
final resultsPath = args[0];
|
final resultsPath = args[0];
|
||||||
final priorResultsPath = args[1];
|
final priorResultsPath = args[1];
|
||||||
|
@ -28,6 +30,11 @@ main(List<String> args) async {
|
||||||
final firstPriorResult =
|
final firstPriorResult =
|
||||||
priorResults.isEmpty ? null : priorResults.values.first;
|
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) {
|
for (final String key in results.keys) {
|
||||||
final Map<String, dynamic> result = results[key];
|
final Map<String, dynamic> result = results[key];
|
||||||
final Map<String, dynamic> priorResult = priorResults[key];
|
final Map<String, dynamic> priorResult = priorResults[key];
|
||||||
|
@ -57,3 +64,18 @@ main(List<String> args) async {
|
||||||
}
|
}
|
||||||
sink.close();
|
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': '',
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in a new issue