Plugin Testing - Git Integration
已回答
Hey all,
I'm developing a plugin which relies heavily on git4idea.
I'm now wondering how I can set up my test fixture to properly test the Git integration in my plugin.
I already found an issue from 2018 here about the same topic, but I'm not sure If you notice my post there.
The issue mentions a youtrack ticket which was resolved by publishing the class GitPlatformTest via the artifact
com.jetbrains.intellij.platform:vcs-test-framework
However, I can't find it anymore in the maven repo https://cache-redirector.jetbrains.com/intellij-dependencies.
So my questions are:
1) Is there a better way to test Git integration in my plugin?
2) If not, is there an alternative artifact or repository which I can use to extend from GitPlatformTest?
Thanks in advance
请先登录再写评论。
That's the URL for 3rd party dependencies, it is available from the IntelliJ repository https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html
Oh boy... I somehow overlooked the Snapshot Repository. It works now. Thanks for the swift reply!
Sorry If I'm missing something obvious here but although I managed to find the package, it has dependencies to a number of artifacts which can't be found in any of 3 repositories. Namely:
I've set my sandbox intellij version to 22.3739.54 and added
com.jetbrains.intellij.platform:vcs-test-framework:222.3739.54to my build.gradle dependencies.
Sorry for delay. I was unable to reproduce this problem with this minimal setup on my side, could you please share your project?
```
Sure! I omitted some parts of the tasks and apollo config for readability and privacy reasons but this really shouldn't matter. Please let me know if it does.
plugins {
id("org.jetbrains.intellij") version "1.9.0"
id("org.jetbrains.kotlin.jvm") version "1.7.10"
id("com.apollographql.apollo3") version "3.5.0"
}
group = "my.domain"
version = "0.2-SNAPSHOT"
repositories {
mavenCentral()
maven("https://www.jetbrains.com/intellij-repository/releases")
maven("https://cache-redirector.jetbrains.com/intellij-dependencies")
}
dependencies {
implementation("com.google.guava:guava:31.1-jre")
implementation("com.fasterxml.jackson.core:jackson-databind:2.13.3")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.+")
implementation("com.apollographql.apollo3:apollo-runtime:3.5.0")
testImplementation(kotlin("test"))
testImplementation("org.junit.jupiter:junit-jupiter:5.8.0")
testImplementation("com.jetbrains.intellij.platform:vcs-test-framework:222.3739.54")
testImplementation("org.junit.platform:junit-platform-launcher:1.6.1")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.8.0")
testImplementation("org.junit.vintage:junit-vintage-engine:5.8.0")
}
java {
sourceCompatibility = JavaVersion.VERSION_11
}
// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
version.set("222.3739.54")
plugins.set(
listOf(
"git4idea"
)
)
}
apollo {
[do stuff...]
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = "11"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "11"
}
signPlugin {
[do stuff...]
}
publishPlugin {
dependsOn(test)
[do stuff...]
}
runIde {
autoReloadPlugins.set(true)
}
test {
useJUnitPlatform()
}
patchPluginXml {
version.set("${project.version}")
sinceBuild.set("213")
untilBuild.set("222.*")
}
}
Thanks, reproduced. It seems more repositories must be configured in addition, researching...
As a temporary workaround, please add these repositories additionally.
//serviceMessages maven("https://cache-redirector.jetbrains.com/download.jetbrains.com/teamcity-repository") // pgp-verifier maven("https://cache-redirector.jetbrains.com/download-pgp-verifier") // Grazie maven("https://cache-redirector.jetbrains.com/packages.jetbrains.team/maven/p/grazi/grazie-platform-public")