[K/N][tests] Rework tags for K/N tests

Use plain combinations of tags, examples:
* codegen/box w/o FIR: 'codegen & !frontend-fir'
* codegen/box with FIR: 'codegen & frontend-fir'

Avoid using tags with multiple aspects in their names, examples:
* 'codegenK1'
* 'firCodegen'

The obsolete tags to be removed but still used in TeamCity configurations:
* 'stdlibK2'
* 'kotlin-testK2'
* 'codegenK2'
* 'k2libContents'
* 'firInfrastructure'
This commit is contained in:
Dmitriy Dolovov
2023-05-01 23:34:18 +02:00
committed by Space Team
parent f2b6cbeee8
commit 0de06757ca
16 changed files with 2483 additions and 4887 deletions
+8 -8
View File
@@ -46,18 +46,18 @@ if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
// Tasks that run different sorts of tests. Most frequent use case: running specific tests at TeamCity.
val infrastructureTest = nativeTest("infrastructureTest", "infrastructure")
val codegenBoxTest = nativeTest("codegenBoxTest", "codegen")
val codegenK2BoxTest = nativeTest("codegenK2BoxTest", "codegenK2")
val stdlibTest = nativeTest("stdlibTest", "stdlib")
val stdlibK2Test = nativeTest("stdlibK2Test", "stdlibK2")
val kotlinTestLibraryTest = nativeTest("kotlinTestLibraryTest", "kotlin-test")
val kotlinTestK2LibraryTest = nativeTest("kotlinTestK2LibraryTest", "kotlin-testK2")
val codegenBoxTest = nativeTest("codegenBoxTest", "codegen & !frontend-fir")
val codegenBoxK2Test = nativeTest("codegenBoxK2Test", "codegen & frontend-fir")
val stdlibTest = nativeTest("stdlibTest", "stdlib & !frontend-fir")
val stdlibK2Test = nativeTest("stdlibK2Test", "stdlib & frontend-fir")
val kotlinTestLibraryTest = nativeTest("kotlinTestLibraryTest", "kotlin-test & !frontend-fir")
val kotlinTestLibraryK2Test = nativeTest("kotlinTestLibraryK2Test", "kotlin-test & frontend-fir")
val partialLinkageTest = nativeTest("partialLinkageTest", "partial-linkage")
val cinteropTest = nativeTest("cinteropTest", "cinterop")
val debuggerTest = nativeTest("debuggerTest", "debugger")
val cachesTest = nativeTest("cachesTest", "caches")
val k1libContentsTest = nativeTest("k1libContentsTest", "k1libContents")
val k2libContentsTest = nativeTest("k2libContentsTest", "k2libContents")
val klibContentsTest = nativeTest("klibContentsTest", "klib-contents & !frontend-fir")
val klibContentsK2Test = nativeTest("klibContentsK2Test", "klib-contents & frontend-fir")
val testTags = findProperty("kotlin.native.tests.tags")?.toString()
// Note: arbitrary JUnit tag expressions can be used in this property.
@@ -8,8 +8,8 @@ package org.jetbrains.kotlin.konan.blackboxtest;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.junit.jupiter.api.Tag;
import org.jetbrains.kotlin.konan.blackboxtest.support.group.UseStandardTestCaseGroupProvider;
import org.jetbrains.kotlin.konan.blackboxtest.support.group.FirPipeline;
import org.jetbrains.kotlin.konan.blackboxtest.support.group.UseStandardTestCaseGroupProvider;
import org.jetbrains.kotlin.test.TestMetadata;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
@@ -25,8 +25,9 @@ public class FirInfrastructureTestGenerated extends AbstractNativeBlackBoxTest {
@TestDataPath("$PROJECT_ROOT")
@Tag("infrastructure")
@Tag("firInfrastructure")
@UseStandardTestCaseGroupProvider()
@Tag("frontend-fir")
@FirPipeline()
@UseStandardTestCaseGroupProvider()
public class Samples {
@Test
public void testAllFilesPresentInSamples() throws Exception {
@@ -248,8 +249,9 @@ public class FirInfrastructureTestGenerated extends AbstractNativeBlackBoxTest {
@TestDataPath("$PROJECT_ROOT")
@Tag("infrastructure")
@Tag("firInfrastructure")
@UseStandardTestCaseGroupProvider()
@Tag("frontend-fir")
@FirPipeline()
@UseStandardTestCaseGroupProvider()
public class Inner {
@Test
public void testAllFilesPresentInInner() throws Exception {
@@ -269,8 +271,9 @@ public class FirInfrastructureTestGenerated extends AbstractNativeBlackBoxTest {
@TestDataPath("$PROJECT_ROOT")
@Tag("infrastructure")
@Tag("firInfrastructure")
@UseStandardTestCaseGroupProvider()
@Tag("frontend-fir")
@FirPipeline()
@UseStandardTestCaseGroupProvider()
public class Samples2 {
@Test
public void testAllFilesPresentInSamples2() throws Exception {
@@ -21,7 +21,7 @@ import java.util.regex.Pattern;
@TestMetadata("native/native.tests/testData/klibContents")
@TestDataPath("$PROJECT_ROOT")
@Tag("k2libContents")
@Tag("firKlibContents")
@Tag("frontend-fir")
@FirPipeline()
public class FirNativeKLibContentsTestGenerated extends AbstractNativeKlibContentsTest {
@Test
@@ -69,7 +69,7 @@ public class FirNativeKLibContentsTestGenerated extends AbstractNativeKlibConten
@TestMetadata("native/native.tests/testData/klibContents/builtinsSerializer")
@TestDataPath("$PROJECT_ROOT")
@Tag("k2libContents")
@Tag("firKlibContents")
@Tag("frontend-fir")
@FirPipeline()
public class BuiltinsSerializer {
@Test
@@ -141,7 +141,7 @@ public class FirNativeKLibContentsTestGenerated extends AbstractNativeKlibConten
@TestMetadata("native/native.tests/testData/klibContents/builtinsSerializer/annotationArguments")
@TestDataPath("$PROJECT_ROOT")
@Tag("k2libContents")
@Tag("firKlibContents")
@Tag("frontend-fir")
@FirPipeline()
public class AnnotationArguments {
@Test
@@ -191,7 +191,7 @@ public class FirNativeKLibContentsTestGenerated extends AbstractNativeKlibConten
@TestMetadata("native/native.tests/testData/klibContents/klib")
@TestDataPath("$PROJECT_ROOT")
@Tag("k2libContents")
@Tag("firKlibContents")
@Tag("frontend-fir")
@FirPipeline()
public class Klib {
@Test
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.konan.blackboxtest;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.junit.jupiter.api.Tag;
import org.jetbrains.kotlin.konan.blackboxtest.support.group.FirPipeline;
import org.jetbrains.kotlin.test.TestMetadata;
import org.junit.jupiter.api.Nested;
@@ -19,6 +20,7 @@ import java.util.regex.Pattern;
@SuppressWarnings("all")
@TestMetadata("compiler/testData/binaryCompatibility/klibEvolution")
@TestDataPath("$PROJECT_ROOT")
@Tag("frontend-fir")
@FirPipeline()
public class FirNativeKlibEvolutionTestGenerated extends AbstractNativeKlibEvolutionTest {
@Test
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.konan.blackboxtest;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.junit.jupiter.api.Tag;
import org.jetbrains.kotlin.konan.blackboxtest.support.group.FirPipeline;
import org.jetbrains.kotlin.test.TestMetadata;
import org.junit.jupiter.api.Nested;
@@ -19,6 +20,7 @@ import java.util.regex.Pattern;
@SuppressWarnings("all")
@TestMetadata("compiler/testData/klibABI")
@TestDataPath("$PROJECT_ROOT")
@Tag("frontend-fir")
@FirPipeline()
public class FirNativePartialLinkageTestGenerated extends AbstractNativePartialLinkageTest {
@Test
@@ -23,7 +23,6 @@ public class InfrastructureTestGenerated extends AbstractNativeBlackBoxTest {
@TestMetadata("native/native.tests/testData/samples")
@TestDataPath("$PROJECT_ROOT")
@Tag("infrastructure")
@Tag("k1Infrastructure")
@UseStandardTestCaseGroupProvider()
public class Samples {
@Test
@@ -245,7 +244,6 @@ public class InfrastructureTestGenerated extends AbstractNativeBlackBoxTest {
@TestMetadata("native/native.tests/testData/samples/inner")
@TestDataPath("$PROJECT_ROOT")
@Tag("infrastructure")
@Tag("k1Infrastructure")
@UseStandardTestCaseGroupProvider()
public class Inner {
@Test
@@ -265,7 +263,6 @@ public class InfrastructureTestGenerated extends AbstractNativeBlackBoxTest {
@TestMetadata("native/native.tests/testData/samples2")
@TestDataPath("$PROJECT_ROOT")
@Tag("infrastructure")
@Tag("k1Infrastructure")
@UseStandardTestCaseGroupProvider()
public class Samples2 {
@Test
@@ -7,7 +7,6 @@ package org.jetbrains.kotlin.konan.blackboxtest;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.junit.jupiter.api.Tag;
import org.jetbrains.kotlin.test.TestMetadata;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
@@ -19,7 +18,6 @@ import java.util.regex.Pattern;
@SuppressWarnings("all")
@TestMetadata("native/native.tests/testData/klibContents")
@TestDataPath("$PROJECT_ROOT")
@Tag("k1libContents")
public class NativeKLibContentsTestGenerated extends AbstractNativeKlibContentsTest {
@Test
public void testAllFilesPresentInKlibContents() throws Exception {
@@ -65,7 +63,6 @@ public class NativeKLibContentsTestGenerated extends AbstractNativeKlibContentsT
@Nested
@TestMetadata("native/native.tests/testData/klibContents/builtinsSerializer")
@TestDataPath("$PROJECT_ROOT")
@Tag("k1libContents")
public class BuiltinsSerializer {
@Test
public void testAllFilesPresentInBuiltinsSerializer() throws Exception {
@@ -135,7 +132,6 @@ public class NativeKLibContentsTestGenerated extends AbstractNativeKlibContentsT
@Nested
@TestMetadata("native/native.tests/testData/klibContents/builtinsSerializer/annotationArguments")
@TestDataPath("$PROJECT_ROOT")
@Tag("k1libContents")
public class AnnotationArguments {
@Test
public void testAllFilesPresentInAnnotationArguments() throws Exception {
@@ -183,7 +179,6 @@ public class NativeKLibContentsTestGenerated extends AbstractNativeKlibContentsT
@Nested
@TestMetadata("native/native.tests/testData/klibContents/klib")
@TestDataPath("$PROJECT_ROOT")
@Tag("k1libContents")
public class Klib {
@Test
public void testAllFilesPresentInKlib() throws Exception {
@@ -29,8 +29,6 @@ fun main() {
testClass<AbstractNativeCodegenBoxTest>(
suiteTestClassName = "NativeCodegenBoxTestGenerated",
annotations = listOf(
codegen(),
k1Codegen(),
provider<UseExtTestCaseGroupProvider>(),
disabledInOneStageMode(
"codegen/box/coroutines/featureIntersection/defaultExpect.kt",
@@ -45,8 +43,6 @@ fun main() {
testClass<AbstractNativeCodegenBoxTest>(
suiteTestClassName = "NativeCodegenBoxTestNoPLGenerated",
annotations = listOf(
codegen(),
k1Codegen(),
provider<UseExtTestCaseGroupProvider>(),
*noPartialLinkage()
)
@@ -57,10 +53,9 @@ fun main() {
testClass<AbstractNativeCodegenBoxTest>(
suiteTestClassName = "FirNativeCodegenBoxTestGenerated",
annotations = listOf(
codegenK2(),
firCodegen(),
provider<UseExtTestCaseGroupProvider>(),
provider<FirPipeline>()
deprecated_codegenK2(),
*frontendFir(),
provider<UseExtTestCaseGroupProvider>()
)
) {
model("codegen/box", targetBackend = TargetBackend.NATIVE)
@@ -69,10 +64,9 @@ fun main() {
testClass<AbstractNativeCodegenBoxTest>(
suiteTestClassName = "FirNativeCodegenBoxTestNoPLGenerated",
annotations = listOf(
codegenK2(),
firCodegen(),
deprecated_codegenK2(),
*frontendFir(),
provider<UseExtTestCaseGroupProvider>(),
provider<FirPipeline>(),
*noPartialLinkage()
)
) {
@@ -85,7 +79,10 @@ fun main() {
testGroup("native/native.tests/tests-gen", "native/native.tests/testData") {
testClass<AbstractNativeBlackBoxTest>(
suiteTestClassName = "InfrastructureTestGenerated",
annotations = listOf(infrastructure(), k1Infrastructure(), provider<UseStandardTestCaseGroupProvider>())
annotations = listOf(
infrastructure(),
provider<UseStandardTestCaseGroupProvider>()
)
) {
model("samples")
model("samples2")
@@ -95,7 +92,12 @@ fun main() {
testGroup("native/native.tests/tests-gen", "native/native.tests/testData") {
testClass<AbstractNativeBlackBoxTest>(
suiteTestClassName = "FirInfrastructureTestGenerated",
annotations = listOf(infrastructure(), firInfrastructure(), provider<UseStandardTestCaseGroupProvider>(), provider<FirPipeline>())
annotations = listOf(
infrastructure(),
deprecated_firInfrastructure(),
*frontendFir(),
provider<UseStandardTestCaseGroupProvider>()
)
) {
model("samples")
model("samples2")
@@ -111,7 +113,9 @@ fun main() {
}
testClass<AbstractNativePartialLinkageTest>(
suiteTestClassName = "FirNativePartialLinkageTestGenerated",
annotations = listOf(provider<FirPipeline>())
annotations = listOf(
*frontendFir()
)
) {
model("klibABI/", pattern = "^([^_](.+))$", recursive = false)
}
@@ -126,7 +130,9 @@ fun main() {
}
testClass<AbstractNativeKlibEvolutionTest>(
suiteTestClassName = "FirNativeKlibEvolutionTestGenerated",
annotations = listOf(provider<FirPipeline>())
annotations = listOf(
*frontendFir()
)
) {
model("binaryCompatibility/klibEvolution", recursive = false)
}
@@ -165,8 +171,7 @@ fun main() {
// Klib contents tests
testGroup("native/native.tests/tests-gen", "native/native.tests/testData") {
testClass<AbstractNativeKlibContentsTest>(
suiteTestClassName = "NativeKLibContentsTestGenerated",
annotations = listOf(k1libContents())
suiteTestClassName = "NativeKLibContentsTestGenerated"
) {
model("klibContents", pattern = "^([^_](.+)).kt$", recursive = true)
}
@@ -174,7 +179,10 @@ fun main() {
testGroup("native/native.tests/tests-gen", "native/native.tests/testData") {
testClass<AbstractNativeKlibContentsTest>(
suiteTestClassName = "FirNativeKLibContentsTestGenerated",
annotations = listOf(k2libContents(), firKLibContents(), provider<FirPipeline>())
annotations = listOf(
deprecated_k2libContents(),
*frontendFir()
)
) {
model("klibContents", pattern = "^([^_](.+)).kt$", recursive = true)
}
@@ -226,15 +234,15 @@ private fun TestGroup.disabledInOneStageMode(vararg unexpandedPaths: String): An
)
}
// Marker tags. TODO: Reconsider and reduce amount of marker tags.
private fun codegen() = annotation(Tag::class.java, "codegen")
private fun k1Codegen() = annotation(Tag::class.java, "k1Codegen")
private fun codegenK2() = annotation(Tag::class.java, "codegenK2")
private fun firCodegen() = annotation(Tag::class.java, "firCodegen")
private fun frontendFir() = arrayOf(
annotation(Tag::class.java, "frontend-fir"),
annotation(FirPipeline::class.java)
)
private fun debugger() = annotation(Tag::class.java, "debugger")
private fun infrastructure() = annotation(Tag::class.java, "infrastructure")
private fun k1Infrastructure() = annotation(Tag::class.java, "k1Infrastructure")
private fun firInfrastructure() = annotation(Tag::class.java, "firInfrastructure")
private fun k1libContents() = annotation(Tag::class.java, "k1libContents")
private fun k2libContents() = annotation(Tag::class.java, "k2libContents")
private fun firKLibContents() = annotation(Tag::class.java, "firKlibContents")
// TODO: To be removed.
private fun deprecated_codegenK2() = annotation(Tag::class.java, "codegenK2")
private fun deprecated_k2libContents() = annotation(Tag::class.java, "k2libContents")
private fun deprecated_firInfrastructure() = annotation(Tag::class.java, "firInfrastructure")
@@ -13,6 +13,7 @@ import org.jetbrains.kotlin.konan.blackboxtest.support.util.ExternalSourceTransf
import org.jetbrains.kotlin.konan.blackboxtest.support.util.ExternalSourceTransformers
import org.jetbrains.kotlin.konan.blackboxtest.support.util.ThreadSafeCache
import org.jetbrains.kotlin.konan.blackboxtest.support.util.getAbsoluteFile
import org.junit.jupiter.api.Tag
import java.io.File
// Disable codegen/box/properties/lateinit/isInitializedAndDeinitialize tests with ONE_STAGE_MULTI_MODULE
@@ -22,6 +23,7 @@ import java.io.File
property = ClassLevelProperty.TEST_MODE,
propertyValue = "ONE_STAGE_MULTI_MODULE"
)
@Tag("codegen")
abstract class AbstractNativeCodegenBoxTest : ExternalSourceTransformersProvider, AbstractNativeBlackBoxTest() {
private val registeredSourceTransformers: ThreadSafeCache<File, MutableList<ExternalSourceTransformer>> = ThreadSafeCache()
@@ -15,7 +15,6 @@ import org.jetbrains.kotlin.konan.blackboxtest.support.group.UsePartialLinkage
import org.jetbrains.kotlin.konan.blackboxtest.support.runner.*
import org.jetbrains.kotlin.konan.blackboxtest.support.settings.*
import org.jetbrains.kotlin.konan.blackboxtest.support.util.*
import org.jetbrains.kotlin.test.services.JUnit5Assertions.assertEquals
import org.jetbrains.kotlin.test.services.JUnit5Assertions.assertEqualsToFile
import org.junit.jupiter.api.Tag
import java.io.File
@@ -15,7 +15,6 @@ import org.junit.jupiter.api.Tag
import org.junit.jupiter.api.TestFactory
@Tag("kotlin-test")
@Tag("k1Kotlin-test")
@PredefinedTestCases(
TC(
name = "default",
@@ -31,7 +30,7 @@ import org.junit.jupiter.api.TestFactory
)
)
@UsePartialLinkage(UsePartialLinkage.Mode.DISABLED)
class K1KotlinTestLibraryTest : AbstractNativeBlackBoxTest() {
class KotlinTestLibraryTest : AbstractNativeBlackBoxTest() {
@TestFactory
fun default() = dynamicTestCase(TestCaseId.Named("default"))
@@ -39,8 +38,9 @@ class K1KotlinTestLibraryTest : AbstractNativeBlackBoxTest() {
fun worker() = dynamicTestCase(TestCaseId.Named("worker"))
}
@Tag("kotlin-testK2")
@Tag("firKotlin-test")
@Tag("kotlin-test")
@Tag("kotlin-testK2") // TODO: To be removed.
@Tag("frontend-fir")
@PredefinedTestCases(
TC(
name = "default",
@@ -55,8 +55,9 @@ class StdlibTest : AbstractNativeBlackBoxTest() {
fun worker() = dynamicTestCase(TestCaseId.Named("worker"))
}
@Tag("stdlibK2")
@Tag("firStdlib")
@Tag("stdlib")
@Tag("stdlibK2") // TODO: To be removed.
@Tag("frontend-fir")
@PredefinedTestCases(
TC(
name = "default",