Skip to content

Commit 160d815

Browse files
authored
Stop snapshot tests with flag (#471)
* Stop snapshot tests with flag * fix build * fix build * try flag with true * try second build * Turn off snapshot tests
1 parent d245cbc commit 160d815

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.travis.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ env:
1313
- TOOLS=${ANDROID_HOME}/tools
1414
# PATH order is important, the 'emulator' script exists in more than one place
1515
- PATH=${ANDROID_HOME}:${ANDROID_HOME}/emulator:${TOOLS}:${TOOLS}/bin:${ANDROID_HOME}/platform-tools:${PATH}
16+
# If you want to run snapshot tests change value to 'true'. Build time will be increased by 6 minutes.
17+
- RUN_SNAPSHOT_TESTS=false
1618

1719
android:
1820
components:
@@ -26,7 +28,7 @@ licenses:
2628
before_install:
2729
- sudo wget "https://bouncycastle.org/download/bcprov-ext-jdk15on-165.jar" -O "${JAVA_HOME}/jre/lib/ext/bcprov-ext-jdk15on-165.jar"
2830
- sudo echo "security.provider.11=org.bouncycastle.jce.provider.BouncyCastleProvider" | sudo tee -a ${JAVA_HOME}/jre/lib/security/java.security
29-
- python -m pip install Tools/Pillow-6.2.2-cp27-cp27mu-manylinux1_x86_64.whl --user # library for image manipulation in snapshot tests
31+
- if [[ $RUN_SNAPSHOT_TESTS == true ]]; then python -m pip install Tools/Pillow-6.2.2-cp27-cp27mu-manylinux1_x86_64.whl --user; fi; # library for image manipulation in snapshot tests
3032

3133
before_script:
3234
# Install Android SDK and run emulator
@@ -37,17 +39,17 @@ before_script:
3739
- echo y | sdkmanager "platforms;android-$EMU_API" >/dev/null
3840
- echo y | sdkmanager "platforms;android-$BUILD_API" >/dev/null
3941
- echo y | sdkmanager "extras;android;m2repository" >/dev/null
40-
- echo y | sdkmanager "system-images;android-$EMU_API;$EMU_FLAVOR;$ABI"
41-
- echo no | avdmanager create avd --force -n test -k "system-images;android-$EMU_API;$EMU_FLAVOR;$ABI" -c 100M
42-
- emulator -verbose -avd test -no-accel -no-snapshot -no-window -no-audio -camera-back none -camera-front none -selinux permissive -qemu -m 2048 &
42+
- if [[ $RUN_SNAPSHOT_TESTS == true ]]; then echo y | sdkmanager "system-images;android-$EMU_API;$EMU_FLAVOR;$ABI"; fi;
43+
- if [[ $RUN_SNAPSHOT_TESTS == true ]]; then echo no | avdmanager create avd --force -n test -k "system-images;android-$EMU_API;$EMU_FLAVOR;$ABI" -c 100M; fi;
44+
- if [[ $RUN_SNAPSHOT_TESTS == true ]]; then emulator -verbose -avd test -no-accel -no-snapshot -no-window -no-audio -camera-back none -camera-front none -selinux permissive -qemu -m 2048 & fi;
4345

4446
script:
4547
- ./gradlew assembleRelease testReleaseUnitTest
4648

4749
# wait emulator to come alive and start snapshot tests
48-
- android-wait-for-emulator
49-
- adb shell input keyevent 82 &
50-
- ./gradlew verifyDebugAndroidTestScreenshotTest
50+
- if [[ $RUN_SNAPSHOT_TESTS == true ]]; then android-wait-for-emulator; fi;
51+
- if [[ $RUN_SNAPSHOT_TESTS == true ]]; then adb shell input keyevent 82 & fi;
52+
- if [[ $RUN_SNAPSHOT_TESTS == true ]]; then ./gradlew verifyDebugAndroidTestScreenshotTest; fi;
5153

5254
before_deploy:
5355
- ./Tools/verifyTag.sh

0 commit comments

Comments
 (0)