Distribute SimpleKotlinGradleIT test to other tags

^KT-45745 In Progress
This commit is contained in:
Yahor Berdnikau
2022-03-15 15:19:18 +01:00
parent c051edcbee
commit b5a5f25b99
10 changed files with 32 additions and 10 deletions
@@ -27,7 +27,7 @@ import kotlin.io.path.writeText
@ExperimentalPathApi @ExperimentalPathApi
@DisplayName("Local build cache") @DisplayName("Local build cache")
@SimpleGradlePluginTests @JvmGradlePluginTests
class BuildCacheIT : KGPBaseTest() { class BuildCacheIT : KGPBaseTest() {
override val defaultBuildOptions: BuildOptions = override val defaultBuildOptions: BuildOptions =
@@ -25,13 +25,13 @@ import org.junit.jupiter.api.DisplayName
import kotlin.io.path.createDirectory import kotlin.io.path.createDirectory
@DisplayName("Build cache relocation") @DisplayName("Build cache relocation")
@SimpleGradlePluginTests
class BuildCacheRelocationIT : KGPBaseTest() { class BuildCacheRelocationIT : KGPBaseTest() {
override val defaultBuildOptions = super.defaultBuildOptions.copy(buildCacheEnabled = true) override val defaultBuildOptions = super.defaultBuildOptions.copy(buildCacheEnabled = true)
private val localBuildCacheDir get() = workingDir.resolve("remote-jdk-build-cache") private val localBuildCacheDir get() = workingDir.resolve("remote-jdk-build-cache")
@JvmGradlePluginTests
@DisplayName("works for Kotlin simple project") @DisplayName("works for Kotlin simple project")
@GradleTest @GradleTest
fun testRelocationSimpleProject(gradleVersion: GradleVersion) { fun testRelocationSimpleProject(gradleVersion: GradleVersion) {
@@ -45,6 +45,7 @@ class BuildCacheRelocationIT : KGPBaseTest() {
) )
} }
@OtherGradlePluginTests
@DisplayName("works for Kotlin with Kapt simple project") @DisplayName("works for Kotlin with Kapt simple project")
@GradleTest @GradleTest
fun testRelocationSimpleKapt(gradleVersion: GradleVersion) { fun testRelocationSimpleKapt(gradleVersion: GradleVersion) {
@@ -68,6 +69,7 @@ class BuildCacheRelocationIT : KGPBaseTest() {
) )
} }
@JsGradlePluginTests
@DisplayName("works with JS/DCE project") @DisplayName("works with JS/DCE project")
@GradleTest @GradleTest
fun testRelocationKotlin2JsDce(gradleVersion: GradleVersion) { fun testRelocationKotlin2JsDce(gradleVersion: GradleVersion) {
@@ -94,6 +96,7 @@ class BuildCacheRelocationIT : KGPBaseTest() {
) )
} }
@MppGradlePluginTests
@DisplayName("works with Multiplatform") @DisplayName("works with Multiplatform")
@GradleTest @GradleTest
fun testRelocationMultiplatform(gradleVersion: GradleVersion) { fun testRelocationMultiplatform(gradleVersion: GradleVersion) {
@@ -119,6 +122,7 @@ class BuildCacheRelocationIT : KGPBaseTest() {
) )
} }
@JvmGradlePluginTests
@DisplayName("works with Android project") @DisplayName("works with Android project")
@GradleTestVersions(minVersion = TestVersions.Gradle.G_6_7) @GradleTestVersions(minVersion = TestVersions.Gradle.G_6_7)
@GradleTest @GradleTest
@@ -143,6 +147,7 @@ class BuildCacheRelocationIT : KGPBaseTest() {
) )
} }
@JvmGradlePluginTests
@DisplayName("Test relocation for Android with dagger project") @DisplayName("Test relocation for Android with dagger project")
@GradleTestVersions(minVersion = TestVersions.Gradle.G_6_7) @GradleTestVersions(minVersion = TestVersions.Gradle.G_6_7)
@GradleTest @GradleTest
@@ -167,6 +172,7 @@ class BuildCacheRelocationIT : KGPBaseTest() {
) )
} }
@JvmGradlePluginTests
@DisplayName("KT-48617: Kapt ignores empty directories from Android variant") @DisplayName("KT-48617: Kapt ignores empty directories from Android variant")
@GradleTestVersions(minVersion = TestVersions.Gradle.G_6_8) @GradleTestVersions(minVersion = TestVersions.Gradle.G_6_8)
@GradleTest @GradleTest
@@ -194,6 +200,7 @@ class BuildCacheRelocationIT : KGPBaseTest() {
) )
} }
@JvmGradlePluginTests
@DisplayName("KT-48849: Kotlin compile should ignore empty layout resource directories added by kotlin android extensions") @DisplayName("KT-48849: Kotlin compile should ignore empty layout resource directories added by kotlin android extensions")
@GradleTestVersions(minVersion = TestVersions.Gradle.G_6_8) @GradleTestVersions(minVersion = TestVersions.Gradle.G_6_8)
@GradleTest @GradleTest
@@ -227,6 +234,7 @@ class BuildCacheRelocationIT : KGPBaseTest() {
) )
} }
@OtherGradlePluginTests // TODO: change to native tag
@DisplayName("with native project") @DisplayName("with native project")
@GradleTest @GradleTest
fun testRelocationNative(gradleVersion: GradleVersion) { fun testRelocationNative(gradleVersion: GradleVersion) {
@@ -262,6 +270,7 @@ class BuildCacheRelocationIT : KGPBaseTest() {
) )
} }
@OtherGradlePluginTests
@DisplayName("Kapt incremental compilation works with cache") @DisplayName("Kapt incremental compilation works with cache")
@GradleTest @GradleTest
fun testKaptCachingIncrementalBuildWithoutRelocation(gradleVersion: GradleVersion) { fun testKaptCachingIncrementalBuildWithoutRelocation(gradleVersion: GradleVersion) {
@@ -272,6 +281,7 @@ class BuildCacheRelocationIT : KGPBaseTest() {
} }
} }
@OtherGradlePluginTests
@DisplayName("Kapt incremental compilation build does not break relocated build cache") @DisplayName("Kapt incremental compilation build does not break relocated build cache")
@GradleTest @GradleTest
fun testKaptCachingIncrementalBuildWithRelocation(gradleVersion: GradleVersion) { fun testKaptCachingIncrementalBuildWithRelocation(gradleVersion: GradleVersion) {
@@ -320,6 +330,7 @@ class BuildCacheRelocationIT : KGPBaseTest() {
} }
} }
@JvmGradlePluginTests
@DisplayName("Kotlin incremental compilation should work correctly") @DisplayName("Kotlin incremental compilation should work correctly")
@GradleTest @GradleTest
fun testKotlinIncrementalCompilation(gradleVersion: GradleVersion) { fun testKotlinIncrementalCompilation(gradleVersion: GradleVersion) {
@@ -328,6 +339,7 @@ class BuildCacheRelocationIT : KGPBaseTest() {
} }
} }
@JvmGradlePluginTests
@DisplayName("Kotlin incremental compilation with `kotlin.incremental.useClasspathSnapshot` feature should work correctly") @DisplayName("Kotlin incremental compilation with `kotlin.incremental.useClasspathSnapshot` feature should work correctly")
@GradleTest @GradleTest
fun testKotlinIncrementalCompilation_withGradleClasspathSnapshot(gradleVersion: GradleVersion) { fun testKotlinIncrementalCompilation_withGradleClasspathSnapshot(gradleVersion: GradleVersion) {
@@ -12,7 +12,7 @@ import org.jetbrains.kotlin.gradle.testbase.*
import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.DisplayName
@DisplayName("Build statistics") @DisplayName("Build statistics")
@SimpleGradlePluginTests @JvmGradlePluginTests
class BuildStatisticsIT : KGPBaseTest() { class BuildStatisticsIT : KGPBaseTest() {
@DisplayName("Http build report url problems are logged only ones") @DisplayName("Http build report url problems are logged only ones")
@@ -12,6 +12,7 @@ import org.junit.jupiter.api.DisplayName
@DisplayName("Configuration cache in Android project") @DisplayName("Configuration cache in Android project")
@GradleTestVersions(minVersion = TestVersions.Gradle.G_6_7) @GradleTestVersions(minVersion = TestVersions.Gradle.G_6_7)
@JvmGradlePluginTests
class ConfigurationCacheForAndroidIT : AbstractConfigurationCacheIT() { class ConfigurationCacheForAndroidIT : AbstractConfigurationCacheIT() {
override val defaultBuildOptions = super.defaultBuildOptions.copy( override val defaultBuildOptions = super.defaultBuildOptions.copy(
androidVersion = AGP_42 androidVersion = AGP_42
@@ -16,12 +16,14 @@ class ConfigurationCacheIT : AbstractConfigurationCacheIT() {
@DisplayName("works in simple Kotlin project") @DisplayName("works in simple Kotlin project")
@GradleTest @GradleTest
@JvmGradlePluginTests
fun testSimpleKotlinJvmProject(gradleVersion: GradleVersion) { fun testSimpleKotlinJvmProject(gradleVersion: GradleVersion) {
project("kotlinProject", gradleVersion) { project("kotlinProject", gradleVersion) {
testConfigurationCacheOf(":compileKotlin") testConfigurationCacheOf(":compileKotlin")
} }
} }
@JvmGradlePluginTests
@DisplayName("works with publishing") @DisplayName("works with publishing")
@GradleTest @GradleTest
fun testJvmWithMavenPublish(gradleVersion: GradleVersion) { fun testJvmWithMavenPublish(gradleVersion: GradleVersion) {
@@ -56,6 +58,7 @@ class ConfigurationCacheIT : AbstractConfigurationCacheIT() {
} }
} }
@MppGradlePluginTests
@DisplayName("works with MPP publishing") @DisplayName("works with MPP publishing")
@GradleTest @GradleTest
@OptIn(ExperimentalStdlibApi::class) @OptIn(ExperimentalStdlibApi::class)
@@ -71,6 +74,7 @@ class ConfigurationCacheIT : AbstractConfigurationCacheIT() {
} }
} }
@OtherGradlePluginTests
@DisplayName("with project using incremental kapt") @DisplayName("with project using incremental kapt")
@GradleTest @GradleTest
fun testIncrementalKaptProject(gradleVersion: GradleVersion) { fun testIncrementalKaptProject(gradleVersion: GradleVersion) {
@@ -94,6 +98,7 @@ class ConfigurationCacheIT : AbstractConfigurationCacheIT() {
} }
// Set min Gradle version to 6.8 because of using DependencyResolutionManagement API to add repositories. // Set min Gradle version to 6.8 because of using DependencyResolutionManagement API to add repositories.
@JvmGradlePluginTests
@DisplayName("with instance execution") @DisplayName("with instance execution")
@GradleTestVersions(minVersion = TestVersions.Gradle.G_6_8) @GradleTestVersions(minVersion = TestVersions.Gradle.G_6_8)
@GradleTest @GradleTest
@@ -106,6 +111,7 @@ class ConfigurationCacheIT : AbstractConfigurationCacheIT() {
} }
} }
@JvmGradlePluginTests
@DisplayName("KT-43605: instant execution with buildSrc") @DisplayName("KT-43605: instant execution with buildSrc")
@GradleTest @GradleTest
fun testInstantExecutionWithBuildSrc(gradleVersion: GradleVersion) { fun testInstantExecutionWithBuildSrc(gradleVersion: GradleVersion) {
@@ -117,6 +123,7 @@ class ConfigurationCacheIT : AbstractConfigurationCacheIT() {
} }
} }
@JvmGradlePluginTests
@DisplayName("instant execution works with included build plugin") @DisplayName("instant execution works with included build plugin")
@GradleTestVersions(minVersion = TestVersions.Gradle.G_6_8) @GradleTestVersions(minVersion = TestVersions.Gradle.G_6_8)
@GradleTest @GradleTest
@@ -129,12 +136,14 @@ class ConfigurationCacheIT : AbstractConfigurationCacheIT() {
} }
} }
@JsGradlePluginTests
@DisplayName("works with Dukat") @DisplayName("works with Dukat")
@GradleTest @GradleTest
fun testConfigurationCacheDukatSrc(gradleVersion: GradleVersion) { fun testConfigurationCacheDukatSrc(gradleVersion: GradleVersion) {
testConfigurationCacheDukat(gradleVersion) testConfigurationCacheDukat(gradleVersion)
} }
@JsGradlePluginTests
@DisplayName("works with Dukat binaries") @DisplayName("works with Dukat binaries")
@GradleTest @GradleTest
fun testConfigurationCacheDukatBinaries(gradleVersion: GradleVersion) { fun testConfigurationCacheDukatBinaries(gradleVersion: GradleVersion) {
@@ -160,6 +169,7 @@ class ConfigurationCacheIT : AbstractConfigurationCacheIT() {
) )
} }
@MppGradlePluginTests
@DisplayName("works in MPP withJava project") @DisplayName("works in MPP withJava project")
@GradleTestVersions(minVersion = TestVersions.Gradle.G_7_0, maxVersion = TestVersions.Gradle.G_7_1) @GradleTestVersions(minVersion = TestVersions.Gradle.G_7_0, maxVersion = TestVersions.Gradle.G_7_1)
@GradleTest @GradleTest
@@ -173,6 +183,7 @@ class ConfigurationCacheIT : AbstractConfigurationCacheIT() {
} }
} }
@JvmGradlePluginTests
@DisplayName("with build report") @DisplayName("with build report")
@GradleTest @GradleTest
fun testBuildReportSmokeTestForConfigurationCache(gradleVersion: GradleVersion) { fun testBuildReportSmokeTestForConfigurationCache(gradleVersion: GradleVersion) {
@@ -189,7 +200,6 @@ class ConfigurationCacheIT : AbstractConfigurationCacheIT() {
} }
} }
@SimpleGradlePluginTests
abstract class AbstractConfigurationCacheIT : KGPBaseTest() { abstract class AbstractConfigurationCacheIT : KGPBaseTest() {
override val defaultBuildOptions = override val defaultBuildOptions =
super.defaultBuildOptions.copy(configurationCache = true) super.defaultBuildOptions.copy(configurationCache = true)
@@ -10,15 +10,13 @@ import org.jetbrains.kotlin.gradle.testbase.*
import org.jetbrains.kotlin.gradle.util.allJavaFiles import org.jetbrains.kotlin.gradle.util.allJavaFiles
import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.DisplayName
import java.io.File import java.io.File
import kotlin.io.path.ExperimentalPathApi
import kotlin.io.path.writeText import kotlin.io.path.writeText
import kotlin.test.assertEquals import kotlin.test.assertEquals
@DisplayName("Tests that the outputs of a build are deterministic") @DisplayName("Tests that the outputs of a build are deterministic")
@SimpleGradlePluginTests
@OptIn(ExperimentalPathApi::class)
class DeterministicBuildIT : KGPBaseTest() { class DeterministicBuildIT : KGPBaseTest() {
@OtherGradlePluginTests
@DisplayName("Kapt generate stubs task - KT-40882") @DisplayName("Kapt generate stubs task - KT-40882")
@GradleTest @GradleTest
fun testKaptGenerateStubsTask(gradleVersion: GradleVersion) { fun testKaptGenerateStubsTask(gradleVersion: GradleVersion) {
@@ -7,7 +7,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompilerExecutionStrategy
import org.jetbrains.kotlin.gradle.testbase.* import org.jetbrains.kotlin.gradle.testbase.*
import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.DisplayName
@SimpleGradlePluginTests @JvmGradlePluginTests
@DisplayName("KGP simple tests") @DisplayName("KGP simple tests")
class SimpleKotlinGradleIT : KGPBaseTest() { class SimpleKotlinGradleIT : KGPBaseTest() {
@@ -9,7 +9,7 @@ import kotlin.test.assertNull
import kotlin.test.assertTrue import kotlin.test.assertTrue
@DisplayName("Source file modifications") @DisplayName("Source file modifications")
@SimpleGradlePluginTests @JvmGradlePluginTests
class SourceFileIsModifiedIT : KGPBaseTest() { class SourceFileIsModifiedIT : KGPBaseTest() {
@DisplayName("Removed in non-incremental compilation") @DisplayName("Removed in non-incremental compilation")
@@ -13,7 +13,7 @@ import org.junit.Test
import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.DisplayName
@SimpleGradlePluginTests @JsGradlePluginTests
class CleanDataTaskIT : KGPBaseTest() { class CleanDataTaskIT : KGPBaseTest() {
@DisplayName("nodejs is deleted from Gradle user home") @DisplayName("nodejs is deleted from Gradle user home")
@@ -13,6 +13,7 @@ import org.junit.jupiter.api.Tag
@Target(AnnotationTarget.CLASS, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.FUNCTION) @Target(AnnotationTarget.CLASS, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
@Tag("SimpleKGP") @Tag("SimpleKGP")
@Deprecated("will be removed soon", level = DeprecationLevel.ERROR)
annotation class SimpleGradlePluginTests annotation class SimpleGradlePluginTests
/** /**