Skip to content

Commit 02442c0

Browse files
adinauermarkushi
andauthored
Fix ActivityLifecycleSpanHelperTest by resetting AppStartMetrics (#4038)
* fix test * Only initialize CodeQl for Java --------- Co-authored-by: Markus Hintersteiner <[email protected]>
1 parent 9c57a13 commit 02442c0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Initialize CodeQL
4242
uses: github/codeql-action/init@df409f7d9260372bd5f19e5b04e83cb3c43714ae # pin@v2
4343
with:
44-
languages: ${{ matrix.language }}
44+
languages: 'java'
4545

4646
- name: Build Java
4747
run: |

sentry-android-core/src/test/java/io/sentry/android/core/performance/ActivityLifecycleSpanHelperTest.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import org.mockito.kotlin.mock
1717
import org.mockito.kotlin.whenever
1818
import java.util.Date
1919
import java.util.concurrent.TimeUnit
20+
import kotlin.test.BeforeTest
2021
import kotlin.test.Test
2122
import kotlin.test.assertEquals
2223
import kotlin.test.assertFalse
@@ -48,6 +49,11 @@ class ActivityLifecycleSpanHelperTest {
4849
}
4950
private val fixture = Fixture()
5051

52+
@BeforeTest
53+
fun setup() {
54+
AppStartMetrics.getInstance().clear()
55+
}
56+
5157
@Test
5258
fun `createAndStopOnCreateSpan creates and finishes onCreate span`() {
5359
val helper = fixture.getSut()

0 commit comments

Comments
 (0)