Skip to content

Commit b056859

Browse files
romtsnmarkushi
andauthored
Run AGP test matrix with/without sentry integrations (#2743)
Co-authored-by: Markus Hintersteiner <[email protected]>
1 parent a62c875 commit b056859

File tree

6 files changed

+32
-6
lines changed

6 files changed

+32
-6
lines changed

.github/workflows/agp-matrix.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ jobs:
2323
fail-fast: false
2424
matrix:
2525
agp: [ '8.0.0','8.1.0-alpha11' ]
26-
ndk: [ true, false ]
26+
integrations: [ true, false ]
2727

28-
name: AGP Matrix Release - AGP ${{ matrix.agp }} - NDK ${{ matrix.ndk }}
28+
name: AGP Matrix Release - AGP ${{ matrix.agp }} - Integrations ${{ matrix.integrations }}
2929
env:
3030
VERSION_AGP: ${{ matrix.agp }}
31-
APPLY_NDK: ${{ matrix.ndk }}
31+
APPLY_SENTRY_INTEGRATIONS: ${{ matrix.integrations }}
3232

3333
steps:
3434
- name: Checkout Repo

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
- Add SentryWrapper for Callable and Supplier Interface ([#2720](https://github.com/getsentry/sentry-java/pull/2720))
88

9+
### Fixes
10+
11+
- Don't warn R8 on missing `ComposeViewHierarchyExporter` class ([#2743](https://github.com/getsentry/sentry-java/pull/2743))
12+
913
## 6.20.0
1014

1115
### Features

sentry-android-core/proguard-rules.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
-dontwarn io.sentry.android.timber.SentryTimberIntegration
2525
-dontwarn io.sentry.android.fragment.FragmentLifecycleIntegration
2626
-dontwarn io.sentry.compose.gestures.ComposeGestureTargetLocator
27+
-dontwarn io.sentry.compose.viewhierarchy.ComposeViewHierarchyExporter
2728

2829
# To ensure that stack traces is unambiguous
2930
# https://developer.android.com/studio/build/shrink-code#decode-stack-trace

sentry-android-integration-tests/sentry-uitest-android/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,18 @@ android {
8888
}
8989
}
9090

91-
val applyNdk = System.getenv("APPLY_NDK")?.toBoolean() ?: false
91+
val applySentryIntegrations = System.getenv("APPLY_SENTRY_INTEGRATIONS")?.toBoolean() ?: true
9292

9393
dependencies {
9494

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

97-
if (applyNdk) {
97+
if (applySentryIntegrations) {
9898
implementation(projects.sentryAndroid)
99+
implementation(projects.sentryCompose)
99100
} else {
100101
implementation(projects.sentryAndroidCore)
101102
}
102-
implementation(projects.sentryCompose)
103103
implementation(Config.Libs.appCompat)
104104
implementation(Config.Libs.androidxCore)
105105
implementation(Config.Libs.composeActivity)

sentry-android-integration-tests/sentry-uitest-android/src/androidTest/java/io/sentry/uitest/android/BaseUiTest.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,13 @@ fun waitUntilIdle() {
9999
// We rely on Espresso's idling resources.
100100
Espresso.onIdle()
101101
}
102+
103+
fun classExists(className: String): Boolean {
104+
try {
105+
Class.forName(className)
106+
return true
107+
} catch (exception: ClassNotFoundException) {
108+
// no-op
109+
}
110+
return false
111+
}

sentry-android-integration-tests/sentry-uitest-android/src/androidTest/java/io/sentry/uitest/android/UserInteractionTests.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,24 @@ import io.sentry.Breadcrumb
1515
import io.sentry.SentryLevel
1616
import io.sentry.SentryOptions
1717
import io.sentry.android.core.SentryAndroidOptions
18+
import org.hamcrest.CoreMatchers.`is`
19+
import org.junit.Assume.assumeThat
20+
import org.junit.Before
1821
import org.junit.runner.RunWith
1922
import kotlin.test.Test
2023
import kotlin.test.assertTrue
2124

2225
@RunWith(AndroidJUnit4::class)
2326
class UserInteractionTests : BaseUiTest() {
2427

28+
@Before
29+
fun setup() {
30+
assumeThat(
31+
classExists("io.sentry.compose.gestures.ComposeGestureTargetLocator"),
32+
`is`(true)
33+
)
34+
}
35+
2536
@Test
2637
fun composableClickGeneratesMatchingBreadcrumb() {
2738
val breadcrumbs = mutableListOf<Breadcrumb>()

0 commit comments

Comments
 (0)