【问题标题】:Configure or specify Marathonfile with Malinskiy's marathon gradle plugin?使用 Malinskiy 的 marathon gradle 插件配置或指定 Marathonfile?
【发布时间】:2020-06-15 05:44:18
【问题描述】:
我正在使用 Marathon 的 gradle 插件来运行我的测试。 Gradle 任务包括“marathon”和“marathonInternalStagingAndroidTest”。我可以从 Android Studio 和命令行运行。我似乎无法做的是配置它。文档没有说明如何配置 gradle 插件。
可以通过 gradle 任务来配置吗?或者它可以像标准安装一样使用 Marathonfile 吗?
./gradlew marathon -Pmarathonfile='/Users//Android/Marathonfile' 运行马拉松任务,但没有使用我指向的马拉松文件。
【问题讨论】:
标签:
android
gradle
android-gradle-plugin
android-testing
【解决方案1】:
在撰写本文时,gradle 插件没有使用 Marathonfile。同样截至今天,documentation 已更新!配置通过在您的 gradle 文件中添加 groovy/kotlin DSL 来实现,如下所示:
marathon {
name = "sample-app tests"
baseOutputDir = "./marathon"
analytics {
influx {
url = "http://influx.svc.cluster.local:8086"
user = "root"
password = "root"
dbName = "marathon"
}
}
poolingStrategy {
operatingSystem = true
}
shardingStrategy {
countSharding {
count = 5
}
}
sortingStrategy {
executionTime {
percentile = 90.0
executionTime = Instant.now().minus(3, ChronoUnit.DAYS)
}
}
batchingStrategy {
fixedSize {
size = 10
}
}
flakinessStrategy {
probabilityBased {
minSuccessRate = 0.8
maxCount = 3
timeLimit = Instant.now().minus(30, ChronoUnit.DAYS)
}
}
retryStrategy {
fixedQuota {
totalAllowedRetryQuota = 200
retryPerTestQuota = 3
}
}
filteringConfiguration {
whitelist {
add(SimpleClassnameFilter(".*".toRegex()))
}
blacklist {
add(SimpleClassnameFilter("$^".toRegex()))
}
}
testClassRegexes = listOf("^((?!Abstract).)*Test$")
includeSerialRegexes = emptyList()
excludeSerialRegexes = emptyList()
uncompletedTestRetryQuota = 100
ignoreFailures = false
isCodeCoverageEnabled = false
fallbackToScreenshots = false
testOutputTimeoutMillis = 30_000
strictMode = false
debug = true
autoGrantPermission = true
}