Use package:testing for tools/gardening

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2999043003 .
This commit is contained in:
Johnni Winther 2017-08-16 15:55:49 +02:00
parent 6a958b3edb
commit f1b3a59da3
13 changed files with 63 additions and 9 deletions

5
pkg/testing/pubspec.yaml Normal file
View file

@ -0,0 +1,5 @@
# This pubspec is currently mainly used to make it easier to develop by making
# it a package.
name: testing
#version: do-not-upload
dependencies:

View file

@ -0,0 +1,9 @@
# Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
analyzer:
strong-mode: true
errors:
# Allow having TODOs in the code
todo: ignore

View file

@ -13,7 +13,7 @@ import 'summary.dart' as summary;
typedef Future MainFunction(List<String> args);
help(List<String> args) async {
Future help(List<String> args) async {
if (args.length == 1 && args[0] == "--help") {
print("This help");
return null;

View file

@ -6,6 +6,7 @@
///
/// Use this to detect flakiness of failures, especially timeouts.
import 'dart:async';
import 'dart:io';
import 'package:args/args.dart';
@ -26,7 +27,7 @@ void help(ArgParser argParser) {
print(argParser.usage);
}
main(List<String> args) async {
Future main(List<String> args) async {
ArgParser argParser = createArgParser();
argParser.addOption("run-count",
defaultsTo: "10", help: "How many previous runs should be fetched");

View file

@ -8,6 +8,7 @@
/// The results are currently pulled from the second to last build since the
/// last build might not have completed yet.
import 'dart:async';
import 'dart:math' hide log;
import 'dart:io';
@ -27,7 +28,7 @@ void help(ArgParser argParser) {
print(argParser.usage);
}
main(List<String> args) async {
Future main(List<String> args) async {
ArgParser argParser = createArgParser();
argParser.addOption('group',
help: "Restricts the build groups\n"

View file

@ -9,6 +9,7 @@
// Example: `bin/find_shard.dart precomp-linux-debug-x64-be`
// prints `vm-precomp(5): precomp-linux-debug-x64-be`.
import 'dart:async';
import 'dart:io';
import 'package:args/args.dart';
import 'package:gardening/src/shard_data.dart';
@ -54,7 +55,7 @@ bool shard_enabled(String shard) {
return true;
}
main(List<String> args) async {
Future main(List<String> args) async {
ArgParser argParser = createArgParser();
argParser.addFlag("include-dev",
abbr: "d",

View file

@ -21,7 +21,7 @@ void help(ArgParser argParser) {
print(argParser.usage);
}
main(List<String> args) async {
Future main(List<String> args) async {
ArgParser argParser = createArgParser();
ArgResults argResults = argParser.parse(args);
processArgResults(argResults);

View file

@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:async';
import 'package:args/args.dart';
import 'package:gardening/src/bot.dart';
import 'package:gardening/src/buildbot_data.dart';
@ -16,7 +17,7 @@ void help(ArgParser argParser) {
print(argParser.usage);
}
main(List<String> args) async {
Future main(List<String> args) async {
ArgParser argParser = createArgParser();
ArgResults argResults = argParser.parse(args);
processArgResults(argResults);

View file

@ -5,4 +5,6 @@ name: gardening
dependencies:
args:
expect:
path: ../../pkg/expect/
path: ../../pkg/expect/
testing:
path: ../../pkg/testing/

View file

@ -18,7 +18,6 @@ import 'package:gardening/src/util.dart';
import 'test_client.dart';
// TODO(johnniwinther): Use 'package:testing' to run all tests.
main(List<String> args) async {
ArgParser argParser = createArgParser();
argParser.addFlag('force', abbr: 'f');

View file

@ -0,0 +1,3 @@
# Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE.md file.

View file

@ -9,7 +9,6 @@ import 'package:gardening/src/util.dart';
import 'test_client.dart';
// TODO(johnniwinther): Use 'package:testing' to run all tests.
main(List<String> args) async {
ArgParser argParser = createArgParser();
argParser.addFlag('force', abbr: 'f');

View file

@ -0,0 +1,33 @@
{
"":"Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file",
"":"for details. All rights reserved. Use of this source code is governed by a",
"":"BSD-style license that can be found in the LICENSE.md file.",
"packages": ".packages",
"suites": [
{
"name": "dart_vm",
"kind": "Chain",
"source": "package:testing/dart_vm_suite.dart",
"path": "test/",
"status": "test/gardening.status",
"pattern": [
"\\_test.dart$"
],
"exclude": [
"buildbot_data_test.dart"
]
}
],
"analyze": {
"options": "analysis_options.yaml",
"uris": [
"bin/",
"lib/",
"test/"
]
}
}