diff --git a/vendor/vendor-android/src/main/kotlin/com/malinskiy/marathon/android/BaseAndroidDevice.kt b/vendor/vendor-android/src/main/kotlin/com/malinskiy/marathon/android/BaseAndroidDevice.kt index dfddd79b6..bfc681553 100644 --- a/vendor/vendor-android/src/main/kotlin/com/malinskiy/marathon/android/BaseAndroidDevice.kt +++ b/vendor/vendor-android/src/main/kotlin/com/malinskiy/marathon/android/BaseAndroidDevice.kt @@ -124,7 +124,7 @@ abstract class BaseAndroidDevice( FileSyncEntry( relativePath = "coverage", pathRoot = PathRoot.APP_DATA, - aggregationMode = AggregationMode.POOL + aggregationMode = AggregationMode.TEST_RUN ) ) } @@ -269,7 +269,7 @@ abstract class BaseAndroidDevice( ) val fileSyncTestRunListener = - FileSyncTestRunListener(devicePoolId, this, this@BaseAndroidDevice.androidConfiguration.fileSyncConfiguration, fileManager) + FileSyncTestRunListener(devicePoolId, this, this@BaseAndroidDevice.androidConfiguration.fileSyncConfiguration, fileManager, testBatch) val adamScreenCaptureTestRunListener = AdamScreenCaptureTestRunListener(devicePoolId, this, fileManager, testBatch.id) attachmentProviders.add(adamScreenCaptureTestRunListener) diff --git a/vendor/vendor-android/src/main/kotlin/com/malinskiy/marathon/android/executor/listeners/filesync/FileSyncTestRunListener.kt b/vendor/vendor-android/src/main/kotlin/com/malinskiy/marathon/android/executor/listeners/filesync/FileSyncTestRunListener.kt index 7006b6878..6aa62a93f 100644 --- a/vendor/vendor-android/src/main/kotlin/com/malinskiy/marathon/android/executor/listeners/filesync/FileSyncTestRunListener.kt +++ b/vendor/vendor-android/src/main/kotlin/com/malinskiy/marathon/android/executor/listeners/filesync/FileSyncTestRunListener.kt @@ -13,6 +13,7 @@ import com.malinskiy.marathon.device.toDeviceInfo import com.malinskiy.marathon.io.FileManager import com.malinskiy.marathon.io.FolderType import com.malinskiy.marathon.log.MarathonLogging +import com.malinskiy.marathon.test.TestBatch import java.io.File class FileSyncTestRunListener( @@ -20,6 +21,7 @@ class FileSyncTestRunListener( private val device: AndroidDevice, private val configuration: FileSyncConfiguration, private val fileManager: FileManager, + private val testBatch: TestBatch = TestBatch(tests = emptyList()), ) : AndroidTestRunListener { private val logger = MarathonLogging.logger("FileSyncTestRunListener") @@ -106,7 +108,11 @@ class FileSyncTestRunListener( AggregationMode.TEST_RUN -> fileManager.createFolder(FolderType.DEVICE_FILES) } - val basename = entry.relativePath.removeSuffix("/").substringAfterLast('/') + var basename = entry.relativePath.removeSuffix("/").substringAfterLast('/') + if (testBatch.tests.size == 1) { + val test = testBatch.tests.first() + basename.plus("/${test.pkg}.${test.clazz}#${test.method}") + } val subfolder = File(localFolder, basename).apply { mkdirs() } logger.debug { "Pulling into ${subfolder.absolutePath}" } when (entry.pathRoot) {