diff --git a/.drone.yml b/.drone.yml index 242874ca4c..8a0b6e2eab 100644 --- a/.drone.yml +++ b/.drone.yml @@ -185,6 +185,7 @@ steps: GIT_TOKEN: from_secret: GIT_TOKEN ORG_GRADLE_PROJECT_coverage: '' + ORG_GRADLE_PROJECT_screenshot: '' commands: - scripts/checkIfRunDrone.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST || exit 0 - emulator-headless -avd android-27 -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 & @@ -239,6 +240,7 @@ steps: GIT_TOKEN: from_secret: GIT_TOKEN ORG_GRADLE_PROJECT_coverage: '' + ORG_GRADLE_PROJECT_screenshot: '' commands: - scripts/checkIfRunDrone.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST || exit 0 - emulator-headless -avd android-27 -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 & diff --git a/build.gradle b/build.gradle index dc3360e002..764fc67e04 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ buildscript { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.14.2" classpath "commons-httpclient:commons-httpclient:3.1@jar" // remove after entire switch to lib v2 - classpath 'com.karumi:shot:5.1.0' + classpath 'com.karumi:shot:5.3.0' } } @@ -156,7 +156,9 @@ android { buildTypes { debug { testCoverageEnabled (project.hasProperty('coverage')) - minSdkVersion 21 // remove once we use 21 globally, only needed for karumi.shot + if (project.hasProperty('screenshot')) { + minSdkVersion 21 // remove once we use 21 globally, only needed for karumi.shot + } } } diff --git a/scripts/androidScreenshotTest b/scripts/androidScreenshotTest index 8cc6a28b93..f4e1bd5a47 100755 --- a/scripts/androidScreenshotTest +++ b/scripts/androidScreenshotTest @@ -71,6 +71,7 @@ if [[ $4 = "all" ]]; then scripts/runAllScreenshotCombinations "noCI" "$1" "-Pandroid.testInstrumentationRunnerArguments.class=$class$method" else ./gradlew --offline gplayDebugExecuteScreenshotTests $record \ + -Pscreenshot=true \ -Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest \ -Pandroid.testInstrumentationRunnerArguments.class=$class$method \ $darkMode \ diff --git a/scripts/runAllScreenshotCombinations b/scripts/runAllScreenshotCombinations index 716642148c..47e06765a2 100755 --- a/scripts/runAllScreenshotCombinations +++ b/scripts/runAllScreenshotCombinations @@ -22,6 +22,7 @@ do if [[ $1 = "noCI" ]]; then ./gradlew --console plain gplayDebugExecuteScreenshotTests \ $record \ + -Pscreenshot=true \ -Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest \ -Pandroid.testInstrumentationRunnerArguments.COLOR="$color" \ -Pandroid.testInstrumentationRunnerArguments.DARKMODE="$darkMode" \