diff --git a/core/src/main/kotlin/com/malinskiy/marathon/cache/test/key/TestCacheKeyFactory.kt b/core/src/main/kotlin/com/malinskiy/marathon/cache/test/key/TestCacheKeyFactory.kt index 5911103e4..4b9d09a20 100644 --- a/core/src/main/kotlin/com/malinskiy/marathon/cache/test/key/TestCacheKeyFactory.kt +++ b/core/src/main/kotlin/com/malinskiy/marathon/cache/test/key/TestCacheKeyFactory.kt @@ -2,18 +2,15 @@ package com.malinskiy.marathon.cache.test.key import com.malinskiy.marathon.cache.CacheKey import com.malinskiy.marathon.device.DevicePoolId -import com.malinskiy.marathon.execution.Configuration import com.malinskiy.marathon.test.Test import java.io.OutputStream -import java.io.Writer import java.math.BigInteger import java.security.DigestOutputStream import java.security.MessageDigest class TestCacheKeyFactory( private val componentCacheKeyProvider: ComponentCacheKeyProvider, - private val versionNameProvider: VersionNameProvider, - private val configuration: Configuration + private val versionNameProvider: VersionNameProvider ) { suspend fun getCacheKey(poolId: DevicePoolId, test: Test): CacheKey { @@ -25,7 +22,6 @@ class TestCacheKeyFactory( .use { it.write(versionNameProvider.versionName) it.write(CACHE_FORMAT_VERSION) - it.writeConfiguration(configuration) it.write(componentCachingKey) it.write(poolId.name) it.write(test.pkg) @@ -42,13 +38,6 @@ class TestCacheKeyFactory( return TestCacheKey(key, test) } - /** - * Write parameters that may affect test execution result or collected artifacts - */ - private fun Writer.writeConfiguration(configuration: Configuration) { - write("codeCoverageEnabled=${configuration.isCodeCoverageEnabled}") - } - private fun createDigestOutputStream(): DigestOutputStream = DigestOutputStream( object : OutputStream() { diff --git a/core/src/main/kotlin/com/malinskiy/marathon/di/Modules.kt b/core/src/main/kotlin/com/malinskiy/marathon/di/Modules.kt index 6f6220b36..04cd919d9 100644 --- a/core/src/main/kotlin/com/malinskiy/marathon/di/Modules.kt +++ b/core/src/main/kotlin/com/malinskiy/marathon/di/Modules.kt @@ -44,7 +44,7 @@ val analyticsModule = module { val cacheModule = module { single { CacheServiceFactory(get()).createCacheService() } - single { TestCacheKeyFactory(get(), get(), get()) } + single { TestCacheKeyFactory(get(), get()) } single { TestResultsCache(get(), get(), get()) } single { TestCacheLoader(get(), get(), get()) } single { CacheTestReporter(get(), get()) } diff --git a/core/src/main/kotlin/com/malinskiy/marathon/execution/Configuration.kt b/core/src/main/kotlin/com/malinskiy/marathon/execution/Configuration.kt index f1569817e..825dbe0b0 100644 --- a/core/src/main/kotlin/com/malinskiy/marathon/execution/Configuration.kt +++ b/core/src/main/kotlin/com/malinskiy/marathon/execution/Configuration.kt @@ -16,7 +16,6 @@ import com.malinskiy.marathon.execution.strategy.impl.sorting.NoSortingStrategy import com.malinskiy.marathon.vendor.VendorConfiguration import java.io.File -private const val DEFAULT_EXECUTION_TIMEOUT_MILLIS: Long = 900_000 private const val DEFAULT_NO_DEVICES_TIMEOUT_MILLIS: Long = 300_000 private const val DEFAULT_OUTPUT_TIMEOUT_MILLIS: Long = 60_000 @@ -36,8 +35,6 @@ data class Configuration constructor( val cache: CacheConfiguration, val ignoreFailures: Boolean, - val isCodeCoverageEnabled: Boolean, - val fallbackToScreenshots: Boolean, val strictMode: Boolean, val uncompletedTestRetryQuota: Int, @@ -47,7 +44,6 @@ data class Configuration constructor( val ignoreFailureRegexes: Collection, val failFastFailureRegexes: Collection, - val testBatchTimeoutMillis: Long, val testOutputTimeoutMillis: Long, val noDevicesTimeoutMillis: Long, val debug: Boolean, @@ -71,8 +67,6 @@ data class Configuration constructor( cache: CacheConfiguration?, ignoreFailures: Boolean?, - isCodeCoverageEnabled: Boolean?, - fallbackToScreenshots: Boolean?, strictMode: Boolean?, uncompletedTestRetryQuota: Int?, @@ -82,7 +76,6 @@ data class Configuration constructor( ignoreFailureRegexes: Collection?, failFastFailureRegexes: Collection?, - testBatchTimeoutMillis: Long?, testOutputTimeoutMillis: Long?, noDevicesTimeoutMillis: Long?, debug: Boolean?, @@ -103,8 +96,6 @@ data class Configuration constructor( strictRunFilterConfiguration = strictRunFilterConfiguration ?: StrictRunFilterConfiguration(emptyList()), cache = cache ?: CacheConfiguration(), ignoreFailures = ignoreFailures ?: false, - isCodeCoverageEnabled = isCodeCoverageEnabled ?: false, - fallbackToScreenshots = fallbackToScreenshots ?: false, strictMode = strictMode ?: false, listener = listener, uncompletedTestRetryQuota = uncompletedTestRetryQuota ?: Integer.MAX_VALUE, @@ -113,7 +104,6 @@ data class Configuration constructor( excludeSerialRegexes = excludeSerialRegexes ?: emptyList(), ignoreFailureRegexes = ignoreFailureRegexes ?: emptyList(), failFastFailureRegexes = failFastFailureRegexes ?: emptyList(), - testBatchTimeoutMillis = testBatchTimeoutMillis ?: DEFAULT_EXECUTION_TIMEOUT_MILLIS, testOutputTimeoutMillis = testOutputTimeoutMillis ?: DEFAULT_OUTPUT_TIMEOUT_MILLIS, noDevicesTimeoutMillis = noDevicesTimeoutMillis ?: DEFAULT_NO_DEVICES_TIMEOUT_MILLIS, debug = debug ?: true, @@ -133,13 +123,10 @@ data class Configuration constructor( "strictRunFilter" to strictRunFilterConfiguration.toString(), "cache" to cache.toString(), "ignoreFailures" to ignoreFailures.toString(), - "isCodeCoverageEnabled" to isCodeCoverageEnabled.toString(), - "fallbackToScreenshots" to fallbackToScreenshots.toString(), "strictMode" to strictMode.toString(), "testClassRegexes" to testClassRegexes.toString(), "includeSerialRegexes" to includeSerialRegexes.toString(), "excludeSerialRegexes" to excludeSerialRegexes.toString(), - "testBatchTimeoutMillis" to testBatchTimeoutMillis.toString(), "testOutputTimeoutMillis" to testOutputTimeoutMillis.toString(), "noDevicesTimeoutMillis" to noDevicesTimeoutMillis.toString(), "debug" to debug.toString(), diff --git a/core/src/test/kotlin/com/malinskiy/marathon/cache/test/key/TestCacheKeyFactoryTest.kt b/core/src/test/kotlin/com/malinskiy/marathon/cache/test/key/TestCacheKeyFactoryTest.kt index 721a5aeef..df93e513d 100644 --- a/core/src/test/kotlin/com/malinskiy/marathon/cache/test/key/TestCacheKeyFactoryTest.kt +++ b/core/src/test/kotlin/com/malinskiy/marathon/cache/test/key/TestCacheKeyFactoryTest.kt @@ -3,9 +3,7 @@ package com.malinskiy.marathon.cache.test.key import com.malinskiy.marathon.cache.CacheKey import com.malinskiy.marathon.device.DevicePoolId import com.malinskiy.marathon.execution.ComponentInfo -import com.malinskiy.marathon.execution.Configuration import com.malinskiy.marathon.test.TestComponentInfo -import com.malinskiy.marathon.test.factory.configuration import kotlinx.coroutines.runBlocking import org.amshove.kluent.shouldBeEqualTo import org.amshove.kluent.shouldNotBeEqualTo @@ -75,26 +73,6 @@ class TestCacheKeyFactoryTest { } } - @Test - fun differentCacheKeysForDifferentCodeCoverageConfigurations() { - runBlocking { - val firstKey = createCacheKey(configuration = createConfiguration(codeCoverageEnabled = true)) - val secondKey = createCacheKey(configuration = createConfiguration(codeCoverageEnabled = false)) - - firstKey shouldNotBeEqualTo secondKey - } - } - - @Test - fun sameCacheKeysForSameCodeCoverageConfigurations() { - runBlocking { - val firstKey = createCacheKey(configuration = createConfiguration(codeCoverageEnabled = true)) - val secondKey = createCacheKey(configuration = createConfiguration(codeCoverageEnabled = true)) - - firstKey shouldBeEqualTo secondKey - } - } - @Test fun differentCacheKeysForDifferentTestPackageNames() { runBlocking { @@ -159,7 +137,6 @@ class TestCacheKeyFactoryTest { private fun createCacheKey( marathonVersion: String = "123", componentCacheKey: String = "abc", - configuration: Configuration = createConfiguration(), devicePoolId: DevicePoolId = DevicePoolId("omni"), test: MarathonTest = createTest() ): CacheKey = runBlocking { @@ -169,7 +146,7 @@ private fun createCacheKey( val versionNameProvider = mock { on { this.versionName }.thenReturn(marathonVersion) } - val cacheKeyFactory = TestCacheKeyFactory(componentCacheKeyProvider, versionNameProvider, configuration) + val cacheKeyFactory = TestCacheKeyFactory(componentCacheKeyProvider, versionNameProvider) cacheKeyFactory.getCacheKey(devicePoolId, test) } @@ -184,7 +161,3 @@ private fun createTest( componentInfo = TestComponentInfo(someInfo = "someInfo", name = "component-name"), metaProperties = emptyList() ) - -private fun createConfiguration(codeCoverageEnabled: Boolean = false) = configuration { - isCodeCoverageEnabled = codeCoverageEnabled -} diff --git a/marathon-gradle-plugin/src/main/kotlin/com/malinskiy/marathon/ConfigurationFactory.kt b/marathon-gradle-plugin/src/main/kotlin/com/malinskiy/marathon/ConfigurationFactory.kt index ef0e3e2f1..dc6805ecb 100644 --- a/marathon-gradle-plugin/src/main/kotlin/com/malinskiy/marathon/ConfigurationFactory.kt +++ b/marathon-gradle-plugin/src/main/kotlin/com/malinskiy/marathon/ConfigurationFactory.kt @@ -5,7 +5,6 @@ import com.malinskiy.marathon.android.DEFAULT_APPLICATION_PM_CLEAR import com.malinskiy.marathon.android.DEFAULT_AUTO_GRANT_PERMISSION import com.malinskiy.marathon.android.DEFAULT_INSTALL_OPTIONS import com.malinskiy.marathon.android.DEFAULT_USED_STORAGE_THRESHOLD_PERCENTS -import com.malinskiy.marathon.android.defaultInitTimeoutMillis import com.malinskiy.marathon.android.serial.SerialStrategy import com.malinskiy.marathon.execution.Configuration import ddmlibModule @@ -29,8 +28,6 @@ internal fun createCommonConfiguration( strictRunFilterConfiguration = extensionConfig.strictRunFilterConfiguration?.toStrictRunFilterConfiguration(), cache = extensionConfig.cache?.toCacheConfiguration(), ignoreFailures = extensionConfig.ignoreFailures, - isCodeCoverageEnabled = extensionConfig.isCodeCoverageEnabled, - fallbackToScreenshots = extensionConfig.fallbackToScreenshots, strictMode = extensionConfig.strictMode, listener = extensionConfig.listener, uncompletedTestRetryQuota = extensionConfig.uncompletedTestRetryQuota, @@ -39,7 +36,6 @@ internal fun createCommonConfiguration( excludeSerialRegexes = extensionConfig.excludeSerialRegexes?.map { it.toRegex() }, ignoreFailureRegexes = extensionConfig.ignoreFailureRegexes?.map { it.toRegex(RegexOption.DOT_MATCHES_ALL) }, failFastFailureRegexes = extensionConfig.failFastFailureRegexes?.map { it.toRegex(RegexOption.DOT_MATCHES_ALL) }, - testBatchTimeoutMillis = extensionConfig.testBatchTimeoutMillis, testOutputTimeoutMillis = extensionConfig.testOutputTimeoutMillis, noDevicesTimeoutMillis = extensionConfig.noDevicesTimeoutMillis, debug = extensionConfig.debug, @@ -51,7 +47,6 @@ private fun createAndroidConfiguration(extension: MarathonExtension, sdkDirector val instrumentationArgs = extension.instrumentationArgs val applicationPmClear = extension.applicationPmClear ?: DEFAULT_APPLICATION_PM_CLEAR val testApplicationPmClear = extension.testApplicationPmClear ?: DEFAULT_APPLICATION_PM_CLEAR - val adbInitTimeout = extension.adbInitTimeout ?: defaultInitTimeoutMillis val installOptions = extension.installOptions ?: DEFAULT_INSTALL_OPTIONS val preferableRecorderType = extension.preferableRecorderType val serialStrategy = extension.serialStrategy @@ -74,7 +69,6 @@ private fun createAndroidConfiguration(extension: MarathonExtension, sdkDirector instrumentationArgs, applicationPmClear, testApplicationPmClear, - adbInitTimeout, installOptions, preferableRecorderType, serialStrategy, diff --git a/marathon-gradle-plugin/src/main/kotlin/com/malinskiy/marathon/MarathonExtension.kt b/marathon-gradle-plugin/src/main/kotlin/com/malinskiy/marathon/MarathonExtension.kt index b44151769..6accc42bc 100644 --- a/marathon-gradle-plugin/src/main/kotlin/com/malinskiy/marathon/MarathonExtension.kt +++ b/marathon-gradle-plugin/src/main/kotlin/com/malinskiy/marathon/MarathonExtension.kt @@ -20,8 +20,6 @@ open class MarathonExtension { var cache: CachePluginConfiguration? = null var ignoreFailures: Boolean? = null - var isCodeCoverageEnabled: Boolean? = null - var fallbackToScreenshots: Boolean? = null var strictMode: Boolean? = null var uncompletedTestRetryQuota: Int? = null @@ -37,14 +35,12 @@ open class MarathonExtension { */ var failFastFailureRegexes: Collection? = null - var testBatchTimeoutMillis: Long? = null var testOutputTimeoutMillis: Long? = null var noDevicesTimeoutMillis: Long? = null var debug: Boolean? = null var applicationPmClear: Boolean? = null var testApplicationPmClear: Boolean? = null - var adbInitTimeout: Int? = null var installOptions: String? = null var serialStrategy: SerialStrategyConfiguration? = null diff --git a/vendor/vendor-android/base/src/main/kotlin/com/malinskiy/marathon/android/AndroidConfiguration.kt b/vendor/vendor-android/base/src/main/kotlin/com/malinskiy/marathon/android/AndroidConfiguration.kt index 4cc08d4b4..732502967 100644 --- a/vendor/vendor-android/base/src/main/kotlin/com/malinskiy/marathon/android/AndroidConfiguration.kt +++ b/vendor/vendor-android/base/src/main/kotlin/com/malinskiy/marathon/android/AndroidConfiguration.kt @@ -7,8 +7,6 @@ import com.malinskiy.marathon.vendor.VendorConfiguration import org.koin.core.module.Module import java.io.File -const val defaultInitTimeoutMillis = 30_000 - const val DEFAULT_AUTO_GRANT_PERMISSION = false const val DEFAULT_APPLICATION_PM_CLEAR = false const val DEFAULT_TEST_APPLICATION_PM_CLEAR = false @@ -22,7 +20,6 @@ data class AndroidConfiguration( val instrumentationArgs: Map = emptyMap(), val applicationPmClear: Boolean = DEFAULT_APPLICATION_PM_CLEAR, val testApplicationPmClear: Boolean = DEFAULT_TEST_APPLICATION_PM_CLEAR, - val adbInitTimeoutMillis: Int = defaultInitTimeoutMillis, val installOptions: String = DEFAULT_INSTALL_OPTIONS, val preferableRecorderType: DeviceFeature? = null, val serialStrategy: SerialStrategy = SerialStrategy.AUTOMATIC, diff --git a/vendor/vendor-android/ddmlib/src/test/kotlin/com/malinskiy/marathon/android/AndroidDeviceTestRunnerSpek.kt b/vendor/vendor-android/ddmlib/src/test/kotlin/com/malinskiy/marathon/android/AndroidDeviceTestRunnerSpek.kt index 1644ea3f1..92e2567d4 100644 --- a/vendor/vendor-android/ddmlib/src/test/kotlin/com/malinskiy/marathon/android/AndroidDeviceTestRunnerSpek.kt +++ b/vendor/vendor-android/ddmlib/src/test/kotlin/com/malinskiy/marathon/android/AndroidDeviceTestRunnerSpek.kt @@ -61,8 +61,6 @@ class AndroidDeviceTestRunnerSpek : Spek( strictRunFilterConfiguration = null, cache = null, ignoreFailures = null, - isCodeCoverageEnabled = null, - fallbackToScreenshots = null, strictMode = null, listener = null, uncompletedTestRetryQuota = null, @@ -71,7 +69,6 @@ class AndroidDeviceTestRunnerSpek : Spek( excludeSerialRegexes = null, ignoreFailureRegexes = null, failFastFailureRegexes = null, - testBatchTimeoutMillis = null, testOutputTimeoutMillis = null, noDevicesTimeoutMillis = null, debug = null, diff --git a/vendor/vendor-test/src/main/kotlin/com/malinskiy/marathon/test/factory/ConfigurationFactory.kt b/vendor/vendor-test/src/main/kotlin/com/malinskiy/marathon/test/factory/ConfigurationFactory.kt index 8768cd9f2..bff3bc2f0 100644 --- a/vendor/vendor-test/src/main/kotlin/com/malinskiy/marathon/test/factory/ConfigurationFactory.kt +++ b/vendor/vendor-test/src/main/kotlin/com/malinskiy/marathon/test/factory/ConfigurationFactory.kt @@ -29,7 +29,6 @@ class ConfigurationFactory { var excludeSerialRegexes: List? = null var ignoreFailureRegexes: List? = null var failFastFailureRegexes: List? = null - var fallbackToScreenshots: Boolean? = null var strictMode: Boolean? = null var uncompletedTestRetryQuota: Int? = null var filteringConfiguration: FilteringConfiguration? = null @@ -39,13 +38,11 @@ class ConfigurationFactory { var cache: CacheConfiguration? = null var ignoreFailures: Boolean? = null var includeSerialRegexes: List? = null - var isCodeCoverageEnabled: Boolean? = null var poolingStrategy: PoolingStrategy? = null var retryStrategy: RetryStrategy? = null var shardingStrategy: ShardingStrategy? = null var sortingStrategy: SortingStrategy? = null var testClassRegexes: Collection? = null - var testBatchTimeoutMillis: Long? = null var testOutputTimeoutMillis: Long? = null var noDevicesTimeoutMillis: Long? = null @@ -73,8 +70,6 @@ class ConfigurationFactory { strictRunFilterConfiguration = strictRunFilterConfiguration, cache = cache, ignoreFailures = ignoreFailures, - isCodeCoverageEnabled = isCodeCoverageEnabled, - fallbackToScreenshots = fallbackToScreenshots, strictMode = strictMode, listener = listener, uncompletedTestRetryQuota = uncompletedTestRetryQuota, @@ -83,7 +78,6 @@ class ConfigurationFactory { excludeSerialRegexes = excludeSerialRegexes, ignoreFailureRegexes = ignoreFailureRegexes, failFastFailureRegexes = failFastFailureRegexes, - testBatchTimeoutMillis = testBatchTimeoutMillis, testOutputTimeoutMillis = testOutputTimeoutMillis, noDevicesTimeoutMillis = noDevicesTimeoutMillis, debug = debug,