Skip to content

Commit a315d50

Browse files
committed
[FatalIssueReporter] Preparing for BuiltIn Release
format check Bump latest shared core
1 parent 147621d commit a315d50

File tree

16 files changed

+1722
-363
lines changed

16 files changed

+1722
-363
lines changed

Cargo.Bazel.lock

Lines changed: 246 additions & 192 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.lock

Lines changed: 82 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,29 @@ android_logger = { version = "0.15.0", default-features = false }
1818
anyhow = "1.0.98"
1919
assert_matches = "1.5.0"
2020
async-trait = "0.1.88"
21-
bd-api = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "87e485ecc69bada556139b9c6ffd3d8585920f09" }
22-
bd-buffer = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "87e485ecc69bada556139b9c6ffd3d8585920f09" }
23-
bd-client-common = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "87e485ecc69bada556139b9c6ffd3d8585920f09" }
24-
bd-client-stats-store = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "87e485ecc69bada556139b9c6ffd3d8585920f09" }
25-
bd-crash-handler = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "87e485ecc69bada556139b9c6ffd3d8585920f09" }
26-
bd-device = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "87e485ecc69bada556139b9c6ffd3d8585920f09" }
27-
bd-grpc = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "87e485ecc69bada556139b9c6ffd3d8585920f09" }
28-
bd-hyper-network = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "87e485ecc69bada556139b9c6ffd3d8585920f09" }
29-
bd-key-value = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "87e485ecc69bada556139b9c6ffd3d8585920f09" }
30-
bd-log = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "87e485ecc69bada556139b9c6ffd3d8585920f09" }
31-
bd-log-metadata = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "87e485ecc69bada556139b9c6ffd3d8585920f09" }
32-
bd-log-primitives = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "87e485ecc69bada556139b9c6ffd3d8585920f09" }
33-
bd-logger = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "87e485ecc69bada556139b9c6ffd3d8585920f09" }
34-
bd-noop-network = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "87e485ecc69bada556139b9c6ffd3d8585920f09" }
35-
bd-proto = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "87e485ecc69bada556139b9c6ffd3d8585920f09" }
36-
bd-report-writer = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "87e485ecc69bada556139b9c6ffd3d8585920f09" }
37-
bd-runtime = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "87e485ecc69bada556139b9c6ffd3d8585920f09" }
38-
bd-session = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "87e485ecc69bada556139b9c6ffd3d8585920f09" }
39-
bd-shutdown = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "87e485ecc69bada556139b9c6ffd3d8585920f09" }
40-
bd-test-helpers = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "87e485ecc69bada556139b9c6ffd3d8585920f09", default-features = false }
41-
bd-time = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "87e485ecc69bada556139b9c6ffd3d8585920f09" }
21+
bd-api = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "7317b2475b46c3635f83717c709cab7e045a3286" }
22+
bd-buffer = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "7317b2475b46c3635f83717c709cab7e045a3286" }
23+
bd-client-common = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "7317b2475b46c3635f83717c709cab7e045a3286" }
24+
bd-client-stats-store = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "7317b2475b46c3635f83717c709cab7e045a3286" }
25+
bd-crash-handler = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "7317b2475b46c3635f83717c709cab7e045a3286" }
26+
bd-device = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "7317b2475b46c3635f83717c709cab7e045a3286" }
27+
bd-grpc = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "7317b2475b46c3635f83717c709cab7e045a3286" }
28+
bd-hyper-network = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "7317b2475b46c3635f83717c709cab7e045a3286" }
29+
bd-key-value = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "7317b2475b46c3635f83717c709cab7e045a3286" }
30+
bd-log = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "7317b2475b46c3635f83717c709cab7e045a3286" }
31+
bd-log-metadata = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "7317b2475b46c3635f83717c709cab7e045a3286" }
32+
bd-log-primitives = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "7317b2475b46c3635f83717c709cab7e045a3286" }
33+
bd-logger = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "7317b2475b46c3635f83717c709cab7e045a3286" }
34+
bd-noop-network = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "7317b2475b46c3635f83717c709cab7e045a3286" }
35+
bd-proto = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "7317b2475b46c3635f83717c709cab7e045a3286" }
36+
bd-report-writer = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "7317b2475b46c3635f83717c709cab7e045a3286" }
37+
bd-runtime = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "7317b2475b46c3635f83717c709cab7e045a3286" }
38+
bd-session = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "7317b2475b46c3635f83717c709cab7e045a3286" }
39+
bd-shutdown = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "7317b2475b46c3635f83717c709cab7e045a3286" }
40+
bd-test-helpers = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "7317b2475b46c3635f83717c709cab7e045a3286", default-features = false }
41+
bd-time = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "7317b2475b46c3635f83717c709cab7e045a3286" }
4242
chrono = "0.4.41"
43-
clap = { version = "4.5.38", features = ["derive", "env"] }
43+
clap = { version = "4.5.37", features = ["derive", "env"] }
4444
ctor = "0.4.2"
4545
env_logger = { version = "0.11.8", default-features = false }
4646
jni = "0.21.1"

examples/android/HelloWorldApp.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class HelloWorldApp : Application() {
3030
super.onCreate()
3131

3232
@OptIn(ExperimentalBitdriftApi::class)
33-
Logger.initFatalIssueReporting()
33+
Logger.initFatalIssueReporting(fatalIssueMechanism = FatalIssueMechanism.BuiltIn)
3434

3535
setupExampleCrashHandler()
3636

platform/jvm/capture/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ bitdrift_kt_android_local_test(
5555
],
5656
data = [
5757
"//test/platform/jvm:capture",
58+
"//platform/jvm/capture/src/test/resources:test_resources",
5859
],
5960
jvm_flags = [
6061
"-Djava.library.path=test/platform/jvm",

platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/Capture.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,10 @@ object Capture {
110110
@ExperimentalBitdriftApi
111111
@JvmStatic
112112
@JvmOverloads
113-
fun initFatalIssueReporting(context: Context? = null) {
114-
// TODO:(FranAguilera) BIT-5401: To allow passing fatalIssueMechanism config once
115-
// we are ready to ship [io.bitdrift.capture.reports.FatalIssueMechanism.BuiltIn]
116-
val fatalIssueMechanism = FatalIssueMechanism.Integration
117-
113+
fun initFatalIssueReporting(
114+
context: Context? = null,
115+
fatalIssueMechanism: FatalIssueMechanism,
116+
) {
118117
if (context == null && !ContextHolder.isInitialized) {
119118
Log.w(LOG_TAG, "Attempted to initialize Fatal Issue Reporting with a null context. Skipping enabling crash tracking.")
120119
return

platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/reports/persistence/FatalIssueReporterStorage.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ internal class FatalIssueReporterStorage(
2626

2727
private fun mapToReadableType(reportType: Byte): String =
2828
when (reportType) {
29-
ReportType.AppNotResponding -> "ANR"
30-
ReportType.JVMCrash -> "JVM_CRASH"
31-
ReportType.NativeCrash -> "NATIVE_CRASH"
32-
else -> "UNKNOWN"
29+
ReportType.AppNotResponding -> "anr"
30+
ReportType.JVMCrash -> "crash"
31+
ReportType.NativeCrash -> "native_crash"
32+
else -> "Unknown"
3333
}
3434
}

platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/reports/processor/AppExitAnrTraceProcessor.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ internal object AppExitAnrTraceProcessor {
5151
}
5252
}
5353

54-
val name = description?.let { builder.createString(it) } ?: 0
5554
val trace = Error.createStackTraceVector(builder, mainStackTraceFrames.toIntArray())
5655
val reason = builder.createString(AnrReason.extractFrom(description).readableType)
57-
val error = Error.createError(builder, name, reason, trace, ErrorRelation.CausedBy)
56+
val name = description?.let { builder.createString(it) } ?: 0
57+
val error = Error.createError(builder, reason, name, trace, ErrorRelation.CausedBy)
5858

5959
return Report.createReport(
6060
builder,

platform/jvm/capture/src/test/kotlin/io/bitdrift/capture/FatalIssueReporterProcessorTest.kt

Lines changed: 40 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,14 @@ import org.junit.Test
2626
import org.junit.runner.RunWith
2727
import org.robolectric.RobolectricTestRunner
2828
import org.robolectric.annotation.Config
29+
import java.io.InputStream
2930
import java.nio.ByteBuffer
31+
import java.nio.file.Paths
3032

33+
/**
34+
* WARNING: For now these test only run on bazel given the difference between accessing
35+
* test resources on gradle vs Bazel
36+
*/
3137
@RunWith(RobolectricTestRunner::class)
3238
@Config(sdk = [31])
3339
class FatalIssueReporterProcessorTest {
@@ -77,14 +83,14 @@ class FatalIssueReporterProcessorTest {
7783
"persistJvmCrash_withFakeException_shouldCreateNonEmptyErrorModel",
7884
)
7985
assertThat(error.stackTrace(0)!!.sourceFile!!.path).isEqualTo("FatalIssueReporterProcessorTest.kt")
80-
assertThat(error.stackTrace(0)!!.sourceFile!!.line).isEqualTo(50)
86+
assertThat(error.stackTrace(0)!!.sourceFile!!.line).isEqualTo(56)
8187
assertThat(error.stackTrace(0)!!.sourceFile!!.column).isEqualTo(0)
8288
}
8389

8490
@Test
8591
fun persistAppExitReport_whenAnr_shouldCreateNonEmptyErrorModel() {
8692
val description = APP_EXIT_DESCRIPTION_ANR
87-
val traceInputStream = createTraceInputStream(APP_EXIT_VALID_ANR_TRACE)
93+
val traceInputStream = buildTraceInputStringFromFile("app_exit_anr_deadlock_anr.txt")
8894

8995
fatalIssueReporterProcessor.persistAppExitReport(
9096
fatalIssueType = ReportType.AppNotResponding,
@@ -101,8 +107,8 @@ class FatalIssueReporterProcessorTest {
101107
val buffer = ByteBuffer.wrap(fatalIssueReportCaptor.firstValue)
102108
val report = Report.getRootAsReport(buffer)
103109
val error = report.errors(0)!!
104-
assertThat(error.name).isEqualTo(APP_EXIT_DESCRIPTION_ANR)
105-
assertThat(error.reason).isEqualTo("User Perceived ANR")
110+
assertThat(error.name).isEqualTo("User Perceived ANR")
111+
assertThat(error.reason).isEqualTo(APP_EXIT_DESCRIPTION_ANR)
106112
assertThat(error.stackTrace(0)!!.type).isEqualTo(1)
107113
assertThat(error.stackTrace(0)!!.stateLength).isEqualTo(0)
108114
assertThat(error.stackTrace(0)!!.className).isEqualTo("io.bitdrift.capture.FatalIssueGenerator")
@@ -116,7 +122,7 @@ class FatalIssueReporterProcessorTest {
116122
fun persistAppExitReport_whenUserPerceivedAnr_shouldMatchAnrReason() {
117123
assertAnrReason(
118124
descriptionFromAppExit = "Input Dispatching Timed Out",
119-
expectedReasonMessage = "User Perceived ANR",
125+
expectedMessage = "User Perceived ANR",
120126
)
121127
}
122128

@@ -126,7 +132,7 @@ class FatalIssueReporterProcessorTest {
126132
descriptionFromAppExit =
127133
"Broadcast of Intent { act=android.intent.action.MAIN " +
128134
"cmp=com.example.app/.MainActivity}",
129-
expectedReasonMessage = "Broadcast Receiver ANR",
135+
expectedMessage = "Broadcast Receiver ANR",
130136
)
131137
}
132138

@@ -136,71 +142,71 @@ class FatalIssueReporterProcessorTest {
136142
descriptionFromAppExit =
137143
"Executing service. { act=android.intent.action.MAIN \" +\n" +
138144
" \"cmp=com.example.app/.MainActivity}",
139-
expectedReasonMessage = "Executing Service ANR",
145+
expectedMessage = "Executing Service ANR",
140146
)
141147
}
142148

143149
@Test
144150
fun persistAppExitReport_whenStartServiceForegroundAnr_shouldMatchAnrReason() {
145151
assertAnrReason(
146152
descriptionFromAppExit = "Service.StartForeground() not called.{ act=android.intent.action.MAIN}",
147-
expectedReasonMessage = "Service.startForeground() Not Called ANR",
153+
expectedMessage = "Service.startForeground() Not Called ANR",
148154
)
149155
}
150156

151157
@Test
152158
fun persistAppExitReport_whenContentProviderTimeoutAnr_shouldMatchAnrReason() {
153159
assertAnrReason(
154160
descriptionFromAppExit = "My Application. Content Provider Timeout",
155-
expectedReasonMessage = "Content Provider ANR",
161+
expectedMessage = "Content Provider ANR",
156162
)
157163
}
158164

159165
@Test
160166
fun persistAppExitReport_whenAppRegisteredTimeoutAnr_shouldMatchAnrReason() {
161167
assertAnrReason(
162168
descriptionFromAppExit = "My Application. App Registered Timeout",
163-
expectedReasonMessage = "App Registered ANR",
169+
expectedMessage = "App Registered ANR",
164170
)
165171
}
166172

167173
@Test
168174
fun persistAppExitReport_whenShortFgsTimeoutAnr_shouldMatchAnrReason() {
169175
assertAnrReason(
170176
descriptionFromAppExit = "Foreground service ANR. Short FGS Timeout. Duration=5000ms",
171-
expectedReasonMessage = "Short Foreground Service Timeout ANR",
177+
expectedMessage = "Short Foreground Service Timeout ANR",
172178
)
173179
}
174180

175181
@Test
176182
fun persistAppExitReport_whenSystemJobServiceTimeoutAnr_shouldMatchAnrReason() {
177183
assertAnrReason(
178184
descriptionFromAppExit = "SystemJobService. Job Service Timeout",
179-
expectedReasonMessage = "Job Service ANR",
185+
expectedMessage = "Job Service ANR",
180186
)
181187
}
182188

183189
@Test
184190
fun persistAppExitReport_whenAppStartupTimeOut_shouldMatchAnrReason() {
185191
assertAnrReason(
186192
descriptionFromAppExit = "App start timeout. Timeout=5000ms",
187-
expectedReasonMessage = "App Start ANR",
193+
expectedMessage = "App Start ANR",
188194
)
189195
}
190196

191197
@Test
192198
fun persistAppExitReport_whenServiceStartTimeout_shouldMatchAnrReason() {
193199
assertAnrReason(
194200
descriptionFromAppExit = "Service start timeout. Timeout=5000ms",
195-
expectedReasonMessage = "Service Start ANR",
201+
expectedMessage = "Service Start ANR",
196202
)
197203
}
198204

199205
@Test
200206
fun persistAppExitReport_whenBackgroundAnr_shouldMatchAnrReason() {
201207
assertAnrReason(
202208
descriptionFromAppExit = "It's full moon ANR",
203-
expectedReasonMessage = "Undetermined ANR",
209+
expectedMessage = "Undetermined ANR",
204210
)
205211
}
206212

@@ -211,14 +217,14 @@ class FatalIssueReporterProcessorTest {
211217
"bg anr: Process " +
212218
"ProcessRecord{9707291 4609:io.bitdrift.gradletestapp/u0a207} " +
213219
"failed to complete startup\n",
214-
expectedReasonMessage = "Background ANR",
220+
expectedMessage = "Background ANR",
215221
)
216222
}
217223

218224
@Test
219225
fun persistAppExitReport_whenNativeCrash_shouldCreateEmptyErrorModel() {
220226
val description = "Native crash"
221-
val traceInputStream = createTraceInputStream("sample native crash trace")
227+
val traceInputStream = buildTraceInputStringFromFile("app_exit_native_crash.txt")
222228

223229
fatalIssueReporterProcessor.persistAppExitReport(
224230
ReportType.NativeCrash,
@@ -255,15 +261,13 @@ class FatalIssueReporterProcessorTest {
255261

256262
private fun assertAnrReason(
257263
descriptionFromAppExit: String,
258-
expectedReasonMessage: String,
264+
expectedMessage: String,
259265
) {
260-
val traceInputStream = createTraceInputStream(APP_EXIT_VALID_ANR_TRACE)
261-
262266
fatalIssueReporterProcessor.persistAppExitReport(
263267
fatalIssueType = ReportType.AppNotResponding,
264268
FAKE_TIME_STAMP,
265269
descriptionFromAppExit,
266-
traceInputStream,
270+
buildTraceInputStringFromFile("app_exit_anr_deadlock_anr.txt"),
267271
)
268272

269273
verify(fatalIssueReporterStorage).persistFatalIssue(
@@ -274,41 +278,29 @@ class FatalIssueReporterProcessorTest {
274278
val report = Report.getRootAsReport(ByteBuffer.wrap(fatalIssueReportCaptor.firstValue))
275279
assertThat(report.errors(0)).isNotNull
276280
report.errors(0)?.let { error ->
277-
assertThat(error.reason).isEqualTo(expectedReasonMessage)
281+
assertThat(error.name).isEqualTo(expectedMessage)
278282
}
279283
}
280284

285+
private fun buildTraceInputStringFromFile(rawFilePath: String): InputStream {
286+
val file =
287+
Paths
288+
.get(
289+
System.getenv("TEST_SRCDIR"),
290+
"_main",
291+
"platform/jvm/capture/src/test/resources",
292+
rawFilePath,
293+
).toFile()
294+
val resourceStream = file.inputStream()
295+
val anrRawTrace = resourceStream.bufferedReader().use { it.readText() }
296+
return createTraceInputStream(anrRawTrace)
297+
}
298+
281299
private companion object {
282300
const val FAKE_TIME_STAMP = 1241515210914L
283301
const val APP_EXIT_DESCRIPTION_ANR =
284302
"Input dispatching timed out (219180 " +
285303
"io.bitdrift.capture/io.bitdrift.capture.MainActivity (server) " +
286304
"is not responding. Waited 5004ms for MotionEvent"
287-
288-
// TODO(FranAguilera): BIT-5142 use raw files
289-
const val APP_EXIT_VALID_ANR_TRACE =
290-
"\"main\" prio=5 tid=1 Blocked\n" +
291-
" | group=\"main\" sCount=1 ucsCount=0 flags=1 obj=0x721b0f98 self=0xb400007d136a27b0\n" +
292-
" | sysTid=3994 nice=-10 cgrp=top-app sched=0/0 handle=0x7f053014f8\n" +
293-
" | state=S schedstat=( 979645230 62026944 1016 ) utm=91 stm=6 core=0 HZ=100\n" +
294-
" | stack=0x7ffccb0000-0x7ffccb2000 stackSize=8188KB\n" +
295-
" | held mutexes=\n" +
296-
" at io.bitdrift.capture.FatalIssueGenerator.startProcessing(FatalIssueGenerator.kt:106)\n" +
297-
" - waiting to lock <0x0481d03d> (a java.lang.String) held by thread 4\n" +
298-
" - locked <0x04e67032> (a java.lang.String)\n" +
299-
" at io.bitdrift.capture.FatalIssueGenerator.forceDeadlockAnr$(FatalIssueGenerator.kt:35)\n" +
300-
" at io.bitdrift.capture.FatalIssueGenerator(unavailable:0)\n" +
301-
" at io.bitdrift.capture.FatalIssueGenerator\n" +
302-
" at io.bitdrift.capture.FatalIssueGenerator.callOnMainThread\n" +
303-
" at io.bitdrift.capture.FatalIssueGenerator\n" +
304-
" at io.bitdrift.capture.FatalIssueGenerator\n" +
305-
" at android.os.Handler.handleCallback(Handler.java:958)\n" +
306-
" at android.os.Handler.dispatchMessage(Handler.java:99)\n" +
307-
" at android.os.Looper.loopOnce(Looper.java:205)\n" +
308-
" at android.os.Looper.loop(Looper.java:294)\n" +
309-
" at android.app.ActivityThread.main(ActivityThread.java:8177)\n" +
310-
" at java.lang.reflect.Method.invoke(Native method)\n" +
311-
" at com.android.internal.os.RuntimeInit.run(RuntimeInit.java:552)\n" +
312-
" at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)\n"
313305
}
314306
}

platform/jvm/capture/src/test/kotlin/io/bitdrift/capture/FatalIssueReporterStorageTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,31 +45,31 @@ class FatalIssueReporterStorageTest {
4545
fun persistFatalIssue_whenAnr_shouldAddTypeToFileName() {
4646
assertFileWithExpectedType(
4747
reportType = ReportType.AppNotResponding,
48-
"ANR",
48+
"anr",
4949
)
5050
}
5151

5252
@Test
5353
fun persistFatalIssue_whenJvmCrash_shouldAddTypeToFileName() {
5454
assertFileWithExpectedType(
5555
reportType = ReportType.JVMCrash,
56-
"JVM_CRASH",
56+
"crash",
5757
)
5858
}
5959

6060
@Test
6161
fun persistFatalIssue_whenNativeCrash_shouldAddTypeToFileName() {
6262
assertFileWithExpectedType(
6363
reportType = ReportType.NativeCrash,
64-
"NATIVE_CRASH",
64+
"native_crash",
6565
)
6666
}
6767

6868
@Test
6969
fun persistFatalIssue_whenStrictMode_shouldAddUnknownType() {
7070
assertFileWithExpectedType(
7171
reportType = ReportType.StrictModeViolation,
72-
"UNKNOWN",
72+
"Unknown",
7373
)
7474
}
7575

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
exports_files([
2+
"app_exit_anr_deadlock_anr.txt",
3+
"app_exit_native_crash.txt",
4+
])
5+
filegroup(
6+
name = "test_resources",
7+
srcs = glob(["*.txt"]),
8+
visibility = ["//visibility:public"]
9+
)

0 commit comments

Comments
 (0)