Skip to content

Start saving crash reports to firestore. #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ interface TestRunnerService {
* Test case log files produced by the test.
*/
val testCaseArtifacts: Map<TestIdentifier, List<TestCaseArtifact>>

/**
* Crash report if module encountered a crash
*/
val crashReport: ResultFileResource?
}

data class TestCaseArtifact(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ internal class TestRunnerServiceImpl internal constructor(
"LOGCAT"
)
}
} else if (fileName.contains(CRASH_REPORT_FILE_NAME)) {
getTestResultFiles(visitor).crashReport = ResultFileResourceImpl(visitor)
}
}
// remove this if block when b/299975596 is fixed
Expand Down Expand Up @@ -342,6 +344,7 @@ internal class TestRunnerServiceImpl internal constructor(
private const val TEST_RESULT_XML_PREFIX = "test_result_"
private const val TEST_RESULT_XML_SUFFIX = ".xml"
private const val INSTRUMENTATION_RESULTS_FILE_NAME = "instrumentation.results"
private const val CRASH_REPORT_FILE_NAME = "crash"
}
class ResultFileResourceImpl(
private val blobVisitor: BlobVisitor
Expand Down Expand Up @@ -372,6 +375,8 @@ internal class TestRunnerServiceImpl internal constructor(
override val xmlResults: List<TestRunnerService.ResultFileResource> = xmlResultBlobs
override val testCaseArtifacts: Map<TestRunnerService.TestIdentifier, List<TestRunnerService.TestCaseArtifact>> = testCaseArtifactBlobs
override val deviceRun: DeviceRun = DeviceRun.create(fullDeviceId)
override var crashReport: TestRunnerService.ResultFileResource? = null
internal set

internal fun addXmlResult(resultFileResource: TestRunnerService.ResultFileResource) {
xmlResultBlobs.add(resultFileResource)
Expand Down
Loading