Remove KotlinGradlePluginJpsParametrizedIT
We've stopped running it on CI some time ago, does not seem very useful now
This commit is contained in:
@@ -44,8 +44,6 @@ dependencies {
|
|||||||
testCompileOnly(project(":kotlin-test:kotlin-test-common")) { isTransitive = false }
|
testCompileOnly(project(":kotlin-test:kotlin-test-common")) { isTransitive = false }
|
||||||
}
|
}
|
||||||
|
|
||||||
val jpsIncrementalTestsClass = "**/KotlinGradlePluginJpsParametrizedIT.class"
|
|
||||||
|
|
||||||
projectTest {
|
projectTest {
|
||||||
executable = "${rootProject.extra["JDK_18"]!!}/bin/java"
|
executable = "${rootProject.extra["JDK_18"]!!}/bin/java"
|
||||||
dependsOn(":kotlin-gradle-plugin:validateTaskProperties")
|
dependsOn(":kotlin-gradle-plugin:validateTaskProperties")
|
||||||
@@ -71,19 +69,12 @@ projectTest {
|
|||||||
":kotlin-scripting-compiler-embeddable:install",
|
":kotlin-scripting-compiler-embeddable:install",
|
||||||
":kotlin-test-nodejs-runner:install"
|
":kotlin-test-nodejs-runner:install"
|
||||||
)
|
)
|
||||||
exclude(jpsIncrementalTestsClass)
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.register<Test>("testsFromJps") {
|
|
||||||
include(jpsIncrementalTestsClass)
|
|
||||||
dependsOn(tasks.getByName("test").dependsOn)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register<Test>("testAdvanceGradleVersion") {
|
tasks.register<Test>("testAdvanceGradleVersion") {
|
||||||
val gradleVersionForTests = "5.3-rc-2"
|
val gradleVersionForTests = "5.3-rc-2"
|
||||||
systemProperty("kotlin.gradle.version.for.tests", gradleVersionForTests)
|
systemProperty("kotlin.gradle.version.for.tests", gradleVersionForTests)
|
||||||
dependsOn(tasks.getByName("test").dependsOn)
|
dependsOn(tasks.getByName("test").dependsOn)
|
||||||
exclude(jpsIncrementalTestsClass)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.named<Task>("check") {
|
tasks.named<Task>("check") {
|
||||||
|
|||||||
-101
@@ -1,101 +0,0 @@
|
|||||||
package org.jetbrains.kotlin.jps
|
|
||||||
|
|
||||||
import org.gradle.api.logging.LogLevel
|
|
||||||
import org.jetbrains.kotlin.gradle.BaseGradleIT
|
|
||||||
import org.jetbrains.kotlin.gradle.GradleVersionRequired
|
|
||||||
import org.jetbrains.kotlin.incremental.BuildStep
|
|
||||||
import org.jetbrains.kotlin.incremental.parseTestBuildLog
|
|
||||||
import org.jetbrains.kotlin.incremental.testingUtils.*
|
|
||||||
import org.junit.Assume
|
|
||||||
import java.io.File
|
|
||||||
import kotlin.test.assertEquals
|
|
||||||
|
|
||||||
abstract class BaseIncrementalGradleIT : BaseGradleIT() {
|
|
||||||
|
|
||||||
inner class JpsTestProject(
|
|
||||||
val buildLogFinder: BuildLogFinder,
|
|
||||||
val resourcesBase: File,
|
|
||||||
val relPath: String,
|
|
||||||
minLogLevel: LogLevel = LogLevel.DEBUG
|
|
||||||
) : Project(File(relPath).name, GradleVersionRequired.None, null, minLogLevel) {
|
|
||||||
|
|
||||||
override val resourcesRoot = File(resourcesBase, relPath)
|
|
||||||
val mapWorkingToOriginalFile = hashMapOf<File, File>()
|
|
||||||
|
|
||||||
override fun setupWorkingDir() {
|
|
||||||
val srcDir = File(projectDir, "src")
|
|
||||||
srcDir.mkdirs()
|
|
||||||
val sourceMapping = copyTestSources(resourcesRoot, srcDir, filePrefix = "")
|
|
||||||
mapWorkingToOriginalFile.putAll(sourceMapping)
|
|
||||||
copyDirRecursively(File(resourcesRootFile, "incrementalGradleProject"), projectDir)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun JpsTestProject.performAndAssertBuildStages(options: BuildOptions = defaultBuildOptions(), weakTesting: Boolean = false) {
|
|
||||||
// TODO: support multimodule tests
|
|
||||||
if (resourcesRoot.walk().filter { it.name.equals("dependencies.txt", ignoreCase = true) }.any()) {
|
|
||||||
Assume.assumeTrue("multimodule tests are not supported yet", false)
|
|
||||||
}
|
|
||||||
|
|
||||||
build("build", options = options) {
|
|
||||||
assertSuccessful()
|
|
||||||
assertReportExists()
|
|
||||||
}
|
|
||||||
|
|
||||||
val buildLogFile =
|
|
||||||
buildLogFinder.findBuildLog(resourcesRoot) ?: throw IllegalStateException("build log file not found in $resourcesRoot")
|
|
||||||
val buildLogSteps = parseTestBuildLog(buildLogFile)
|
|
||||||
val modifications = getModificationsToPerform(
|
|
||||||
resourcesRoot,
|
|
||||||
moduleNames = null,
|
|
||||||
allowNoFilesWithSuffixInTestData = false,
|
|
||||||
touchPolicy = TouchPolicy.CHECKSUM
|
|
||||||
)
|
|
||||||
|
|
||||||
assert(modifications.size == buildLogSteps.size) {
|
|
||||||
"Modifications count (${modifications.size}) != expected build log steps count (${buildLogSteps.size})"
|
|
||||||
}
|
|
||||||
|
|
||||||
println("<--- Expected build log size: ${buildLogSteps.size}")
|
|
||||||
buildLogSteps.forEach {
|
|
||||||
println("<--- Expected build log stage: ${if (it.compileSucceeded) "succeeded" else "failed"}: kotlin: ${it.compiledKotlinFiles} java: ${it.compiledJavaFiles}")
|
|
||||||
}
|
|
||||||
|
|
||||||
for ((modificationStep, buildLogStep) in modifications.zip(buildLogSteps)) {
|
|
||||||
modificationStep.forEach { it.perform(projectDir, mapWorkingToOriginalFile) }
|
|
||||||
buildAndAssertStageResults(buildLogStep, weakTesting = weakTesting)
|
|
||||||
}
|
|
||||||
|
|
||||||
rebuildAndCompareOutput(rebuildSucceedExpected = buildLogSteps.last().compileSucceeded)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun JpsTestProject.buildAndAssertStageResults(
|
|
||||||
expected: BuildStep,
|
|
||||||
options: BuildOptions = defaultBuildOptions(),
|
|
||||||
weakTesting: Boolean = false
|
|
||||||
) {
|
|
||||||
build("build", options = options) {
|
|
||||||
if (expected.compileSucceeded) {
|
|
||||||
assertSuccessful()
|
|
||||||
assertCompiledJavaSources(expected.compiledJavaFiles, weakTesting)
|
|
||||||
assertCompiledKotlinSources(expected.compiledKotlinFiles, weakTesting)
|
|
||||||
} else {
|
|
||||||
assertFailed()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun JpsTestProject.rebuildAndCompareOutput(rebuildSucceedExpected: Boolean) {
|
|
||||||
val outDir = File(File(projectDir, "build"), "classes")
|
|
||||||
val incrementalOutDir = File(workingDir, "kotlin-classes-incremental")
|
|
||||||
incrementalOutDir.mkdirs()
|
|
||||||
copyDirRecursively(outDir, incrementalOutDir)
|
|
||||||
|
|
||||||
build("clean", "build") {
|
|
||||||
val rebuildSucceed = resultCode == 0
|
|
||||||
assertEquals(rebuildSucceed, rebuildSucceedExpected, "Rebuild exit code differs from incremental exit code")
|
|
||||||
outDir.mkdirs()
|
|
||||||
assertEqualDirectories(outDir, incrementalOutDir, forgiveExtraFiles = !rebuildSucceed)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-46
@@ -1,46 +0,0 @@
|
|||||||
package org.jetbrains.kotlin.jps
|
|
||||||
|
|
||||||
import org.jetbrains.kotlin.incremental.testingUtils.BuildLogFinder
|
|
||||||
import org.junit.Test
|
|
||||||
import org.junit.runner.RunWith
|
|
||||||
import org.junit.runners.Parameterized
|
|
||||||
import java.io.File
|
|
||||||
|
|
||||||
@RunWith(Parameterized::class)
|
|
||||||
class KotlinGradlePluginJpsParametrizedIT : BaseIncrementalGradleIT() {
|
|
||||||
|
|
||||||
@Parameterized.Parameter
|
|
||||||
@JvmField
|
|
||||||
var relativePath: String = ""
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun testFromJps() {
|
|
||||||
JpsTestProject(buildLogFinder, jpsResourcesPath, relativePath).performAndAssertBuildStages(weakTesting = true)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun defaultBuildOptions() =
|
|
||||||
super.defaultBuildOptions().copy(incremental = true)
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
|
|
||||||
private val jpsResourcesPath = File("../../../jps-plugin/testData/incremental")
|
|
||||||
private val ignoredDirs = setOf(
|
|
||||||
File(jpsResourcesPath, "cacheVersionChanged"),
|
|
||||||
File(jpsResourcesPath, "changeIncrementalOption"),
|
|
||||||
File(jpsResourcesPath, "custom"),
|
|
||||||
File(jpsResourcesPath, "lookupTracker")
|
|
||||||
)
|
|
||||||
private val buildLogFinder = BuildLogFinder(isGradleEnabled = true)
|
|
||||||
|
|
||||||
@Suppress("unused")
|
|
||||||
@Parameterized.Parameters(name = "{0}")
|
|
||||||
@JvmStatic
|
|
||||||
fun data(): List<Array<String>> =
|
|
||||||
jpsResourcesPath.walk()
|
|
||||||
.onEnter { it !in ignoredDirs }
|
|
||||||
.filter { it.isDirectory && buildLogFinder.findBuildLog(it) != null }
|
|
||||||
.map { arrayOf(it.toRelativeString(jpsResourcesPath)) }
|
|
||||||
.toList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-31
@@ -1,31 +0,0 @@
|
|||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: "kotlin"
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
main {
|
|
||||||
kotlin {
|
|
||||||
srcDir 'src'
|
|
||||||
}
|
|
||||||
java {
|
|
||||||
srcDir 'src'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
||||||
}
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
org.gradle.jvmargs=-Xmx1024m -XX:MaxPermSize=512m
|
|
||||||
Reference in New Issue
Block a user