Skip to content

Commit

Permalink
Fix ActivityLifecycleSpanHelperTest by resetting AppStartMetrics (#…
Browse files Browse the repository at this point in the history
…4038)

* fix test

* Only initialize CodeQl for Java

---------

Co-authored-by: Markus Hintersteiner <markus.hintersteiner@sentry.io>
  • Loading branch information
adinauer and markushi authored Jan 10, 2025
1 parent 9c57a13 commit 02442c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Initialize CodeQL
uses: github/codeql-action/init@df409f7d9260372bd5f19e5b04e83cb3c43714ae # pin@v2
with:
languages: ${{ matrix.language }}
languages: 'java'

- name: Build Java
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import org.mockito.kotlin.mock
import org.mockito.kotlin.whenever
import java.util.Date
import java.util.concurrent.TimeUnit
import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFalse
Expand Down Expand Up @@ -48,6 +49,11 @@ class ActivityLifecycleSpanHelperTest {
}
private val fixture = Fixture()

@BeforeTest
fun setup() {
AppStartMetrics.getInstance().clear()
}

@Test
fun `createAndStopOnCreateSpan creates and finishes onCreate span`() {
val helper = fixture.getSut()
Expand Down

0 comments on commit 02442c0

Please sign in to comment.