Skip to content

Commit

Permalink
Enable Unified gradle test runner and run tests with Unified gradle t…
Browse files Browse the repository at this point in the history
…est runner without android-emulator-runner.
  • Loading branch information
ychescale9 committed Jul 20, 2021
1 parent de1b276 commit 38fe6f6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,8 @@ jobs:
script: echo "Generated AVD snapshot for caching."

- name: Run Android instrumented tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 23
arch: x86
profile: Nexus 5X
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: ./gradlew connectedCheck
run: |
./gradlew ui-home:pixel2api28DebugAndroidTest
publish-to-play-store:
name: Publish to Play Store
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
package io.github.reactivecircus.streamlined

import com.android.build.api.dsl.Device
import com.android.build.api.dsl.ManagedVirtualDevice
import com.android.build.api.extension.ApplicationAndroidComponentsExtension
import com.android.build.api.extension.LibraryAndroidComponentsExtension
import com.android.build.gradle.TestedExtension
import com.android.build.gradle.internal.dsl.BaseAppModuleExtension
import java.io.File
import org.gradle.api.ExtensiblePolymorphicDomainObjectContainer
import org.gradle.api.JavaVersion
import org.gradle.api.Project
import org.gradle.api.tasks.testing.Test
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.gradle.kotlin.dsl.register
import org.gradle.kotlin.dsl.repositories
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.plugin.KotlinAndroidPluginWrapper
Expand Down Expand Up @@ -57,10 +61,18 @@ internal fun TestedExtension.configureCommonAndroidOptions() {
resourceConfigurations.add("en")
}

testOptions.animationsDisabled = true

// TODO re-enable once lint analysis failure is fixed
lintOptions.disable("DialogFragmentCallbacksDetector")

testOptions {
animationsDisabled = true
devices.register<ManagedVirtualDevice>("pixel2api28") {
device = "Pixel 2"
apiLevel = 28
systemImageSource = "aosp"
abi = "x86"
}
}
}

/**
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ android.defaults.buildfeatures.renderscript=false
android.defaults.buildfeatures.resvalues=false
android.defaults.buildfeatures.shaders=false
android.library.defaults.buildfeatures.androidresources=false

# Enable Gradle managed virtual devices
android.experimental.androidTest.useUnifiedTestPlatform=true

0 comments on commit 38fe6f6

Please sign in to comment.