Travis CI reliability fixes: preload package manager and increase tim…

Summary:
- Consolidate common code in iOS and tvOS test scripts
- Start the packager before starting tests, to improve reliability
- Increase timeout value in RCTTestRunner.m
Closes https://github.com/facebook/react-native/pull/10378

Differential Revision: D4028364

Pulled By: bestander

fbshipit-source-id: 24c2124a1c62643a02f0668b60a67b971e08d1a3
This commit is contained in:
dlowder-salesforce
2016-10-16 15:43:44 -07:00
committed by Facebook Github Bot
parent f8b0728d9b
commit 64a4c6070d
13 changed files with 187 additions and 56 deletions
+12 -12
View File
@@ -1,11 +1,18 @@
#!/bin/bash
set -ex
# This script contains common code to be run from scripts/objc-test-ios.sh or scripts/objc-test-tvos.sh
SCRIPTS=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
ROOT=$(dirname $SCRIPTS)
cd $ROOT
# Start the packager and preload the UIExplorerApp bundle for better performance in integration tests
open "./packager/launchPackager.command" || echo "Can't start packager automatically"
sleep 20
curl 'http://localhost:8081/Examples/UIExplorer/js/UIExplorerApp.ios.bundle?platform=ios&dev=true' -o temp.bundle
rm temp.bundle
curl 'http://localhost:8081/Examples/UIExplorer/js/UIExplorerApp.ios.bundle?platform=ios&dev=true&minify=false' -o temp.bundle
rm temp.bundle
curl 'http://localhost:8081/IntegrationTests/IntegrationTestsApp.bundle?platform=ios&dev=true' -o temp.bundle
rm temp.bundle
curl 'http://localhost:8081/IntegrationTests/RCTRootViewIntegrationTestApp.bundle?platform=ios&dev=true' -o temp.bundle
rm temp.bundle
function cleanup {
EXIT_CODE=$?
@@ -21,13 +28,6 @@ function cleanup {
}
trap cleanup EXIT
XCODE_PROJECT="Examples/UIExplorer/UIExplorer.xcodeproj"
XCODE_SCHEME="UIExplorer"
XCODE_SDK="iphonesimulator"
if [ -z "$XCODE_DESTINATION" ]; then
XCODE_DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=10.0"
fi
# Support for environments without xcpretty installed
set +e
OUTPUT_TOOL=$(which xcpretty)