Skip to content

Commit

Permalink
Make tests work
Browse files Browse the repository at this point in the history
- add explicit dependency on junit lib
- add explicit dependency on platform test framework
- create `testOutput` configuration for `common` module to share tests between modules. Actually, it's a hack. But the proper solution should use `java-test-fixtures` gradle plugin. And for some reason it doesn't work with the latest platform release (2024.3)
  • Loading branch information
Undin committed Dec 3, 2024
1 parent 9614851 commit bb9363c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformDependenciesExtension
import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformExtension
import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformRepositoriesExtension
Expand All @@ -12,6 +13,7 @@ val ideaVersion: String by project

plugins {
java
`java-test-fixtures`
val kotlinVersion = "1.9.21"
id("org.jetbrains.kotlin.jvm") version kotlinVersion apply false
id("io.gitlab.arturbosch.detekt") version "1.23.1"
Expand Down Expand Up @@ -46,6 +48,7 @@ configure(subprojects) {
apply {
plugin("java")
plugin("kotlin")
plugin("java-test-fixtures")
}

// Configure detekt
Expand Down Expand Up @@ -157,9 +160,11 @@ configure(subprojects.filter { it.name != "common" }) {
intellijIdeaCommunity(ideaVersion, useInstaller = false)
jetbrainsRuntime()
bundledPlugins("com.intellij.java", "org.jetbrains.kotlin")
testFramework(TestFrameworkType.Bundled)
}

implementation(project(":common"))
testImplementation(testFixtures(project(":common")))
}

tasks.register<Copy>("restoreOriginalFiles") {
Expand Down
5 changes: 5 additions & 0 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.intellij.platform.gradle.TestFrameworkType

group = rootProject.group
version = rootProject.version

Expand All @@ -23,5 +25,8 @@ dependencies {
intellijIdeaCommunity(ideaVersion, useInstaller = false)
jetbrainsRuntime()
bundledPlugins("com.intellij.java", "org.jetbrains.kotlin")
testFramework(TestFrameworkType.Bundled)
}

testFixturesApi("junit:junit:4.13.2")
}

0 comments on commit bb9363c

Please sign in to comment.