Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
476af3f
added benchmark ui tests
stefanosiano Apr 20, 2022
d62a03c
big cleanup of BaseUiTest
stefanosiano Apr 26, 2022
9243a93
Merge branch '6.x.x' into tests/android-ui-tests
stefanosiano Apr 26, 2022
c6dc27f
changed benchmark to manual init
stefanosiano Apr 26, 2022
a580cc3
started with javadoc and cleanup of benchmark test
stefanosiano Apr 28, 2022
368290e
Merge branch '6.x.x' into tests/android-ui-tests
stefanosiano Apr 28, 2022
9850396
cleaned everything
stefanosiano Apr 28, 2022
fc4ce1d
fixed spotless issues
stefanosiano Apr 28, 2022
2601afb
Renamed modules:
stefanosiano Apr 29, 2022
ae00661
Merge branch '6.x.x' into tests/android-ui-tests
stefanosiano Apr 29, 2022
51a1827
Merge branch '6.x.x' into tests/android-ui-tests
stefanosiano May 4, 2022
7a9c217
updated some gradle config to try to fix github build
stefanosiano May 4, 2022
45b3669
updated some gradle config to try to fix github build
stefanosiano May 4, 2022
4177c93
updated some gradle config to fix github build
stefanosiano May 4, 2022
d477a59
changed ui tests module to application modules, to have an apk to upl…
stefanosiano May 4, 2022
862819d
added detekt and errorprone to uitests modules
stefanosiano May 5, 2022
a30ecdc
added detekt and errorprone to uitests modules
stefanosiano May 5, 2022
f73b940
added saucelabs config files
stefanosiano May 12, 2022
dd38ed4
fixed proguard rules (disabled shrinking) and enabled proguard
stefanosiano May 17, 2022
8f62a8c
reverted profiling comparison rages from -1..5 to 0..5
stefanosiano May 19, 2022
2a9f83b
removed sentry providers through manifest instead of disabling the sdk
stefanosiano May 23, 2022
a9a163f
Format code
getsentry-bot May 23, 2022
ba41b1e
renamed sentry-uitest folder to sentry-android-integration-tests
stefanosiano May 23, 2022
04cd4ea
Merge remote-tracking branch 'origin/tests/android-ui-tests' into tes…
stefanosiano May 23, 2022
6af1f1c
moved EnvelopeAsserter.assertItem to assertions.kt as assertEnvelopeItem
stefanosiano May 24, 2022
695eb2f
moved few prints to comments in BenchmarkOperationResult
stefanosiano May 25, 2022
b3ae6f6
sentry-uitest-android-benchmark now depends on sentry-uitest-android
stefanosiano May 26, 2022
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.idea/
.gradle/
build/
artifacts/
out/
local.properties
**.iml
Expand Down
29 changes: 29 additions & 0 deletions .sauce/sentry-uitest-android-benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v1alpha
kind: espresso
sauce:
region: us-west-1
# Controls how many suites are executed at the same time (sauce test env only).
concurrency: 1
metadata:
name: Android benchmarks with Espresso
tags:
- benchmarks
- android
espresso:
app: ./sentry-android-integration-tests/sentry-uitest-android-benchmark/build/outputs/apk/release/sentry-uitest-android-benchmark-release.apk
testApp: ./sentry-android-integration-tests/sentry-uitest-android-benchmark/build/outputs/apk/androidTest/release/sentry-uitest-android-benchmark-release-androidTest.apk
suites:
name: "Android Benchmarks"
devices:
- name: "Google Pixel 2"
platformVersion: 11
- id: Google_Pixel_2_real_us
testOptions:
useTestOrchestrator: true
# Controls what artifacts to fetch when the suite on Sauce Cloud has finished.
artifacts:
download:
when: always
match:
- junit.xml
directory: ./artifacts/
31 changes: 31 additions & 0 deletions .sauce/sentry-uitest-android-end2end.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: v1alpha
kind: espresso
sauce:
region: us-west-1
# Controls how many suites are executed at the same time (sauce test env only).
concurrency: 1
metadata:
name: Android end2end tests with Espresso
tags:
- e2e
- android
espresso:
app: ./sentry-android-integration-tests/sentry-uitest-android/build/outputs/apk/release/sentry-uitest-android-release.apk
testApp: ./sentry-android-integration-tests/sentry-uitest-android/build/outputs/apk/androidTest/release/sentry-uitest-android-release-androidTest.apk
suites:
name: "Android End2end"
emulators:
- name: "Android GoogleApi Emulator"
orientation: portrait
platformVersions:
- "11.0"
- "10.0"
testOptions:
useTestOrchestrator: true
# Controls what artifacts to fetch when the suite on Sauce Cloud has finished.
artifacts:
download:
when: always
match:
- junit.xml
directory: ./artifacts/
6 changes: 4 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ apiValidation {
"sentry-samples-spring-boot",
"sentry-samples-spring-boot-webflux",
"sentry-samples-netflix-dgs",
"sentry-uitest-android",
"sentry-uitest-android-benchmark",
)
)
}
Expand Down Expand Up @@ -86,7 +88,7 @@ allprojects {
}

subprojects {
if (!this.name.contains("sample") && this.name != "sentry-test-support") {
if (!this.name.contains("sample") && !this.name.contains("integration-tests") && this.name != "sentry-test-support") {
apply<DistributionPlugin>()

val sep = File.separator
Expand Down Expand Up @@ -165,7 +167,7 @@ gradle.projectsEvaluated {
"https://docs.spring.io/spring-boot/docs/current/api/"
)
subprojects
.filter { !it.name.contains("sample") }
.filter { !it.name.contains("sample") && !it.name.contains("integration-tests") }
.forEach { proj ->
proj.tasks.withType<Javadoc>().forEach { javadocTask ->
source += javadocTask.source
Expand Down
14 changes: 11 additions & 3 deletions buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ object Config {

object Libs {
val okHttpVersion = "4.9.2"
val appCompat = "androidx.appcompat:appcompat:1.2.0"
val appCompat = "androidx.appcompat:appcompat:1.3.0"
val timber = "com.jakewharton.timber:timber:4.7.1"
val okhttpBom = "com.squareup.okhttp3:okhttp-bom:$okHttpVersion"
val okhttp = "com.squareup.okhttp3:okhttp"
val leakCanary = "com.squareup.leakcanary:leakcanary-android:2.8.1"
val constraintLayout = "androidx.constraintlayout:constraintlayout:2.1.3"

private val lifecycleVersion = "2.2.0"
val lifecycleProcess = "androidx.lifecycle:lifecycle-process:$lifecycleVersion"
Expand Down Expand Up @@ -110,12 +111,19 @@ object Config {
}

object TestLibs {
private val androidxTestVersion = "1.4.0-rc01"
private val androidxTestVersion = "1.4.0"
private val espressoVersion = "3.4.0"

val androidJUnitRunner = "androidx.test.runner.AndroidJUnitRunner"
val kotlinTestJunit = "org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion"
val androidxCore = "androidx.test:core:$androidxTestVersion"
val androidxRunner = "androidx.test:runner:$androidxTestVersion"
val androidxJunit = "androidx.test.ext:junit:1.1.3-rc01"
val androidxTestCoreKtx = "androidx.test:core-ktx:$androidxTestVersion"
val androidxTestRules = "androidx.test:rules:$androidxTestVersion"
val espressoCore = "androidx.test.espresso:espresso-core:$espressoVersion"
val espressoIdlingResource = "androidx.test.espresso:espresso-idling-resource:$espressoVersion"
val androidxTestOrchestrator = "androidx.test:orchestrator:1.4.1"
val androidxJunit = "androidx.test.ext:junit:1.1.3"
val androidxCoreKtx = "androidx.core:core-ktx:1.7.0"
val robolectric = "org.robolectric:robolectric:4.7.3"
val mockitoKotlin = "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"
Expand Down
2 changes: 1 addition & 1 deletion sentry-android-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ android {
targetSdk = Config.Android.targetSdkVersion
minSdk = Config.Android.minSdkVersion

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunner = Config.TestLibs.androidJUnitRunner

buildConfigField("String", "SENTRY_ANDROID_SDK_NAME", "\"${Config.Sentry.SENTRY_ANDROID_SDK_NAME}\"")

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

-dontobfuscate
#Shrinking removes annotations and "unused classes" from test apk, so we don't shrink
-dontshrink

-ignorewarnings

-keepattributes *Annotation*

-dontnote junit.framework.**
-dontnote junit.runner.**

-dontwarn androidx.test.**
-dontwarn org.junit.**
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
import net.ltgt.gradle.errorprone.errorprone

plugins {
id("com.android.application")
kotlin("android")
id(Config.QualityPlugins.errorProne)
id(Config.QualityPlugins.gradleVersions)
id(Config.QualityPlugins.detektPlugin)
}

android {
compileSdk = Config.Android.compileSdkVersion

defaultConfig {
applicationId = "io.sentry.uitest.android.benchmark"
minSdk = Config.Android.minSdkVersionNdk
targetSdk = Config.Android.targetSdkVersion
versionCode = 1
versionName = "1.0.0"

testInstrumentationRunner = Config.TestLibs.androidJUnitRunner
// Runs each test in its own instance of Instrumentation. This way they are isolated from
// one another and get their own Application instance.
// https://developer.android.com/training/testing/instrumented-tests/androidx-test-libraries/runner#enable-gradle
// This doesn't work on some devices with Android 11+. Clearing package data resets permissions.
// Check the readme for more info.
// testInstrumentationRunnerArguments["clearPackageData"] = "true"
}

buildFeatures {
// Determines whether to support View Binding.
// Note that the viewBinding.enabled property is now deprecated.
viewBinding = true
}

testOptions {
execution = "ANDROIDX_TEST_ORCHESTRATOR"
}

signingConfigs {
getByName("debug") {
storeFile = rootProject.file("debug.keystore")
storePassword = "android"
keyAlias = "androiddebugkey"
keyPassword = "android"
}
}

testBuildType = System.getProperty("testBuildType", "debug")

buildTypes {
getByName("debug") {
isDebuggable = false
isMinifyEnabled = true
signingConfig = signingConfigs.getByName("debug")
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "benchmark-proguard-rules.pro")
}
getByName("release") {
isMinifyEnabled = true
isShrinkResources = true
signingConfig = signingConfigs.getByName("debug") // to be able to run release mode
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "benchmark-proguard-rules.pro")
}
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}

lint {
warningsAsErrors = true
checkDependencies = true

// We run a full lint analysis as build part in CI, so skip vital checks for assemble tasks.
checkReleaseBuilds = false
}

variantFilter {
if (Config.Android.shouldSkipDebugVariant(buildType.name)) {
ignore = true
}
}
}

dependencies {

implementation(kotlin(Config.kotlinStdLib, org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION))

implementation(projects.sentryAndroidIntegrationTests.sentryUitestAndroid)
implementation(projects.sentryAndroid)
implementation(Config.Libs.appCompat)
implementation(Config.Libs.androidxCore)
implementation(Config.Libs.androidxRecylerView)
implementation(Config.Libs.constraintLayout)
implementation(Config.TestLibs.espressoIdlingResource)

compileOnly(Config.CompileOnly.nopen)
errorprone(Config.CompileOnly.nopenChecker)
errorprone(Config.CompileOnly.errorprone)
errorprone(Config.CompileOnly.errorProneNullAway)

androidTestImplementation(Config.TestLibs.kotlinTestJunit)
androidTestImplementation(Config.TestLibs.espressoCore)
androidTestImplementation(Config.TestLibs.androidxTestCoreKtx)
androidTestImplementation(Config.TestLibs.androidxRunner)
androidTestImplementation(Config.TestLibs.androidxTestRules)
androidTestImplementation(Config.TestLibs.androidxJunit)
androidTestUtil(Config.TestLibs.androidxTestOrchestrator)
}

tasks.withType<JavaCompile>().configureEach {
options.errorprone {
check("NullAway", net.ltgt.gradle.errorprone.CheckSeverity.ERROR)
option("NullAway:AnnotatedPackages", "io.sentry")
option("NullAway:UnannotatedSubPackages", "io.sentry.uitest.android.benchmark.databinding")
}
}

tasks.withType<Detekt> {
// Target version of the generated JVM bytecode. It is used for type resolution.
jvmTarget = JavaVersion.VERSION_1_8.toString()
}

configure<DetektExtension> {
buildUponDefaultConfig = true
allRules = true
}

kotlin {
explicitApi()
}
Loading