diff --git a/build.gradle.kts b/build.gradle.kts index c7e47600f..df45c8ce5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,8 +16,8 @@ buildscript { plugins { - id("io.gitlab.arturbosch.detekt") version "1.22.0" - id("com.github.ben-manes.versions") version "0.46.0" + id("io.gitlab.arturbosch.detekt") version "1.23.1" + id("com.github.ben-manes.versions") version "0.47.0" } configure { diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 43e87b815..c7caaee76 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -1,25 +1,25 @@ object Versions { val marathon = System.getenv("GIT_TAG_NAME") ?: "0.8.2" - val kotlin = "1.8.10" - val coroutines = "1.6.4" + val kotlin = "1.8.20" + val coroutines = "1.7.3" val coroutinesTest = coroutines - val androidCommon = "31.0.0" + val androidCommon = "31.1.0" val adam = "0.5.1" val dexTestParser = "2.3.4" val kotlinLogging = "3.0.5" - val logbackClassic = "1.4.7" + val logbackClassic = "1.4.8" val axmlParser = "1.0" - val bugsnag = "3.6.4" + val bugsnag = "3.7.0" val junitGradle = "1.2.0" val androidGradleVersion = "7.4.1" val gradlePluginPublish = "1.2.0" - val gradlePluginShadow = "7.1.2" + val gradlePluginShadow = "8.1.1" - val junit5 = "5.9.2" - val kluent = "1.72" + val junit5 = "5.10.0" + val kluent = "1.73" val kakao = "3.0.2" val espresso = "3.0.1" @@ -30,34 +30,34 @@ object Versions { val apacheCommonsText = "1.10.0" val apacheCommonsIO = "2.11.0" val apacheCommonsCodec = "1.15" - val okhttp = "4.10.0" + val okhttp = "4.11.0" val influxDbClient = "2.23" - val influxDb2Client = "6.8.0" - val clikt = "3.5.2" - val jacksonDatabind = "2.14.2" + val influxDb2Client = "6.10.0" + val clikt = "4.1.0" + val jacksonDatabind = "2.15.2" val jacksonKotlin = jacksonDatabind val jacksonYaml = jacksonDatabind val jacksonJSR310 = jacksonDatabind val jacksonAnnotations = jacksonDatabind val ddPlist = "1.27" - val guava = "31.1-jre" + val guava = "32.1.1-jre" val rsync4j = "3.2.7-1" val sshj = "0.35.0" val kotlinProcess = "1.4.1" - val testContainers = "1.18.0" + val testContainers = "1.18.3" val jupiterEngine = junit5 val jansi = "2.4.0" val scalr = "4.2" - val allureTestFilter = "2.21.0" - val allureJava = "2.21.0" + val allureTestFilter = "2.23.0" + val allureJava = "2.23.0" val allureKotlin = "2.4.0" val allureEnvironment = "1.0.0" val mockitoKotlin = "2.2.0" val dokka = "1.8.10" - val koin = "3.4.0" + val koin = "3.4.3" val jsonAssert = "1.5.1" val xmlUnit = "2.9.1" - val assertk = "0.25" + val assertk = "0.26.1" } object BuildPlugins { diff --git a/cli/build.gradle.kts b/cli/build.gradle.kts index 410fee724..033a99beb 100644 --- a/cli/build.gradle.kts +++ b/cli/build.gradle.kts @@ -4,7 +4,7 @@ plugins { jacoco id("org.jetbrains.kotlin.jvm") id("org.jetbrains.dokka") - id("com.github.gmazzo.buildconfig") version "4.0.1" + id("com.github.gmazzo.buildconfig") version "4.1.2" } val enableJDB = false diff --git a/cli/src/main/kotlin/com/malinskiy/marathon/cli/ApplicationView.kt b/cli/src/main/kotlin/com/malinskiy/marathon/cli/ApplicationView.kt index 1789c9a89..aa92e783f 100644 --- a/cli/src/main/kotlin/com/malinskiy/marathon/cli/ApplicationView.kt +++ b/cli/src/main/kotlin/com/malinskiy/marathon/cli/ApplicationView.kt @@ -81,13 +81,13 @@ private fun execute(cliConfiguration: CliConfiguration) { marathon.run(marathonStartConfiguration.executionCommand) } catch (e: Exception) { logger.error(e) {} - throw PrintMessage(message = "Marathon execution crashed", error = true) + throw PrintMessage(message = "Marathon execution crashed", statusCode = 1, printError = true) } when { - success -> throw PrintMessage(message = "Marathon execution finished", error = false) - configuration.ignoreFailures -> throw PrintMessage(message = "Marathon execution finished with failures (Failures suppressed because ignoreFailures is `true`)", error = false) - else -> throw PrintMessage(message = "Marathon execution failed", error = true) + success -> throw PrintMessage(message = "Marathon execution finished", statusCode = 1, printError = false) + configuration.ignoreFailures -> throw PrintMessage(message = "Marathon execution finished with failures (Failures suppressed because ignoreFailures is `true`)", statusCode = 1, printError = true) + else -> throw PrintMessage(message = "Marathon execution failed", statusCode = 1, printError = true) } } finally { stopKoin() diff --git a/configuration/build.gradle.kts b/configuration/build.gradle.kts index 59f76265b..ae5655694 100644 --- a/configuration/build.gradle.kts +++ b/configuration/build.gradle.kts @@ -2,7 +2,7 @@ plugins { id("org.jetbrains.kotlin.jvm") id("org.jetbrains.dokka") jacoco - id("com.github.gmazzo.buildconfig") version "4.0.1" + id("com.github.gmazzo.buildconfig") version "4.1.2" } dependencies { diff --git a/core/build.gradle.kts b/core/build.gradle.kts index ca79b56df..bb97cef15 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -6,7 +6,7 @@ plugins { id("org.jetbrains.kotlin.jvm") id("org.jetbrains.dokka") jacoco - id("com.github.gmazzo.buildconfig") version "4.0.1" + id("com.github.gmazzo.buildconfig") version "4.1.2" } sourceSets { diff --git a/core/src/main/kotlin/com/malinskiy/marathon/Marathon.kt b/core/src/main/kotlin/com/malinskiy/marathon/Marathon.kt index 4e0eae4f9..87813b1ae 100644 --- a/core/src/main/kotlin/com/malinskiy/marathon/Marathon.kt +++ b/core/src/main/kotlin/com/malinskiy/marathon/Marathon.kt @@ -41,6 +41,7 @@ import kotlinx.coroutines.withTimeoutOrNull import org.koin.core.context.stopKoin import java.util.concurrent.atomic.AtomicBoolean import kotlin.coroutines.coroutineContext +import kotlin.system.measureTimeMillis private val log = MarathonLogging.logger {} @@ -100,27 +101,30 @@ class Marathon( } suspend fun runAsync(executionCommand: ExecutionCommand = MarathonRunCommand): Boolean { - configureLogging() - - logSystemInformation() - configurationValidator.validate(configuration) - - deviceProvider.initialize() - val parsedAllTests = when (testParser) { - is LocalTestParser -> testParser.extract() - is RemoteTestParser<*> -> { - withRetry(3, 0) { - withTimeoutOrNull(configuration.deviceInitializationTimeoutMillis) { - val borrowedDevice = deviceProvider.borrow() - testParser.extract(borrowedDevice) - } ?: throw NoDevicesException("Timed out waiting for a temporary device for remote test parsing") + var parsedAllTests: List = emptyList() + measureTimeMillis { + configureLogging() + + logSystemInformation() + configurationValidator.validate(configuration) + + deviceProvider.initialize() + parsedAllTests = when (testParser) { + is LocalTestParser -> testParser.extract() + is RemoteTestParser<*> -> { + withRetry(3, 0) { + withTimeoutOrNull(configuration.deviceInitializationTimeoutMillis) { + val borrowedDevice = deviceProvider.borrow() + testParser.extract(borrowedDevice) + } ?: throw NoDevicesException("Timed out waiting for a temporary device for remote test parsing") + } } - } - else -> { - throw ConfigurationException("Unknown test parser type for ${testParser::class}, should inherit from either ${LocalTestParser::class.simpleName} or ${RemoteTestParser::class.simpleName}") + else -> { + throw ConfigurationException("Unknown test parser type for ${testParser::class}, should inherit from either ${LocalTestParser::class.simpleName} or ${RemoteTestParser::class.simpleName}") + } } - } + }.let { println("Took $it ms") } usageTracker.meta( version = BuildConfig.VERSION, releaseMode = BuildConfig.RELEASE_MODE, vendor = when (configuration.vendorConfiguration) { diff --git a/core/src/test/kotlin/com/malinskiy/marathon/scenario/DeviceFilteringScenarioTest.kt b/core/src/test/kotlin/com/malinskiy/marathon/scenario/DeviceFilteringScenarioTest.kt index 0f05ab7a4..e23a14b7f 100644 --- a/core/src/test/kotlin/com/malinskiy/marathon/scenario/DeviceFilteringScenarioTest.kt +++ b/core/src/test/kotlin/com/malinskiy/marathon/scenario/DeviceFilteringScenarioTest.kt @@ -1,3 +1,5 @@ +@file:OptIn(ExperimentalCoroutinesApi::class, ExperimentalTime::class) + package com.malinskiy.marathon.scenario import com.malinskiy.marathon.device.DeviceProvider @@ -5,6 +7,7 @@ import com.malinskiy.marathon.execution.TestStatus import com.malinskiy.marathon.test.StubDevice import com.malinskiy.marathon.test.assert.shouldBeEqualToAsJson import com.malinskiy.marathon.test.setupMarathon +import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.delay import kotlinx.coroutines.launch import kotlinx.coroutines.test.advanceTimeBy @@ -14,6 +17,7 @@ import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.Test import org.koin.core.context.stopKoin import java.io.File +import kotlin.time.ExperimentalTime import com.malinskiy.marathon.test.Test as MarathonTest class DeviceFilteringScenarioTest { diff --git a/core/src/test/kotlin/com/malinskiy/marathon/scenario/DisconnectingScenariosTest.kt b/core/src/test/kotlin/com/malinskiy/marathon/scenario/DisconnectingScenariosTest.kt index cc4bbba7d..aee000449 100644 --- a/core/src/test/kotlin/com/malinskiy/marathon/scenario/DisconnectingScenariosTest.kt +++ b/core/src/test/kotlin/com/malinskiy/marathon/scenario/DisconnectingScenariosTest.kt @@ -1,3 +1,5 @@ +@file:OptIn(ExperimentalCoroutinesApi::class, ExperimentalTime::class) + package com.malinskiy.marathon.scenario import com.malinskiy.marathon.device.DeviceProvider @@ -8,6 +10,7 @@ import com.malinskiy.marathon.test.setupMarathon import com.malinskiy.marathon.time.Timer import com.nhaarman.mockitokotlin2.mock import com.nhaarman.mockitokotlin2.whenever +import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.delay import kotlinx.coroutines.launch @@ -19,6 +22,7 @@ import org.junit.jupiter.api.Test import org.koin.core.context.stopKoin import java.io.File import java.util.concurrent.TimeUnit +import kotlin.time.ExperimentalTime import com.malinskiy.marathon.test.Test as MarathonTest class DisconnectingScenariosTest { diff --git a/core/src/test/kotlin/com/malinskiy/marathon/scenario/InvalidConfigScenariosTest.kt b/core/src/test/kotlin/com/malinskiy/marathon/scenario/InvalidConfigScenariosTest.kt index 600cf2042..e5824dc3e 100644 --- a/core/src/test/kotlin/com/malinskiy/marathon/scenario/InvalidConfigScenariosTest.kt +++ b/core/src/test/kotlin/com/malinskiy/marathon/scenario/InvalidConfigScenariosTest.kt @@ -1,3 +1,5 @@ +@file:OptIn(ExperimentalCoroutinesApi::class, ExperimentalTime::class) + package com.malinskiy.marathon.scenario import com.malinskiy.marathon.config.exceptions.ConfigurationException @@ -7,6 +9,7 @@ import com.malinskiy.marathon.device.DeviceProvider import com.malinskiy.marathon.execution.TestStatus import com.malinskiy.marathon.test.StubDevice import com.malinskiy.marathon.test.setupMarathon +import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.delay import kotlinx.coroutines.launch import kotlinx.coroutines.test.advanceTimeBy @@ -18,6 +21,7 @@ import org.junit.jupiter.api.assertThrows import org.koin.core.context.stopKoin import java.io.File import java.time.Instant +import kotlin.time.ExperimentalTime import com.malinskiy.marathon.test.Test as MarathonTest class InvalidConfigScenariosTest { diff --git a/core/src/test/kotlin/com/malinskiy/marathon/scenario/SuccessParseScenarioTest.kt b/core/src/test/kotlin/com/malinskiy/marathon/scenario/SuccessParseScenarioTest.kt index 6d4ffd2d4..6c04bb40a 100644 --- a/core/src/test/kotlin/com/malinskiy/marathon/scenario/SuccessParseScenarioTest.kt +++ b/core/src/test/kotlin/com/malinskiy/marathon/scenario/SuccessParseScenarioTest.kt @@ -1,3 +1,5 @@ +@file:OptIn(ExperimentalCoroutinesApi::class, ExperimentalTime::class) + package com.malinskiy.marathon.scenario import com.malinskiy.marathon.config.ParseCommand @@ -5,6 +7,7 @@ import com.malinskiy.marathon.device.DeviceProvider import com.malinskiy.marathon.execution.TestStatus import com.malinskiy.marathon.test.StubDevice import com.malinskiy.marathon.test.setupMarathon +import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.delay import kotlinx.coroutines.launch @@ -17,6 +20,7 @@ import org.junit.jupiter.api.Test import org.koin.core.context.stopKoin import java.io.File import java.util.concurrent.TimeUnit +import kotlin.time.ExperimentalTime import com.malinskiy.marathon.test.Test as MarathonTest class SuccessParseScenarioTest { diff --git a/core/src/test/kotlin/com/malinskiy/marathon/scenario/SuccessScenariosTest.kt b/core/src/test/kotlin/com/malinskiy/marathon/scenario/SuccessScenariosTest.kt index 9b91fd0fa..5401c0bef 100644 --- a/core/src/test/kotlin/com/malinskiy/marathon/scenario/SuccessScenariosTest.kt +++ b/core/src/test/kotlin/com/malinskiy/marathon/scenario/SuccessScenariosTest.kt @@ -1,3 +1,5 @@ +@file:OptIn(ExperimentalCoroutinesApi::class, ExperimentalTime::class) + package com.malinskiy.marathon.scenario import com.malinskiy.marathon.device.DeviceProvider @@ -5,6 +7,7 @@ import com.malinskiy.marathon.execution.TestStatus import com.malinskiy.marathon.test.StubDevice import com.malinskiy.marathon.test.assert.shouldBeEqualToAsJson import com.malinskiy.marathon.test.setupMarathon +import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.delay import kotlinx.coroutines.launch @@ -16,6 +19,7 @@ import org.junit.jupiter.api.Test import org.koin.core.context.stopKoin import java.io.File import java.util.concurrent.TimeUnit +import kotlin.time.ExperimentalTime import com.malinskiy.marathon.test.Test as MarathonTest class SuccessScenariosTest { diff --git a/core/src/test/kotlin/com/malinskiy/marathon/scenario/UncompletedScenariosTest.kt b/core/src/test/kotlin/com/malinskiy/marathon/scenario/UncompletedScenariosTest.kt index fc4273ec9..48b7b3df8 100644 --- a/core/src/test/kotlin/com/malinskiy/marathon/scenario/UncompletedScenariosTest.kt +++ b/core/src/test/kotlin/com/malinskiy/marathon/scenario/UncompletedScenariosTest.kt @@ -1,3 +1,5 @@ +@file:OptIn(ExperimentalCoroutinesApi::class, ExperimentalTime::class) + package com.malinskiy.marathon.scenario import com.malinskiy.marathon.config.strategy.RetryStrategyConfiguration @@ -9,6 +11,7 @@ import com.malinskiy.marathon.test.setupMarathon import com.malinskiy.marathon.time.Timer import com.nhaarman.mockitokotlin2.mock import com.nhaarman.mockitokotlin2.whenever +import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.delay import kotlinx.coroutines.launch @@ -20,6 +23,7 @@ import org.junit.jupiter.api.Test import org.koin.core.context.stopKoin import java.io.File import java.util.concurrent.TimeUnit +import kotlin.time.ExperimentalTime import com.malinskiy.marathon.test.Test as MarathonTest class UncompletedScenariosTest { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fae08049a..84a0b92f9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/sample/android-app/build.gradle.kts b/sample/android-app/build.gradle.kts index 5a7bc284f..f35b81931 100644 --- a/sample/android-app/build.gradle.kts +++ b/sample/android-app/build.gradle.kts @@ -10,7 +10,7 @@ buildscript { } plugins { - id("com.github.ben-manes.versions") version "0.46.0" + id("com.github.ben-manes.versions") version "0.47.0" } fun isNonStable(version: String): Boolean { diff --git a/sample/android-cucumber-app/build.gradle.kts b/sample/android-cucumber-app/build.gradle.kts index 5a7bc284f..f35b81931 100644 --- a/sample/android-cucumber-app/build.gradle.kts +++ b/sample/android-cucumber-app/build.gradle.kts @@ -10,7 +10,7 @@ buildscript { } plugins { - id("com.github.ben-manes.versions") version "0.46.0" + id("com.github.ben-manes.versions") version "0.47.0" } fun isNonStable(version: String): Boolean { diff --git a/sample/android-library/build.gradle.kts b/sample/android-library/build.gradle.kts index 5a7bc284f..f35b81931 100644 --- a/sample/android-library/build.gradle.kts +++ b/sample/android-library/build.gradle.kts @@ -10,7 +10,7 @@ buildscript { } plugins { - id("com.github.ben-manes.versions") version "0.46.0" + id("com.github.ben-manes.versions") version "0.47.0" } fun isNonStable(version: String): Boolean { diff --git a/vendor/vendor-ios/src/test/kotlin/com/malinskiy/marathon/ios/cmd/BaseCommandExecutorTest.kt b/vendor/vendor-ios/src/test/kotlin/com/malinskiy/marathon/ios/cmd/BaseCommandExecutorTest.kt index 7580db577..1f7c888e6 100644 --- a/vendor/vendor-ios/src/test/kotlin/com/malinskiy/marathon/ios/cmd/BaseCommandExecutorTest.kt +++ b/vendor/vendor-ios/src/test/kotlin/com/malinskiy/marathon/ios/cmd/BaseCommandExecutorTest.kt @@ -1,6 +1,9 @@ +@file:OptIn(ExperimentalTime::class) + package com.malinskiy.marathon.ios.cmd import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.async import kotlinx.coroutines.delay import kotlinx.coroutines.runBlocking @@ -13,6 +16,7 @@ import org.amshove.kluent.shouldNotBeEqualTo import org.junit.jupiter.api.Test import java.nio.charset.Charset import java.time.Duration +import kotlin.time.ExperimentalTime abstract class BaseCommandExecutorTest { abstract fun createExecutor(): CommandExecutor