Skip to content

Commit

Permalink
Merge branch 'develop' into feature/android-profiling
Browse files Browse the repository at this point in the history
  • Loading branch information
Malinskiy committed Nov 5, 2024
2 parents 36467f0 + 16c55ad commit 7d376e5
Show file tree
Hide file tree
Showing 37 changed files with 822 additions and 120 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: ci
on: [ push, pull_request ]
permissions:
checks: write
contents: write
jobs:
ci:
runs-on: ubuntu-22.04
Expand All @@ -9,7 +12,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'
- name: test
run: |
chmod 0600 $GITHUB_WORKSPACE/vendor/vendor-apple/base/src/test/resources/fixtures/derived-data-manager/test_rsa
Expand All @@ -19,7 +22,7 @@ jobs:
uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
report_paths: '**/build/test-results/*/TEST-*.xml'
- name: detekt
run: |
./gradlew clean detektCheck || true
Expand All @@ -33,7 +36,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'
- uses: little-core-labs/[email protected]
id: tag
if: ${{ startsWith(github.ref, 'refs/tags/') }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ XXX [main] INFO com.malinskiy.marathon.cli.config.ConfigFactory - Checking Marat
```

### Requirements
Marathon requires Java Runtime Environment 8 or higher.
Marathon requires Java Runtime Environment 17 or higher.

## Move even faster with Marathon Cloud
<h1 align="center">
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ buildscript {


plugins {
id("io.gitlab.arturbosch.detekt") version "1.23.4"
id("io.gitlab.arturbosch.detekt") version "1.23.6"
id("com.github.ben-manes.versions") version "0.51.0"
}

Expand Down
52 changes: 27 additions & 25 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,55 +1,56 @@
object Versions {
val marathon = System.getenv("GIT_TAG_NAME") ?: "0.10.1"

val kotlin = "1.9.10"
val coroutines = "1.7.3"
val kotlin = "1.9.24"
val coroutines = "1.8.1"
val coroutinesTest = coroutines

val androidCommon = "31.2.2"
val androidCommon = "31.6.1"
val adam = "0.5.8"
val dexTestParser = "2.3.4"
val kotlinLogging = "3.0.5"
val logbackClassic = "1.4.14"
val logbackClassic = "1.5.8"
val axmlParser = "1.0"
val bugsnag = "3.7.1"
val bugsnag = "3.7.2"

val junitGradle = "1.2.0"

val junit5 = "5.10.1"
val junit5 = "5.11.0"
val kluent = "1.73"

val kakao = "3.0.2"
val gson = "2.10.1"
val apacheCommonsText = "1.11.0"
val apacheCommonsIO = "2.11.0"
val gson = "2.11.0"
val apacheCommonsText = "1.12.0"
val apacheCommonsIO = "2.17.0"
val okhttp = "4.12.0"
val ktor = "2.3.6"
val influxDbClient = "2.24"
val influxDb2Client = "6.12.0"
val clikt = "4.2.2"
val jacksonDatabind = "2.15.3"
val influxDb2Client = "7.2.0"
val clikt = "5.0.0"
val jacksonDatabind = "2.17.2"
val jacksonKotlin = jacksonDatabind
val jacksonYaml = jacksonDatabind
val jacksonJSR310 = jacksonDatabind
val jacksonAnnotations = jacksonDatabind
val ddPlist = "1.27"
val guava = "33.0.0-jre"
val rsync4j = "3.2.7-6"
val sshj = "0.38.0"
val kotlinProcess = "1.4.1"
val testContainers = "1.19.4"
val ddPlist = "1.28"
val guava = "33.3.0-jre"
val rsync4j = "3.3.0-1"
val sshj = "0.39.0"
val kotlinProcess = "1.5"
val testContainers = "1.20.1"
val jupiterEngine = junit5
val jansi = "2.4.1"
val scalr = "4.2"
val allureTestFilter = "2.25.0"
val allureJava = "2.25.0"
val allureTestFilter = "2.29.0"
val allureJava = "2.29.0"
val allureKotlin = "2.4.0"
val allureEnvironment = "1.0.0"
val mockitoKotlin = "5.2.1"
val mockitoKotlin = "5.4.0"
val dokka = "1.9.10"
val koin = "3.5.3"
val jsonAssert = "1.5.1"
val xmlUnit = "2.9.1"
val assertk = "0.28.0"
val koin = "3.5.6"
val jsonAssert = "1.5.3"
val xmlUnit = "2.10.0"
val assertk = "0.28.1"
}

object BuildPlugins {
Expand Down Expand Up @@ -95,6 +96,7 @@ object Libraries {
val bugsnag = "com.bugsnag:bugsnag:${Versions.bugsnag}"
val kotlinProcess = "com.github.pgreze:kotlin-process:${Versions.kotlinProcess}"
val okhttp = "com.squareup.okhttp3:okhttp:${Versions.okhttp}"
val ktorNetwork = "io.ktor:ktor-network:${Versions.ktor}"
}

object TestLibraries {
Expand Down
2 changes: 1 addition & 1 deletion cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
jacoco
id("org.jetbrains.kotlin.jvm")
id("org.jetbrains.dokka")
id("com.github.gmazzo.buildconfig") version "5.3.5"
id("com.github.gmazzo.buildconfig") version "5.5.0"
}

val enableJDB = false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.malinskiy.marathon.cli

import com.github.ajalt.clikt.core.PrintMessage
import com.github.ajalt.clikt.core.main
import com.github.ajalt.clikt.core.subcommands
import com.malinskiy.marathon.Marathon
import com.malinskiy.marathon.exceptions.ExceptionsReporter
Expand Down
37 changes: 27 additions & 10 deletions cli/src/main/kotlin/com/malinskiy/marathon/cli/args/CliCommands.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.malinskiy.marathon.cli.args

import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.core.Context
import com.github.ajalt.clikt.parameters.groups.OptionGroup
import com.github.ajalt.clikt.parameters.groups.provideDelegate
import com.github.ajalt.clikt.parameters.options.convert
Expand All @@ -10,22 +11,23 @@ import com.github.ajalt.clikt.parameters.types.file
import java.io.File

class MarathonRunCommonOptions : OptionGroup() {
val marathonfile by option("--marathonfile", "-m", help="Marathonfile file path")
val marathonfile by option("--marathonfile", "-m", help = "Marathonfile file path")
.file()
.default(File("Marathonfile"))
val analyticsTracking by option("--analyticsTracking", help="Enable / Disable anonymous analytics tracking. Enabled by default.")
val analyticsTracking by option("--analyticsTracking", help = "Enable / Disable anonymous analytics tracking. Enabled by default.")
.convert { it.toBoolean() }
.default(true)
val bugsnagReporting by option("--bugsnag", help="Enable/Disable anonymous crash reporting. Enabled by default")
val bugsnagReporting by option("--bugsnag", help = "Enable/Disable anonymous crash reporting. Enabled by default")
.convert { it.toBoolean() }
.default(true)
}

class MarathonCli(
private val starter: (CliConfiguration) -> Unit
) : CliktCommand(invokeWithoutSubcommand = true, name = "marathon") {
) : CliktCommand(name = "marathon") {

private val marathonRunCommonOptions by MarathonRunCommonOptions()
override val invokeWithoutSubcommand = true

override fun run() {
val subcommand = currentContext.invokedSubcommand
Expand All @@ -45,23 +47,34 @@ class MarathonCli(

class Version(
private val starter: (CliConfiguration) -> Unit
) : CliktCommand(name = "version", help="Print version and exit") {
) : CliktCommand(name = "version") {
override fun run() {
starter(VersionCommandCliConfiguration)
}

override fun help(context: Context) = "Print version and exit"
}

class Parse(
private val starter: (CliConfiguration) -> Unit
): CliktCommand(name = "parse", help="Print the list of tests without executing them") {
) : CliktCommand(name = "parse") {

private val marathonfile by option("--marathonfile", "-m", help="Marathonfile file path")
private val marathonfile by option("--marathonfile", "-m", help = "Marathonfile file path")
.file()
.default(File("Marathonfile"))
private val parseOutputFileName by option("--output", "-o", help="Output file name without extension. Will be in the outputDir with .yaml extension")
private val includeFlakyTests by option("--include-flaky-tests", "-f", help="Include/exclude flaky tests that will have preventive retries according to the current flakinessStrategy")
private val parseOutputFileName by option(
"--output",
"-o",
help = "Output file name without extension. Will be in the outputDir with .yaml extension"
)
private val includeFlakyTests by option(
"--include-flaky-tests",
"-f",
help = "Include/exclude flaky tests that will have preventive retries according to the current flakinessStrategy"
)
.convert { it.toBoolean() }
.default(false)

override fun run() {
val parseCommandCliConfiguration = ParseCommandCliConfiguration(
marathonfile = marathonfile,
Expand All @@ -70,11 +83,13 @@ class Parse(
)
starter(parseCommandCliConfiguration)
}

override fun help(context: Context) = "Print the list of tests without executing them"
}

class RunMarathon(
private val starter: (CliConfiguration) -> Unit
) : CliktCommand(name = "run", help="Run Marathon to execute tests") {
) : CliktCommand(name = "run") {

private val marathonRunCommonOptions by MarathonRunCommonOptions()

Expand All @@ -86,4 +101,6 @@ class RunMarathon(
)
starter(marathonRunCommandCliConfiguration)
}

override fun help(context: Context) = "Run Marathon to execute tests"
}
2 changes: 1 addition & 1 deletion configuration/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id("org.jetbrains.kotlin.jvm")
id("org.jetbrains.dokka")
jacoco
id("com.github.gmazzo.buildconfig") version "5.3.5"
id("com.github.gmazzo.buildconfig") version "5.5.0"
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.malinskiy.marathon.config.vendor.android.TestAccessConfiguration
import com.malinskiy.marathon.config.vendor.android.TestParserConfiguration
import com.malinskiy.marathon.config.vendor.android.ThreadingConfiguration
import com.malinskiy.marathon.config.vendor.apple.AppleTestBundleConfiguration
import com.malinskiy.marathon.config.vendor.apple.DeviceProvider
import com.malinskiy.marathon.config.vendor.apple.ios.LifecycleConfiguration
import com.malinskiy.marathon.config.vendor.apple.ios.PermissionsConfiguration
import com.malinskiy.marathon.config.vendor.apple.RsyncConfiguration
Expand Down Expand Up @@ -157,6 +158,7 @@ sealed class VendorConfiguration {
*/
data class IOSConfiguration(
@JsonProperty("bundle") val bundle: AppleTestBundleConfiguration? = null,
@JsonProperty("deviceProvider") val deviceProvider: DeviceProvider = DeviceProvider.Static(),
@JsonProperty("devices") val devicesFile: File? = null,
@JsonProperty("ssh") val ssh: SshConfiguration = SshConfiguration(),

Expand Down Expand Up @@ -188,6 +190,7 @@ sealed class VendorConfiguration {

data class MacosConfiguration(
@JsonProperty("bundle") val bundle: AppleTestBundleConfiguration? = null,
@JsonProperty("deviceProvider") val deviceProvider: DeviceProvider = DeviceProvider.Static(),
@JsonProperty("devices") val devicesFile: File? = null,
@JsonProperty("ssh") val ssh: SshConfiguration = SshConfiguration(),

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.malinskiy.marathon.config.vendor.apple

import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.annotation.JsonSubTypes
import com.fasterxml.jackson.annotation.JsonTypeInfo
import java.io.File

@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
property = "type"
)
@JsonSubTypes(
JsonSubTypes.Type(value = DeviceProvider.Static::class, names = arrayOf("static", "marathondevices")),
JsonSubTypes.Type(value = DeviceProvider.Dynamic::class, name = "dynamic"),
)
sealed class DeviceProvider {
data class Static(
@JsonProperty("path") val path: File? = null
) : DeviceProvider()

data class Dynamic(
@JsonProperty("host") val host: String = "127.0.0.1",
@JsonProperty("port") val port: Int = 5037,
) : DeviceProvider()
}
2 changes: 1 addition & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id("org.jetbrains.kotlin.jvm")
id("org.jetbrains.dokka")
jacoco
id("com.github.gmazzo.buildconfig") version "5.3.5"
id("com.github.gmazzo.buildconfig") version "5.5.0"
}

sourceSets {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.malinskiy.marathon.config.Configuration
import com.malinskiy.marathon.device.DeviceFeature
import com.malinskiy.marathon.device.DeviceInfo
import com.malinskiy.marathon.device.DevicePoolId
import com.malinskiy.marathon.execution.AttachmentType
import com.malinskiy.marathon.execution.TestResult
import com.malinskiy.marathon.execution.TestStatus
import com.malinskiy.marathon.extension.escape
Expand Down Expand Up @@ -175,14 +176,10 @@ class HtmlSummaryReporter(
}
}

private fun TestResult.receiveVideoPath(poolId: String, batchId: String): String {
val videoRelativePath =
fileManager.createFile(FileType.VIDEO, DevicePoolId(poolId), device, test, batchId).relativePathTo(rootOutput)
val videoFullPath = File(rootOutput, videoRelativePath)
return when (device.deviceFeatures.contains(DeviceFeature.VIDEO) && videoFullPath.exists()) {
true -> "../../../../${videoRelativePath.replace("#", "%23")}"
false -> ""
}
private fun TestResult.receiveVideoPaths(poolId: String, batchId: String): List<String> {
if (!device.deviceFeatures.contains(DeviceFeature.VIDEO)) return emptyList()
return attachments.filter { it.type == AttachmentType.VIDEO && it.file.exists() }.map { it.file.relativePathTo(rootOutput) }
.map { "../../../../${it.replace("#","%23")}" }
}

private fun TestResult.receiveLogPath(poolId: String, batchId: String): String {
Expand All @@ -209,7 +206,7 @@ class HtmlSummaryReporter(
diagnosticScreenshots = device.deviceFeatures.contains(DeviceFeature.SCREENSHOT),
stacktrace = stacktrace,
screenshot = receiveScreenshotPath(poolId, batchId),
video = receiveVideoPath(poolId, batchId),
videos = receiveVideoPaths(poolId, batchId),
logFile = receiveLogPath(poolId, batchId)
)

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
9 changes: 6 additions & 3 deletions html-report/src/components/TestItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ export default class TestItem extends Component {
</div>
</div>

{!!data.video && <div className='card row full'>
<ReactPlayer url={data.video} controls={true} playsinline={true}/>
</div>}
<div className="container-expanded list">
{data.videos.map((video, i) => {
return (<div className='card row full'><ReactPlayer url={video} controls={true} playsinline={true}/></div>)
})
}
</div>

{!!data.screenshot && <div className='card row full'>
<img src={data.screenshot}/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ data class HtmlFullTest(
@SerializedName("diagnostic_video") val diagnosticVideo: Boolean,
@SerializedName("diagnostic_screenshots") val diagnosticScreenshots: Boolean,
@SerializedName("screenshot") val screenshot: String,
@SerializedName("video") val video: String,
@SerializedName("videos") val videos: List<String>,
@SerializedName("log_file") val logFile: String,
)

Large diffs are not rendered by default.

Loading

0 comments on commit 7d376e5

Please sign in to comment.