Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add K2 support #424

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ TestSpark currently supports two test generation strategies:
<p>For this type of test generation, TestSpark sends request to different Large Language Models. Also, it automatically checks if tests are valid before presenting it to users.</p>
<p>This feature needs a token from OpenAI, HuggingFace, or the AI Assistant platform.</p>
<ul>
<li>Supports Java (any version) and Kotlin (K2 mode should be disabled, checkout the Settings section on README).</li>
<li>Supports Java and Kotlin.</li>
<li>Generates unit tests for capturing failures.</li>
<li>Generate tests for Java classes, methods, and single lines.</li>
</ul>
Expand Down Expand Up @@ -230,9 +230,6 @@ Or to a new file:

![Tests adding to a new file](readme-images/gifs/AddingToANewFile.gif#gh-light-mode-only)
![Tests adding to a new file_dark](readme-images/gifs/AddingToANewFile_dark.gif#gh-dark-mode-only)
### Disable K2
For LLM-based Kotlin test generation, you need to disable the K2 mode for now.
![Disable K2 mode](readme-images/pngs/k2-mode/disable-k2.png)
### Settings
<!-- How can users configure the plugin to match their needs? -->
The plugin is configured mainly through the Settings menu. The plugin settings can be found under <kbd>Settings</kbd> > <kbd>Tools</kbd> > <kbd>TestSpark</kbd>. Here, the user is able to select options for the plugin:
Expand Down
6 changes: 6 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,12 @@ changelog {
// }

tasks {
// enable K2 mode in UI test
runIde {
jvmArgumentProviders += CommandLineArgumentProvider {
listOf("-Didea.kotlin.plugin.use.k2=true")
}
}

compileKotlin {
dependsOn("updateEvosuite")
Expand Down
7 changes: 6 additions & 1 deletion src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<p>For this type of test generation, TestSpark sends request to different Large Language Models. Also, it automatically checks if tests are valid before presenting it to users.</p>
<p>This feature needs a token from OpenAI, HuggingFace, or the AI Assistant platform.</p>
<ul>
<li>Supports Java (any version) and Kotlin (K2 mode should be disabled, checkout the Settings section on README).</li>
<li>Supports Java and Kotlin.</li>
<li>Generates unit tests for capturing failures.</li>
<li>Generate tests for Java classes, methods, and single lines.</li>
</ul>
Expand Down Expand Up @@ -187,6 +187,11 @@
</extensionPoint>
</extensionPoints>

<!-- This is a temporary mechanism to mark the plugin as K2 compatible. -->
<extensions defaultExtensionNs="org.jetbrains.kotlin">
<supportsKotlinPluginMode supportsK2="true"/>
</extensions>

<extensions defaultExtensionNs="com.intellij">
<toolWindow id="TestSpark" secondary="true" anchor="right"
icon="org.jetbrains.research.testspark.display.TestSparkIcons.toolWindowIcon"
Expand Down
Loading