Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing Pillow library used in snapshot testing #452

Merged
merged 7 commits into from
May 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ language: android

env:
global:
- BUILD_API=29
- BUILD_TOOLS=29.0.3
- BUILD_API=30
- BUILD_TOOLS=30.0.3
- ABI=x86
- EMU_API=22
- EMU_FLAVOR=default
Expand All @@ -24,8 +24,7 @@ licenses:
before_install:
- sudo wget "https://bouncycastle.org/download/bcprov-ext-jdk15on-165.jar" -O "${JAVA_HOME}/jre/lib/ext/bcprov-ext-jdk15on-165.jar"
- sudo echo "security.provider.11=org.bouncycastle.jce.provider.BouncyCastleProvider" | sudo tee -a ${JAVA_HOME}/jre/lib/security/java.security
# Shapshot tests and emulator are commented
# - python -m pip install Pillow --user # library for image manipulation in snapshot tests
- python -m pip install Tools/Pillow-6.2.2-cp27-cp27mu-manylinux1_x86_64.whl --user # library for image manipulation in snapshot tests

before_script:
# Install Android SDK and run emulator
Expand All @@ -37,16 +36,16 @@ before_script:
- echo y | sdkmanager "platforms;android-$BUILD_API" >/dev/null
- echo y | sdkmanager "extras;android;m2repository" >/dev/null
- echo y | sdkmanager "system-images;android-$EMU_API;$EMU_FLAVOR;$ABI"
# - echo no | avdmanager create avd --force -n test -k "system-images;android-$EMU_API;$EMU_FLAVOR;$ABI" -c 100M
# - emulator -verbose -avd test -no-accel -no-snapshot -no-window -no-audio -camera-back none -camera-front none -selinux permissive -qemu -m 2048 &
- echo no | avdmanager create avd --force -n test -k "system-images;android-$EMU_API;$EMU_FLAVOR;$ABI" -c 100M
- emulator -verbose -avd test -no-accel -no-snapshot -no-window -no-audio -camera-back none -camera-front none -selinux permissive -qemu -m 2048 &

script:
- ./gradlew assembleRelease testReleaseUnitTest

# wait emulator to come alive and start snapshot tests
# - android-wait-for-emulator
# - adb shell input keyevent 82 &
# - ./gradlew verifyDebugAndroidTestScreenshotTest
- android-wait-for-emulator
- adb shell input keyevent 82 &
- ./gradlew verifyDebugAndroidTestScreenshotTest

before_deploy:
- ./Tools/verifyTag.sh
Expand Down
12 changes: 3 additions & 9 deletions AndroidSDKTests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.facebook.testing.screenshot:plugin:0.12.0'
classpath 'com.facebook.testing.screenshot:plugin:0.14.0'
}
}

Expand Down Expand Up @@ -45,12 +45,6 @@ android {
logger.lifecycle("Running test: " + descriptor)
}

// MiPush jar is causing java.lang.VerifyError in Robolectric. Possible cause is that
// the library was proguarded like app instead of library.
// Check https://github.com/robolectric/robolectric/issues/2750 for details.
// To fix tests in Android Studio add "-noverify" jvm option to JUnit run configuration template.
jvmArgs '-noverify'

}
unitTests {
includeAndroidResources = true
Expand All @@ -67,7 +61,7 @@ dependencies {
implementation project(':AndroidSDKPush')
implementation project(':AndroidSDKLocation')
implementation project(':AndroidSDKFcm')
implementation project(':AndroidSDKMiPush')
testImplementation project(':AndroidSDKMiPush') // add dep for unit tests only, fails otherwise
implementation "androidx.appcompat:appcompat:${APPCOMPAT_LIBRARY_VERSION}"
implementation 'com.google.android.gms:play-services-location:17.0.0'

Expand All @@ -93,7 +87,7 @@ dependencies {
androidTestImplementation "com.crittercism.dexmaker:dexmaker:1.4"
androidTestImplementation "com.crittercism.dexmaker:dexmaker-mockito:1.4"
androidTestImplementation "com.crittercism.dexmaker:dexmaker-dx:1.4"
implementation 'com.facebook.testing.screenshot:core:0.12.0'
implementation 'com.facebook.testing.screenshot:core:0.14.0'
}

task jarTests(type: Jar, dependsOn: "assembleDebugUnitTest") {
Expand Down
Binary file not shown.