Skip to content

Commit

Permalink
Add logcat to artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
stevesoltys committed Sep 19, 2024
1 parent c2410c4 commit 48fc105
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ instrumentation_tests_task:
adb pull /sdcard/seedvault_test_results
screenshots_artifacts:
path: "seedvault_test_results/**/*.mp4"
logcat_artifacts:
path: "seedvault_test_results/**/*.log"
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ internal interface LargeTestBase : KoinComponent {

companion object {
private const val TEST_STORAGE_FOLDER = "seedvault_test"
private const val TEST_VIDEO_FOLDER = "seedvault_test_results"
private const val TEST_RESULT_FOLDER = "seedvault_test_results"
}

val externalStorageDir: String get() = Environment.getExternalStorageDirectory().absolutePath

val testStoragePath get() = "$externalStorageDir/$TEST_STORAGE_FOLDER"

val testVideoPath get() = "$externalStorageDir/$TEST_VIDEO_FOLDER"
val testResultPath get() = "$externalStorageDir/$TEST_RESULT_FOLDER"

val targetContext: Context
get() = InstrumentationRegistry.getInstrumentation().targetContext
Expand Down Expand Up @@ -126,7 +126,7 @@ internal interface LargeTestBase : KoinComponent {
keepRecordingScreen: AtomicBoolean,
testName: String,
) {
val folder = testVideoPath
val folder = testResultPath
runCommand("mkdir -p $folder")

val fileName = testResultFilename(testName)
Expand All @@ -152,7 +152,7 @@ internal interface LargeTestBase : KoinComponent {

// write logcat to file
val fileName = testResultFilename(testName)
runCommand("logcat -d -f $testVideoPath/$fileName.log")
runCommand("logcat -d -f $testResultPath/$fileName.log")
}

fun uninstallPackages(packages: Collection<PackageInfo>) {
Expand All @@ -165,7 +165,7 @@ internal interface LargeTestBase : KoinComponent {

fun clearTestBackups() {
File(testStoragePath).deleteRecursively()
File(testVideoPath).deleteRecursively()
File(testResultPath).deleteRecursively()
}

fun changeBackupLocation(
Expand Down

0 comments on commit 48fc105

Please sign in to comment.