From cc838f614f581565a2de645e72a24be34182fe6c Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Thu, 8 Feb 2024 14:53:43 +0200 Subject: [PATCH] Remove the `testWithNeovim` task Now you can just run `gradlew test -Dnvim` --- .teamcity/_Self/buildTypes/Nvim.kt | 2 +- build.gradle.kts | 10 ++-------- .../org/jetbrains/plugins/ideavim/NeovimTesting.kt | 3 ++- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.teamcity/_Self/buildTypes/Nvim.kt b/.teamcity/_Self/buildTypes/Nvim.kt index a8826e91a3..9910ffc755 100644 --- a/.teamcity/_Self/buildTypes/Nvim.kt +++ b/.teamcity/_Self/buildTypes/Nvim.kt @@ -39,7 +39,7 @@ object Nvim : IdeaVimBuildType({ """.trimIndent() } gradle { - tasks = "clean testWithNeovim" + tasks = "clean test -Dnvim" buildFile = "" enableStacktrace = true } diff --git a/build.gradle.kts b/build.gradle.kts index 1b18f53712..5db6fec0d9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -157,14 +157,6 @@ configurations { } } -// --- Compilation -// This can be moved to other test registration when issue with tests in gradle will be fixed -tasks.register("testWithNeovim") { - group = "verification" - systemProperty("ideavim.nvim.test", "true") - useJUnitPlatform() -} - tasks { test { // Set teamcity env variable locally to run additional tests for leaks. @@ -174,6 +166,8 @@ tasks { println("Set env TEAMCITY_VERSION to X to enable project leak checks from the platform") environment("TEAMCITY_VERSION" to "X") } + + systemProperty("ideavim.nvim.test", System.getProperty("nvim") ?: false) } compileJava { diff --git a/src/testFixtures/kotlin/org/jetbrains/plugins/ideavim/NeovimTesting.kt b/src/testFixtures/kotlin/org/jetbrains/plugins/ideavim/NeovimTesting.kt index 09623bf236..aea6a41821 100644 --- a/src/testFixtures/kotlin/org/jetbrains/plugins/ideavim/NeovimTesting.kt +++ b/src/testFixtures/kotlin/org/jetbrains/plugins/ideavim/NeovimTesting.kt @@ -88,7 +88,8 @@ object NeovimTesting { val noBehaviourDiffers = !method.isAnnotationPresent(VimBehaviorDiffers::class.java) val noTestingWithoutNeovim = !method.isAnnotationPresent(TestWithoutNeovim::class.java) && !test.javaClass.isAnnotationPresent(TestWithoutNeovim::class.java) - val neovimTestingEnabled = System.getProperty("ideavim.nvim.test", "false")!!.toBoolean() + val property = System.getProperty("ideavim.nvim.test", "false") + val neovimTestingEnabled = if (property.isBlank()) true else property.toBoolean() val notParserTest = "org.jetbrains.plugins.ideavim.ex.parser" !in test.javaClass.packageName val notScriptImplementation = "org.jetbrains.plugins.ideavim.ex.implementation" !in test.javaClass.packageName val notExtension = "org.jetbrains.plugins.ideavim.extension" !in test.javaClass.packageName