Plugin Testing - Git Integration

Answered

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

0
7 comments

That's the URL for 3rd party dependencies, it is available from the IntelliJ repository https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html

0

Oh boy... I somehow overlooked the Snapshot Repository. It works now. Thanks for the swift reply!

0

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:

org.jetbrains.intellij.deps:asm-all:9.2.
org.jetbrains.intellij.deps.jcef:jcef:98.3.34+g97a5ae6+chromium-98.0.4758.102-api-1
org.jetbrains.jediterm:jediterm-pty:2.69.
org.jetbrains.intellij.deps:commons-imaging:1.0-RC-1.
org.jetbrains.intellij.deps:java-compatibility:1.0.1.
com.jetbrains:jbr-api:11.1.1.2.
org.jetbrains.nativecerts:jvm-native-trusted-roots:1.0.13.
org.jetbrains.jediterm:jediterm-typeahead:2.69.
org.jetbrains.teamcity:serviceMessages:2019.1.4.
org.jetbrains.intellij.deps:ap-validation:0.0.20.
org.jetbrains.intellij.deps.batik:batik-codec:1.14.0-24.
org.jetbrains.intellij.deps.batik:batik-transcoder:1.14.0-24.
com.jetbrains.infra:download-pgp-verifier:1.0.2.
org.jetbrains.intellij.deps:ion-java:1.8.2-4.
org.jetbrains.pty4j:purejavacomm:0.0.11.1.
io.ktor:ktor-network-jvm:2.0.0-eap-302.
ai.grazie.spell:hunspell-en:0.1.7-1.
ai.grazie.nlp:nlp-tokenizer:0.1.50-1.
ai.grazie.nlp:nlp-common:0.1.50-1.
ai.grazie.utils:utils-common:0.1.50-1.

I've set my sandbox intellij version to 22.3739.54 and added 

com.jetbrains.intellij.platform:vcs-test-framework:222.3739.54

to my build.gradle dependencies.

0

Sorry for delay. I was unable to reproduce this problem with this minimal setup on my side, could you please share your project?

```

// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.

plugins {
id("java")
id("org.jetbrains.intellij") version "1.9.0"
}

group = "org.intellij.sdk"
version = "2.0.0"

repositories {
mavenCentral()

maven("https://www.jetbrains.com/intellij-repository/releases")
maven("https://cache-redirector.jetbrains.com/intellij-dependencies")

}

dependencies {
implementation("com.jetbrains.intellij.platform:vcs-test-framework:222.3739.54")
}

java {
sourceCompatibility = JavaVersion.VERSION_11
}

// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
version.set("222.3739.54")
}

tasks {
buildSearchableOptions {
enabled = false
}

patchPluginXml {
version.set("${project.version}")
sinceBuild.set("213")
untilBuild.set("222.*")
}
}
0

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.*")
}
}

 

 

0

Thanks, reproduced. It seems more repositories must be configured in addition, researching...

0

Please sign in to leave a comment.