Skip to content

Commit e820132

Browse files
committed
compress tombstone test resource to reduce its repo weight down to less than 20%
1 parent 14aae00 commit e820132

File tree

5 files changed

+8
-2
lines changed

5 files changed

+8
-2
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*.png binary
33
*.jpg binary
44
*.pb binary
5+
*.gz binary
56

67
# These are explicitly windows files and should use crlf
78
*.bat text eol=crlf

sentry-android-core/src/test/java/io/sentry/android/core/TombstoneIntegrationTest.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import io.sentry.SentryEvent
66
import io.sentry.SentryLevel
77
import io.sentry.android.core.TombstoneIntegration.TombstoneHint
88
import io.sentry.android.core.cache.AndroidEnvelopeCache
9+
import java.util.zip.GZIPInputStream
910
import kotlin.test.assertEquals
1011
import kotlin.test.assertNotNull
1112
import kotlin.test.assertTrue
@@ -47,7 +48,9 @@ class TombstoneIntegrationTest : ApplicationExitIntegrationTestBase<TombstoneHin
4748
} else {
4849
whenever(mock.traceInputStream)
4950
.thenReturn(
50-
TombstoneIntegrationTest::class.java.getResourceAsStream("/tombstone.pb")
51+
GZIPInputStream(
52+
TombstoneIntegrationTest::class.java.getResourceAsStream("/tombstone.pb.gz")
53+
)
5154
)
5255
}
5356
}

sentry-android-core/src/test/java/io/sentry/android/core/internal/tombstone/TombstoneParserTest.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package io.sentry.android.core.internal.tombstone
22

33
import java.io.ByteArrayInputStream
4+
import java.util.zip.GZIPInputStream
45
import kotlin.test.Test
56
import kotlin.test.assertEquals
67
import kotlin.test.assertNotNull
@@ -47,7 +48,8 @@ class TombstoneParserTest {
4748

4849
@Test
4950
fun `parses a snapshot tombstone into Event`() {
50-
val tombstoneStream = TombstoneParserTest::class.java.getResourceAsStream("/tombstone.pb")!!
51+
val tombstoneStream =
52+
GZIPInputStream(TombstoneParserTest::class.java.getResourceAsStream("/tombstone.pb.gz"))
5153
val parser = TombstoneParser(tombstoneStream)
5254
val event = parser.parse()
5355

-380 KB
Binary file not shown.
72.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)