From be72debf99ad1754722e31206f50360ff4e14922 Mon Sep 17 00:00:00 2001 From: John Knox Date: Tue, 1 Oct 2019 07:45:37 -0700 Subject: [PATCH] Improve headless test running script Summary: Now emits a warning if api version doesn't match expected one. Reviewed By: cekkaewnumchai Differential Revision: D17685261 fbshipit-source-id: 2a01d64e2e160d411d7a58125b5bb45437476f8f --- scripts/run-headless-tests.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/run-headless-tests.sh b/scripts/run-headless-tests.sh index fa082a8cb..ef872a3ed 100755 --- a/scripts/run-headless-tests.sh +++ b/scripts/run-headless-tests.sh @@ -4,14 +4,20 @@ # This source code is licensed under the MIT license found in the LICENSE file # in the root directory of this source tree. -set -xeuo pipefail +set -euo pipefail if [ `adb devices | wc -l` -lt "3" ] then - echo "No devices are connected. Make sure emulator is booted with flipper sample app running" + echo "ERROR: No devices are connected. Make sure emulator is booted with flipper sample app running" exit 1 fi +api_version=$(adb shell getprop ro.build.version.sdk) + +if [ "$api_version" != "24" ]; then + echo "WARNING: Emulator has api version $api_version. Should be using API 24 for snapshot test to pass. ( Must match the one we request from oneworld at https://fburl.com/diffusion/op67q916 )" +fi + yarn build-headless --mac -unzip -u dist/Flipper-headless.zip -d /tmp +unzip -o dist/Flipper-headless.zip -d /tmp (cd headless-tests && yarn test)