From a7ee27d8eb2fa25729d2cfc91516bbdfb783d09f Mon Sep 17 00:00:00 2001 From: daviss Date: Tue, 17 Oct 2023 15:33:39 -0700 Subject: [PATCH] remove rule that skips test We did a partial removal in an earlier commit and unintientionally made the TestHarness skip its tests. This commit removes the rule altogether and fixes the setUp/tearDown calls by removing the annotation (annotation not needed), see https://github.com/JetBrains/intellij-community/blob/master/platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java#L91 --- .../test/kotlin/motif/intellij/TestHarness.kt | 13 -------- intellij/testing/build.gradle | 21 ------------ .../motif/intellij/testing/IntelliJRule.kt | 33 ------------------- 3 files changed, 67 deletions(-) delete mode 100644 intellij/testing/build.gradle delete mode 100644 intellij/testing/src/main/kotlin/motif/intellij/testing/IntelliJRule.kt diff --git a/intellij/src/test/kotlin/motif/intellij/TestHarness.kt b/intellij/src/test/kotlin/motif/intellij/TestHarness.kt index c6f88c91..2e0ba1aa 100644 --- a/intellij/src/test/kotlin/motif/intellij/TestHarness.kt +++ b/intellij/src/test/kotlin/motif/intellij/TestHarness.kt @@ -30,39 +30,26 @@ import kotlin.reflect.KClass import motif.Scope import motif.core.ResolvedGraph import motif.errormessage.ErrorMessage -import motif.intellij.testing.IntelliJRule import motif.viewmodel.TestRenderer -import org.junit.After -import org.junit.Before -import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith @RunWith(Parameterized::class) class TestHarness : LightJavaCodeInsightFixtureTestCase() { - @get:Rule val rule = IntelliJRule() - @org.junit.runners.Parameterized.Parameter(0) lateinit var testDir: File override fun getProjectDescriptor() = DefaultLightProjectDescriptor { JavaAwareProjectJdkTableImpl.getInstanceEx().internalJdk } - @Before public override fun setUp() { super.setUp() - addLibrary(Inject::class) addLibrary(Scope::class) addLibrary(Nullable::class) } - @After - public override fun tearDown() { - super.tearDown() - } - private fun addLibrary(clazz: KClass<*>) { val fileUri = clazz diff --git a/intellij/testing/build.gradle b/intellij/testing/build.gradle deleted file mode 100644 index a1df613e..00000000 --- a/intellij/testing/build.gradle +++ /dev/null @@ -1,21 +0,0 @@ -plugins { - id "org.jetbrains.intellij" - id 'org.jetbrains.kotlin.jvm' -} - -intellij { - version = deps.versions.gradleIntellijPlugin.ide - plugins = [ 'java', 'Kotlin' ] - pluginName = 'Motif Plugin' - updateSinceUntilBuild = false -} - -dependencies { - implementation deps.test.truth -} - -tasks { - buildSearchableOptions { - enabled = false - } -} diff --git a/intellij/testing/src/main/kotlin/motif/intellij/testing/IntelliJRule.kt b/intellij/testing/src/main/kotlin/motif/intellij/testing/IntelliJRule.kt deleted file mode 100644 index b50a56d3..00000000 --- a/intellij/testing/src/main/kotlin/motif/intellij/testing/IntelliJRule.kt +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2018-2019 Uber Technologies, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package motif.intellij.testing - -import com.intellij.testFramework.TestApplicationManager -import org.junit.rules.TestRule -import org.junit.runner.Description -import org.junit.runners.model.Statement - -class IntelliJRule : TestRule { - - override fun apply(base: Statement, description: Description): Statement { - return object : Statement() { - - override fun evaluate() { - TestApplicationManager.getInstance() - } - } - } -}