Skip to content

Commit 3eb782e

Browse files
ting-yuanhfmehmed
authored andcommitted
Remove KSP1 integration tests
1 parent 8f4997c commit 3eb782e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+86
-648
lines changed

gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/GradleCompilationTest.kt

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,16 @@ import org.junit.Assume
3232
import org.junit.Rule
3333
import org.junit.Test
3434
import org.junit.rules.TemporaryFolder
35-
import org.junit.runner.RunWith
36-
import org.junit.runners.Parameterized
3735

38-
@RunWith(Parameterized::class)
39-
class GradleCompilationTest(val useKSP2: Boolean) {
40-
41-
companion object {
42-
@JvmStatic
43-
@Parameterized.Parameters(name = "KSP2={0}")
44-
fun params() = listOf(arrayOf(true), arrayOf(false))
45-
}
36+
class GradleCompilationTest() {
4637

4738
@Rule
4839
@JvmField
4940
val tmpDir = TemporaryFolder()
5041

5142
@Rule
5243
@JvmField
53-
val testRule = KspIntegrationTestRule(tmpDir, useKSP2)
44+
val testRule = KspIntegrationTestRule(tmpDir)
5445

5546
@Test
5647
fun errorMessageFailsCompilation() {
@@ -420,27 +411,11 @@ class GradleCompilationTest(val useKSP2: Boolean) {
420411
assertThat(result.output).doesNotContain("app/build/generated/ksp/main/classes")
421412
}
422413

423-
@Test
424-
fun changingKsp2AtRuntime() {
425-
Assume.assumeFalse(useKSP2)
426-
testRule.setupAppAsJvmApp()
427-
testRule.appModule.buildFileAdditions.add(
428-
"""
429-
@OptIn(com.google.devtools.ksp.KspExperimental::class)
430-
ksp { useKsp2.set(true) }
431-
""".trimIndent()
432-
)
433-
434-
testRule.runner().withArguments().build()
435-
}
436-
437414
/**
438415
* Regression test for b/362279380
439416
*/
440417
@Test
441418
fun androidGradlePluginBuiltInKotlin() {
442-
// built in kotlin will only be supported with KSP2
443-
Assume.assumeTrue(useKSP2)
444419
testRule.setupAppAsAndroidApp(enableAgpBuiltInKotlinSupport = true)
445420
testRule.appModule.dependencies.addAll(
446421
listOf(

gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/ProcessorClasspathConfigurationsTest.kt

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,16 @@ import com.google.devtools.ksp.gradle.testing.KspIntegrationTestRule
2121
import org.junit.Rule
2222
import org.junit.Test
2323
import org.junit.rules.TemporaryFolder
24-
import org.junit.runner.RunWith
25-
import org.junit.runners.Parameterized
2624

27-
@RunWith(Parameterized::class)
28-
class ProcessorClasspathConfigurationsTest(val useKSP2: Boolean) {
29-
30-
companion object {
31-
@JvmStatic
32-
@Parameterized.Parameters(name = "KSP2={0}")
33-
fun params() = listOf(arrayOf(true), arrayOf(false))
34-
}
25+
class ProcessorClasspathConfigurationsTest() {
3526

3627
@Rule
3728
@JvmField
3829
val tmpDir = TemporaryFolder()
3930

4031
@Rule
4132
@JvmField
42-
val testRule = KspIntegrationTestRule(tmpDir, useKSP2)
33+
val testRule = KspIntegrationTestRule(tmpDir)
4334

4435
private val kspConfigs by lazy {
4536
"""configurations.matching { it.name.startsWith("ksp") && !it.name.endsWith("ProcessorClasspath") }"""

gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/SourceSetConfigurationsTest.kt

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,20 @@ import com.google.devtools.ksp.processing.SymbolProcessor
2828
import com.google.devtools.ksp.symbol.KSAnnotated
2929
import com.google.devtools.ksp.symbol.KSClassDeclaration
3030
import org.gradle.testkit.runner.TaskOutcome
31-
import org.junit.Assume
3231
import org.junit.Rule
3332
import org.junit.Test
3433
import org.junit.rules.TemporaryFolder
35-
import org.junit.runner.RunWith
36-
import org.junit.runners.Parameterized
3734
import java.io.File
3835

39-
@RunWith(Parameterized::class)
40-
class SourceSetConfigurationsTest(val useKSP2: Boolean) {
41-
42-
companion object {
43-
@JvmStatic
44-
@Parameterized.Parameters(name = "KSP2={0}")
45-
fun params() = listOf(arrayOf(true), arrayOf(false))
46-
}
36+
class SourceSetConfigurationsTest() {
4737

4838
@Rule
4939
@JvmField
5040
val tmpDir = TemporaryFolder()
5141

5242
@Rule
5343
@JvmField
54-
val testRule = KspIntegrationTestRule(tmpDir, useKSP2)
44+
val testRule = KspIntegrationTestRule(tmpDir)
5545

5646
@Test
5747
fun configurationsForJvmApp() {
@@ -167,7 +157,6 @@ class SourceSetConfigurationsTest(val useKSP2: Boolean) {
167157

168158
@Test
169159
fun registerGeneratedSourcesToAndroid() {
170-
Assume.assumeTrue(useKSP2)
171160
testRule.setupAppAsAndroidApp()
172161
testRule.appModule.dependencies.addAll(
173162
listOf(

gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/testing/KspIntegrationTestRule.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import kotlin.reflect.KClass
3030
*/
3131
class KspIntegrationTestRule(
3232
private val tmpFolder: TemporaryFolder,
33-
private val useKSP2: Boolean
3433
) : TestWatcher() {
3534
/**
3635
* Initialized when the test starts.
@@ -169,6 +168,6 @@ class KspIntegrationTestRule(
169168

170169
override fun starting(description: Description) {
171170
super.starting(description)
172-
testProject = TestProject(tmpFolder.newFolder(), testConfig, useKSP2)
171+
testProject = TestProject(tmpFolder.newFolder(), testConfig)
173172
}
174173
}

gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/testing/TestProject.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import java.io.File
2424
class TestProject(
2525
val rootDir: File,
2626
val testConfig: TestConfig,
27-
val useKSP2: Boolean,
2827
) {
2928
val processorModule = TestModule(
3029
rootDir.resolve("processor")
@@ -60,7 +59,6 @@ class TestProject(
6059
val contents = """
6160
6261
kotlin.jvm.target.validation.mode=warning
63-
ksp.useKSP2=$useKSP2
6462
""".trimIndent()
6563
rootDir.resolve("gradle.properties").appendText(contents)
6664
}

integration-tests/src/test/kotlin/com/google/devtools/ksp/test/AGP810IT.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import java.io.File
1010
class AGP810IT {
1111
@Rule
1212
@JvmField
13-
val project: TemporaryTestProject = TemporaryTestProject("playground-android-multi", "playground", true)
13+
val project: TemporaryTestProject = TemporaryTestProject("playground-android-multi", "playground")
1414

1515
@Test
1616
fun testRunsKSP() {

integration-tests/src/test/kotlin/com/google/devtools/ksp/test/AGP812IT.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import java.io.File
1010
class AGP812IT {
1111
@Rule
1212
@JvmField
13-
val project: TemporaryTestProject = TemporaryTestProject("playground-android-multi", "playground", true)
13+
val project: TemporaryTestProject = TemporaryTestProject("playground-android-multi", "playground")
1414

1515
@Test
1616
fun testRunsKSP() {

integration-tests/src/test/kotlin/com/google/devtools/ksp/test/AGP890IT.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import java.io.File
1010
class AGP890IT {
1111
@Rule
1212
@JvmField
13-
val project: TemporaryTestProject = TemporaryTestProject("playground-android-multi", "playground", true)
13+
val project: TemporaryTestProject = TemporaryTestProject("playground-android-multi", "playground")
1414

1515
@Test
1616
fun testRunsKSP() {

integration-tests/src/test/kotlin/com/google/devtools/ksp/test/AGP900IT.kt

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,12 @@ import org.gradle.testkit.runner.TaskOutcome
55
import org.junit.Assert
66
import org.junit.Rule
77
import org.junit.Test
8-
import org.junit.runner.RunWith
9-
import org.junit.runners.Parameterized
108
import java.io.File
119

12-
@RunWith(Parameterized::class)
13-
class AGP900IT(useKSP2: Boolean) {
10+
class AGP900IT() {
1411
@Rule
1512
@JvmField
16-
val project: TemporaryTestProject = TemporaryTestProject("playground-android-multi", "playground", useKSP2)
13+
val project: TemporaryTestProject = TemporaryTestProject("playground-android-multi", "playground")
1714

1815
@Test
1916
fun testRunsKSP() {
@@ -27,10 +24,4 @@ class AGP900IT(useKSP2: Boolean) {
2724
Assert.assertEquals(TaskOutcome.SUCCESS, result.task(":workload:kspDebugKotlin")?.outcome)
2825
}
2926
}
30-
31-
companion object {
32-
@JvmStatic
33-
@Parameterized.Parameters(name = "KSP2={0}")
34-
fun params() = listOf(arrayOf(true), arrayOf(false))
35-
}
3627
}

integration-tests/src/test/kotlin/com/google/devtools/ksp/test/AndroidBuiltInKotlinIT.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import java.io.File
1010
class AndroidBuiltInKotlinIT {
1111
@Rule
1212
@JvmField
13-
val project: TemporaryTestProject = TemporaryTestProject("playground-android-builtinkotlin", "playground", true)
13+
val project: TemporaryTestProject = TemporaryTestProject("playground-android-builtinkotlin", "playground")
1414

1515
@Test
1616
fun testPlaygroundAndroidWithBuiltInKotlin() {

0 commit comments

Comments
 (0)