Fix 182 bunch tests, do not perform task tests on older platform versions

This commit is contained in:
Yan Zhulanow
2019-06-05 00:25:56 +09:00
parent a575c7e5b5
commit 09ff9a65a5
4 changed files with 38 additions and 8 deletions
@@ -383,19 +383,17 @@ class NewMultiplatformProjectImportingTest : MultiplePluginVersionGradleImportin
}
}
fun findTasksToRun(file: VirtualFile): List<String> {
return GradleTestRunConfigurationProducer.findAllTestsTaskToRun(file, myProject)
.flatMap { it.tasks }
.sorted()
}
val commonTestFile = files.find { it.path.contains("commonTest") }!!
val commonTasks = findTasksToRun(commonTestFile)
assertEquals(listOf(":cleanJvmTest", ":jvmTest"), commonTasks)
if (commonTasks != null) {
assertEquals(listOf(":cleanJvmTest", ":jvmTest"), commonTasks)
}
val jvmTestFile = files.find { it.path.contains("jvmTest") }!!
val jvmTasks = findTasksToRun(jvmTestFile)
assertEquals(listOf(":cleanJvmTest", ":jvmTest"), jvmTasks)
if (jvmTasks != null) {
assertEquals(listOf(":cleanJvmTest", ":jvmTest"), jvmTasks)
}
}
@Test
@@ -0,0 +1,16 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.gradle
import com.intellij.openapi.vfs.VirtualFile
import org.jetbrains.kotlin.idea.codeInsight.gradle.MultiplePluginVersionGradleImportingTestCase
import org.jetbrains.plugins.gradle.execution.test.runner.GradleTestRunConfigurationProducer
fun MultiplePluginVersionGradleImportingTestCase.findTasksToRun(file: VirtualFile): List<String>? {
return GradleTestRunConfigurationProducer.findAllTestsTaskToRun(file, project)
.flatMap { it.tasks }
.sorted()
}
@@ -0,0 +1,13 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.gradle
import com.intellij.openapi.vfs.VirtualFile
import org.jetbrains.kotlin.idea.codeInsight.gradle.MultiplePluginVersionGradleImportingTestCase
fun MultiplePluginVersionGradleImportingTestCase.findTasksToRun(file: VirtualFile): List<String>? {
return null
}
@@ -9,11 +9,14 @@
*/
package org.jetbrains.kotlin.idea.codeInsight.gradle
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import org.junit.runners.Parameterized
import java.util.*
abstract class MultiplePluginVersionGradleImportingTestCase : GradleImportingTestCase() {
val project: Project
get() = myProject
@JvmField
@Parameterized.Parameter(1)