Commit 84bdb326 authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

dev/bots/test.sh += robustness (#4682)

parent bf740cf4
#!/bin/bash #!/bin/bash
set -ex
export PATH="$PWD/bin:$PWD/bin/cache/dart-sdk/bin:$PATH" export PATH="$PWD/bin:$PWD/bin/cache/dart-sdk/bin:$PATH"
die() { trap detect_error_on_exit EXIT HUP INT QUIT TERM
detect_error_on_exit() {
exit_code=$?
set +x set +x
echo "Error: script exited early due to error" if [[ $exit_code -ne 0 ]]; then
exit 1 echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Error: script exited early due to error ($exit_code)"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
fi
} }
set -ex
# analyze all the Dart code in the repo # analyze all the Dart code in the repo
flutter analyze --flutter-repo flutter analyze --flutter-repo
# verify that the tests actually return failure on failure and success on success # 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) || die (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) || die (cd dev/automated_tests; flutter test test_smoke_test/pass_test.dart > /dev/null)
# run tests # run tests
(cd packages/flutter; flutter test) (cd packages/flutter; flutter test)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment