Use cache-redirector for downloading in parcelize tests
There's a flaky failures when ~/.m2/repository/org/robolectric/android-all/5.0.2_r3-robolectric-r0/android-all-5.0.2_r3-robolectric-r0.jar is partially downloaded during tests execution. This led to Parcelize tests failure with: Caused by: java.util.zip.ZipException: invalid LOC header (bad signature) at java.util.zip.ZipFile.read(Native Method) at java.util.zip.ZipFile.access$1400(ZipFile.java:60) at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:734) at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:434) at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158) at java.io.FilterInputStream.read(FilterInputStream.java:133) at java.io.FilterInputStream.read(FilterInputStream.java:107) at org.robolectric.util.Util.copy(Util.java:21) at org.robolectric.util.Util.readBytes(Util.java:38) at org.robolectric.internal.bytecode.SandboxClassLoader.getByteCode(SandboxClassLoader.java:166) ... 36 more Option used was found at https://github.com/robolectric/robolectric/blob/7697d1217c5eb0dee454004efe60ba219f398255/plugins/maven-dependency-resolver/src/main/java/org/robolectric/MavenRoboSettings.java#L19 ^KTI-842 Fixed
This commit is contained in:
@@ -204,6 +204,7 @@ fun Project.projectTest(
|
||||
systemProperty("jps.kotlin.home", project.rootProject.extra["distKotlinHomeDir"]!!)
|
||||
systemProperty("kotlin.ni", if (project.rootProject.hasProperty("newInferenceTests")) "true" else "false")
|
||||
systemProperty("org.jetbrains.kotlin.skip.muted.tests", if (project.rootProject.hasProperty("skipMutedTests")) "true" else "false")
|
||||
systemProperty("cacheRedirectorEnabled", project.rootProject.findProperty("cacheRedirectorEnabled")?.toString() ?: "false")
|
||||
project.kotlinBuildProperties.junit5NumberOfThreadsForParallelExecution?.let { n ->
|
||||
systemProperty("junit.jupiter.execution.parallel.config.strategy", "fixed")
|
||||
systemProperty("junit.jupiter.execution.parallel.config.fixed.parallelism", n)
|
||||
|
||||
+3
-1
@@ -12,7 +12,9 @@ import org.junit.runner.JUnitCore
|
||||
|
||||
class ParcelizeMainClassProvider(testServices: TestServices) : JvmBoxMainClassProvider(testServices) {
|
||||
override fun getMainClassNameAndAdditionalArguments(): List<String> {
|
||||
return listOf(
|
||||
return listOfNotNull(
|
||||
"-Drobolectric.dependency.repo.url=https://cache-redirector.jetbrains.com/maven-central"
|
||||
.takeIf { "true" == System.getProperty("cacheRedirectorEnabled") },
|
||||
JUnitCore::class.java.name,
|
||||
JUNIT_GENERATED_TEST_CLASS_FQNAME
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user