Make sure ios tests fail if they fail (flutter/engine#20518)

* Make sure ios tests fail if they fail

* explain
This commit is contained in:
Dan Field 2020-08-14 10:11:37 -07:00 committed by GitHub
parent f117f6f780
commit 4d8aaaa337
2 changed files with 7 additions and 8 deletions

View File

@ -8,9 +8,6 @@ if [ $# -eq 1 ]; then
FLUTTER_ENGINE=$1
fi
set -o pipefail && xcodebuild -sdk iphonesimulator \
-scheme IosUnitTests \
-destination 'platform=iOS Simulator,name=iPhone 8' \
test \
FLUTTER_ENGINE=$FLUTTER_ENGINE
../../run_tests.py --variant $FLUTTER_ENGINE --type objc --ios-variant $FLUTTER_ENGINE
popd

View File

@ -370,17 +370,19 @@ def RunObjcTests(ios_variant='ios_debug_sim_unopt'):
ios_out_dir = os.path.join(out_dir, ios_variant)
EnsureIosTestsAreBuilt(ios_out_dir)
pretty = "cat" if subprocess.call(["which", "xcpretty"]) else "xcpretty"
ios_unit_test_dir = os.path.join(buildroot_dir, 'flutter', 'testing', 'ios', 'IosUnitTests')
# Avoid using xcpretty unless the following can be addressed:
# - Make sure all relevant failure output is printed on a failure.
# - Make sure that a failing exit code is set for CI.
# See https://github.com/flutter/flutter/issues/63742
command = [
'xcodebuild '
'-sdk iphonesimulator '
'-scheme IosUnitTests '
"-destination platform='iOS Simulator,name=iPhone 8' "
'test '
'FLUTTER_ENGINE=' + ios_variant +
' | ' + pretty
'FLUTTER_ENGINE=' + ios_variant
]
RunCmd(command, cwd=ios_unit_test_dir, shell=True)