From 59a11995b38116a71a565da32dce3c83b79e1166 Mon Sep 17 00:00:00 2001 From: Konstantin Raev Date: Thu, 14 Apr 2016 04:28:13 -0700 Subject: [PATCH] increased timeout for ios e2e test and fixed --js e2e after ios e2e Summary:Packager usually builds within 250 seconds and sometimes misses test timeout. Also added non-persistent option to make it build faster. Should be fine because we don't test live reloading in ios Closes https://github.com/facebook/react-native/pull/6974 Differential Revision: D3178884 fb-gh-sync-id: e9bf75456f1cf480ffea6aa2c769550b40eb3d32 fbshipit-source-id: e9bf75456f1cf480ffea6aa2c769550b40eb3d32 --- local-cli/generator-ios/templates/tests/Tests.m | 2 +- scripts/run-ci-e2e-tests.js | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/local-cli/generator-ios/templates/tests/Tests.m b/local-cli/generator-ios/templates/tests/Tests.m index ecb0d881f0c..0b1e61a65b3 100644 --- a/local-cli/generator-ios/templates/tests/Tests.m +++ b/local-cli/generator-ios/templates/tests/Tests.m @@ -13,7 +13,7 @@ #import "RCTLog.h" #import "RCTRootView.h" -#define TIMEOUT_SECONDS 240 +#define TIMEOUT_SECONDS 600 #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" @interface <%= name %>Tests : XCTestCase diff --git a/scripts/run-ci-e2e-tests.js b/scripts/run-ci-e2e-tests.js index 3ffe396ddac..9c7af063e46 100644 --- a/scripts/run-ci-e2e-tests.js +++ b/scripts/run-ci-e2e-tests.js @@ -151,26 +151,28 @@ if (args.indexOf('--ios') !== -1) { // shelljs exec('', {async: true}) does not emit stdout events, so we rely on good old spawn let packagerEnv = Object.create(process.env); packagerEnv.REACT_NATIVE_MAX_WORKERS = 1; - const packagerProcess = spawn('npm', ['start'], + const packagerProcess = spawn('npm', ['start', '--', '--non-persistent'], { stdio: 'inherit', env: packagerEnv }); SERVER_PID = packagerProcess.pid; echo(`Starting packager server, ${SERVER_PID}`); - exec('sleep 5s'); - // prepare cache to reduce chances of possible red screen "Can't fibd variable __fbBatchedBridge..." - exec('response=$(curl --write-out %{http_code} --silent --output /dev/null localhost:8081/index.ios.bundle?platform=ios)'); echo('Executing ios e2e test'); if (exec('xctool -scheme EndToEndTest -sdk iphonesimulator test').code) { exit(cleanup(1)); } + cd('..'); } if (args.indexOf('--js') !== -1) { // Check the packager produces a bundle (doesn't throw an error) if (exec('react-native bundle --platform android --dev true --entry-file index.android.js --bundle-output android-bundle.js').code) { - echo('Could not build package'); + echo('Could not build android package'); + exit(cleanup(1)); + } + if (exec('react-native bundle --platform ios --dev true --entry-file index.ios.js --bundle-output ios-bundle.js').code) { + echo('Could not build ios package'); exit(cleanup(1)); } if (exec(`${ROOT}/node_modules/.bin/flow check`).code) {