Skip to content

Clean up test infrastructure #41880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,105 changes: 540 additions & 565 deletions .cirrus.yml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dev/README.md
Original file line number Diff line number Diff line change
@@ -2,3 +2,6 @@ This directory contains tools and resources that the Flutter team uses
during development of the framework. The tools in this directory
should not be necessary for developing Flutter applications, though of
course they may be interesting if you are curious.

The tests in this directory are run in the `framework_tests_misc-*`
shards.
Original file line number Diff line number Diff line change
@@ -1,31 +1,19 @@
#!/bin/bash
set -e

# This script is only meant to be run by the Cirrus CI system, not locally.
# It must be run from the root of the Flutter repo.

function error() {
echo "$@" 1>&2
}

# This script is only meant to be run by the Cirrus CI system, not locally.
# It must be run from the root of the Flutter repo.

function accept_android_licenses() {
yes "y" | flutter doctor --android-licenses > /dev/null 2>&1
}

echo "Flutter SDK directory is: $PWD"

# Run flutter to download dependencies and precompile things, and to disable
# analytics on the bots.
echo "Downloading build dependencies and pre-compiling Flutter snapshot"
./bin/flutter config --no-analytics

# Run doctor, to print it to the log for debugging purposes.
./bin/flutter doctor -v

# Accept licenses.
echo "Accepting Android licenses."
accept_android_licenses || (error "Accepting Android licenses failed." && false)

# Run pub get in all the repo packages.
echo "Updating packages for Flutter."
./bin/flutter update-packages
148 changes: 75 additions & 73 deletions dev/bots/deploy_gallery.sh
Original file line number Diff line number Diff line change
@@ -24,88 +24,90 @@ set -x

cd "$FLUTTER_ROOT"

if [[ "$SHARD" = "deploy_gallery" ]]; then
version="$(<version)"
if [[ "$OS" == "linux" ]]; then
echo "Building Flutter Gallery $version for Android..."

# ANDROID_SDK_ROOT must be set in the env.
(
cd examples/flutter_gallery
flutter build apk --release -t lib/main_publish.dart
)
echo "Android Flutter Gallery built"
if [[ -z "$CIRRUS_PR" && "$CIRRUS_BRANCH" == "dev" && "$version" != *"pre"* ]]; then
echo "Deploying Flutter Gallery $version to Play Store..."
set +x # Don't echo back the below.
if [ -n "$ANDROID_GALLERY_UPLOAD_KEY" ]; then
echo "$ANDROID_GALLERY_UPLOAD_KEY" | base64 --decode > /root/.android/debug.keystore
fi
set -x
(
cd examples/flutter_gallery/android
fastlane deploy_play_store
)
else
echo "Not deployed: Flutter Gallery is only deployed to the Play Store on merged and tagged dev branch commits"
version="$(<version)"
if [[ "$OS" == "linux" ]]; then
echo "Building Flutter Gallery $version for Android..."
# ANDROID_SDK_ROOT must be set in the env.
(
cd examples/flutter_gallery
flutter build apk --release -t lib/main_publish.dart
)
echo "Android Flutter Gallery built"
if [[ -z "$CIRRUS_PR" && "$CIRRUS_BRANCH" == "dev" && "$version" != *"pre"* ]]; then
echo "Deploying Flutter Gallery $version to Play Store..."
set +x # Don't echo back the below.
if [ -n "$ANDROID_GALLERY_UPLOAD_KEY" ]; then
echo "$ANDROID_GALLERY_UPLOAD_KEY" | base64 --decode > /root/.android/debug.keystore
fi
elif [[ "$OS" == "darwin" ]]; then
echo "Building Flutter Gallery $version for iOS..."
set -x
(
cd examples/flutter_gallery
flutter build ios --release --no-codesign -t lib/main_publish.dart
cd examples/flutter_gallery/android
fastlane deploy_play_store
)
else
echo "(Not deploying; Flutter Gallery is only deployed to Play store for tagged dev branch commits.)"
fi
elif [[ "$OS" == "darwin" ]]; then
echo "Building Flutter Gallery $version for iOS..."
(
cd examples/flutter_gallery
flutter build ios --release --no-codesign -t lib/main_publish.dart

# flutter build ios will run CocoaPods script. Check generated locations.
if [[ ! -d "ios/Pods" ]]; then
echo "Error: pod install failed to setup plugins"
exit 1
fi
# flutter build ios will run CocoaPods script. Check generated locations.
if [[ ! -d "ios/Pods" ]]; then
echo "Error: pod install failed to setup plugins"
exit 1
fi

if [[ ! -d "ios/.symlinks/plugins" ]]; then
echo "Error: pod install failed to setup plugin symlinks"
exit 1
fi
if [[ ! -d "ios/.symlinks/plugins" ]]; then
echo "Error: pod install failed to setup plugin symlinks"
exit 1
fi

if [[ -d "ios/.symlinks/flutter" ]]; then
echo "Error: pod install created flutter symlink"
exit 1
fi
if [[ -d "ios/.symlinks/flutter" ]]; then
echo "Error: pod install created flutter symlink"
exit 1
fi

if [[ ! -d "build/ios/iphoneos/Runner.app/Frameworks/App.framework/flutter_assets" ]]; then
echo "Error: flutter_assets not assembled"
exit 1
fi
if [[ ! -d "build/ios/iphoneos/Runner.app/Frameworks/App.framework/flutter_assets" ]]; then
echo "Error: flutter_assets not assembled"
exit 1
fi

if [[
-d "build/ios/iphoneos/Runner.app/Frameworks/App.framework/flutter_assets/isolate_snapshot_data" ||
-d "build/ios/iphoneos/Runner.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin" ||
-d "build/ios/iphoneos/Runner.app/Frameworks/App.framework/flutter_assets/vm_snapshot_data"
]]; then
echo "Error: compiled debug version of app with --release flag"
exit 1
fi
)
echo "iOS Flutter Gallery built"
if [[ -z "$CIRRUS_PR" ]]; then
if [[ "$CIRRUS_BRANCH" == "dev" && "$version" != *"pre"* ]]; then
echo "Archiving with distribution profile and deploying to TestFlight..."
(
cd examples/flutter_gallery/ios
export DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS="-t DAV"
fastlane build_and_deploy_testflight upload:true
)
else
echo "Archiving with distribution profile..."
(
cd examples/flutter_gallery/ios
fastlane build_and_deploy_testflight
)
echo "Archive is only deployed to TestFlight on tagged dev branch commits"
fi
if [[
-d "build/ios/iphoneos/Runner.app/Frameworks/App.framework/flutter_assets/isolate_snapshot_data" ||
-d "build/ios/iphoneos/Runner.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin" ||
-d "build/ios/iphoneos/Runner.app/Frameworks/App.framework/flutter_assets/vm_snapshot_data"
]]; then
echo "Error: compiled debug version of app with --release flag"
exit 1
fi
)
echo "iOS Flutter Gallery built"
if [[ -z "$CIRRUS_PR" ]]; then
if [[ "$CIRRUS_BRANCH" == "dev" && "$version" != *"pre"* ]]; then
echo "Archiving with distribution profile and deploying to TestFlight..."
(
cd examples/flutter_gallery/ios
export DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS="-t DAV"
fastlane build_and_deploy_testflight upload:true
)
else
echo "Not deployed: Flutter Gallery is only deployed to TestFlight on merged and tagged dev branch commits"
# On iOS the signing can break as well, so we verify this regularly (not just
# on tagged dev branch commits). We can only do this post-merge, though, because
# the secrets aren't available on PRs.
echo "Testing archiving with distribution profile..."
(
cd examples/flutter_gallery/ios
fastlane build_and_deploy_testflight
)
echo "(Not deploying; Flutter Gallery is only deployed to TestFlight for tagged dev branch commits.)"
fi
else
echo "(Not archiving or deploying; Flutter Gallery archiving is only tested post-commit.)"
fi
else
echo "Doing nothing: not on the 'deploy_gallery' SHARD."
echo "Unknown OS: $OS"
echo "Aborted."
exit 1
fi
5 changes: 0 additions & 5 deletions dev/bots/run_command.dart
Original file line number Diff line number Diff line change
@@ -95,7 +95,6 @@ Future<void> runCommand(String executable, List<String> arguments, {
OutputMode outputMode = OutputMode.print,
CapturedOutput output,
bool skip = false,
bool expectFlaky = false,
bool Function(String) removeLine,
}) async {
assert((outputMode == OutputMode.capture) == (output != null),
@@ -145,10 +144,6 @@ Future<void> runCommand(String executable, List<String> arguments, {
output.stderr = _flattenToString(await savedStderr);
}

// If the test is flaky we don't care about the actual exit.
if (expectFlaky)
return;

if ((exitCode == 0) == expectNonZeroExit || (expectedExitCode != null && exitCode != expectedExitCode)) {
if (failureMessage != null) {
print(failureMessage);
Loading