Check exit code for test subprocess (#7269)

This commit is contained in:
Ian Hickson
2016-12-15 13:43:45 -08:00
committed by GitHub
parent 502592e56c
commit 971ca4b835
11 changed files with 320 additions and 168 deletions

View File

@@ -1,2 +1,2 @@
This directory is used by ///flutter/travis/test.sh to verify that
This directory is used by //flutter/dev/bots/test.sh to verify that
`flutter test` actually correctly fails when a test fails.

View File

@@ -0,0 +1,16 @@
// Copyright 2016 The Chromium Authors. 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:io' as system;
import 'package:flutter_test/flutter_test.dart';
// this is a test to make sure our tests consider engine crashes to be failures
// see //flutter/dev/bots/test.sh
void main() {
test('test smoke test -- this test should fail', () async {
system.Process.killPid(system.pid, system.ProcessSignal.SIGSEGV);
});
}

View File

@@ -0,0 +1,12 @@
// Copyright 2016 The Chromium Authors. 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:io' as system;
// this is a test to make sure our tests consider engine crashes to be failures
// see //flutter/dev/bots/test.sh
void main() {
system.Process.killPid(system.pid, system.ProcessSignal.SIGSEGV);
}

View File

@@ -5,7 +5,7 @@
import 'package:flutter_test/flutter_test.dart';
// this is a test to make sure our tests actually catch failures
// see ///flutter/travis/test.sh
// see //flutter/dev/bots/test.sh
void main() {
test('test smoke test -- this test SHOULD FAIL', () async {

View File

@@ -0,0 +1,10 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// this is a test to make sure our tests consider syntax errors to be failures
// see //flutter/dev/bots/test.sh
void main() {
fail(); // inspired by https://github.com/flutter/flutter/issues/2698
}

View File

@@ -5,7 +5,7 @@
import 'package:flutter_test/flutter_test.dart';
// this is a test to make sure our tests actually catch failures
// see ///flutter/travis/test.sh
// see //flutter/dev/bots/test.sh
void main() {
test('test smoke test -- this test should pass', () async {

View File

@@ -0,0 +1,9 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// this is a test to make sure our tests consider syntax errors to be failures
// see //flutter/dev/bots/test.sh
The challenge: demand satisfaction
If they apologize, no need for further action.

View File

@@ -22,6 +22,10 @@ flutter analyze --flutter-repo
# verify that the tests actually return failure on failure and success on success
(cd dev/automated_tests; ! flutter test test_smoke_test/fail_test.dart > /dev/null)
(cd dev/automated_tests; flutter test test_smoke_test/pass_test.dart > /dev/null)
(cd dev/automated_tests; ! flutter test test_smoke_test/crash1_test.dart > /dev/null)
(cd dev/automated_tests; ! flutter test test_smoke_test/crash2_test.dart > /dev/null)
(cd dev/automated_tests; ! flutter test test_smoke_test/syntax_error_test.broken_dart > /dev/null)
(cd dev/automated_tests; ! flutter test test_smoke_test/missing_import_test.broken_dart > /dev/null)
(cd packages/flutter_driver; ! flutter drive --use-existing-app -t test_driver/failure.dart >/dev/null 2>&1)
COVERAGE_FLAG=