Also, make sure that broken tests actually break the bots.

And add a test to make sure that keeps happening.
This commit is contained in:
Ian Hickson
2016-05-17 12:45:37 -07:00
parent c192a7e4ca
commit f284c1a049
13 changed files with 88 additions and 30 deletions

View File

@@ -180,6 +180,7 @@ Future<Null> _exit(int code) async {
// Give the task / timer queue one cycle through before we hard exit.
await Timer.run(() {
printTrace('exiting with code $code');
exit(code);
});
}

View File

@@ -56,8 +56,14 @@ class TestCommand extends FlutterCommand {
Future<int> _runTests(List<String> testArgs, Directory testDirectory) async {
Directory currentDirectory = Directory.current;
try {
Directory.current = testDirectory;
return await executable.main(testArgs);
if (testDirectory != null) {
printTrace('switching to directory $testDirectory to run tests');
Directory.current = testDirectory;
}
printTrace('running test package with arguments: $testArgs');
await executable.main(testArgs);
printTrace('test package returned with exit code $exitCode');
return exitCode;
} finally {
Directory.current = currentDirectory;
}
@@ -70,9 +76,10 @@ class TestCommand extends FlutterCommand {
if (!projectRootValidator())
return 1;
Directory testDir = _currentPackageTestDir;
Directory testDir;
if (testArgs.isEmpty) {
testDir = _currentPackageTestDir;
if (!testDir.existsSync()) {
printError("Test directory '${testDir.path}' not found.");
return 1;