2016-05-04 15:57:42 +00:00
|
|
|
#!/bin/bash
|
2018-09-07 20:08:05 +00:00
|
|
|
# Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
#
|
|
|
|
# This source code is licensed under the MIT license found in the
|
|
|
|
# LICENSE file in the root directory of this source tree.
|
|
|
|
#
|
2016-05-04 15:57:42 +00:00
|
|
|
# Runs all Android integration tests locally.
|
|
|
|
# See http://facebook.github.io/react-native/docs/testing.html
|
|
|
|
|
2016-12-14 01:07:13 +00:00
|
|
|
source $(dirname $0)/validate-android-sdk.sh
|
|
|
|
source $(dirname $0)/validate-android-test-env.sh
|
|
|
|
source $(dirname $0)/validate-android-device-env.sh
|
2016-05-05 15:17:02 +00:00
|
|
|
|
2016-12-14 01:07:13 +00:00
|
|
|
set -e
|
2016-05-04 15:57:42 +00:00
|
|
|
|
|
|
|
echo "Compiling native code..."
|
|
|
|
./gradlew :ReactAndroid:packageReactNdkLibsForBuck
|
2016-12-14 01:07:13 +00:00
|
|
|
|
2016-05-04 15:57:42 +00:00
|
|
|
echo "Building JS bundle..."
|
|
|
|
node local-cli/cli.js bundle --platform android --dev true --entry-file ReactAndroid/src/androidTest/js/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js
|
2016-12-14 01:07:13 +00:00
|
|
|
|
2016-05-04 15:57:42 +00:00
|
|
|
echo "Installing test app on the device..."
|
2016-05-05 15:17:02 +00:00
|
|
|
buck fetch ReactAndroid/src/androidTest/buck-runner:instrumentation-tests
|
2016-05-04 15:57:42 +00:00
|
|
|
buck install ReactAndroid/src/androidTest/buck-runner:instrumentation-tests
|
2016-12-14 01:07:13 +00:00
|
|
|
|
2016-05-04 15:57:42 +00:00
|
|
|
echo "Running integration tests..."
|
2017-03-13 20:24:48 +00:00
|
|
|
# Use the JS script that runs all tests in a loop and is easy to tweak
|
|
|
|
node ./scripts/run-android-ci-instrumentation-tests.js --path ./ReactAndroid/src/androidTest/java/com/facebook/react/tests --package com.facebook.react.tests
|