IntelliJ Platform Gradle Plugin: introduce testFramework dependencies helper

This commit is contained in:
Jakub Chrzanowski 2024-02-29 23:00:04 +01:00
parent c214ef55ca
commit 05cdd3ae26
No known key found for this signature in database
GPG Key ID: C39095BFD769862E
4 changed files with 35 additions and 1 deletions

View File

@ -105,6 +105,19 @@ See also:
- [](plugin_dependencies.md)
## Testing
To implement tests for IntelliJ Platform plugin, it is necessary to explicitly add a dependency on the `test-framework` library containing IntelliJ Platform test classes.
The provided `testFramework(type, version)` helper method makes it possible to add the base artifact to the test classpath or its variants, such as Java, Go, ReSharper, etc.
| Function | Description |
|--------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| `testFramework(type, version)` | Adds a dependency on Test Framework or its variant using [`TestFrameworkType`](tools_intellij_platform_gradle_plugin_types.md#TestFrameworkType) type. |
See also:
- [Types: `TestFrameworkType`](tools_intellij_platform_gradle_plugin_types.md#TestFrameworkType)
## Tools
| Function | Description |

View File

@ -378,6 +378,7 @@ intellijPlatform {
}
}
```
See also:
- [Plugin Configuration File: `idea-version`](plugin_configuration_file.md#idea-plugin__idea-version)

View File

@ -1159,12 +1159,14 @@ Default value
<tldr>
**Extends**: [`Test`][gradle-test-task], [`RunnableIdeAware`](tools_intellij_platform_gradle_plugin_task_awares.md#RunnableIdeAware), [`CustomIntelliJPlatformVersionAware`](tools_intellij_platform_gradle_plugin_task_awares.md#CustomIntelliJPlatformVersionAware)
**Extends**: [`Test`][gradle-test-task], [`CoroutinesJavaAgentAware`](tools_intellij_platform_gradle_plugin_task_awares.md#CoroutinesJavaAgentAware), [`CustomIntelliJPlatformVersionAware`](tools_intellij_platform_gradle_plugin_task_awares.md#CustomIntelliJPlatformVersionAware), [`PluginAware`](tools_intellij_platform_gradle_plugin_task_awares.md#PluginAware), [`RuntimeAware`](tools_intellij_platform_gradle_plugin_task_awares.md#RuntimeAware), [`SandboxAware`](tools_intellij_platform_gradle_plugin_task_awares.md#SigningAware)
**Sources**: [`TestIdeTask`](%gh-ijpgp%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/TestIdeTask.kt)
</tldr>
> This task is not registered with the `testIde` name, but its configuration extends the default `test` task.
Runs plugin tests against the currently selected IntelliJ Platform with the built plugin loaded.
It directly extends the [`Test`][gradle-test-task] Gradle task, which allows for an extensive configuration (system properties, memory management, etc.).

View File

@ -166,6 +166,24 @@ See also:
- [Tasks: `verifyPlugin.subsystemsToCheck`](tools_intellij_platform_gradle_plugin_tasks.md#verifyPlugin-subsystemsToCheck)
## TestFrameworkType
{#TestFrameworkType}
Allows for adding `test-framework` testing library variants. See [Dependencies Extension: Testing](tools_intellij_platform_gradle_plugin_dependencies_extension.md#testing).
| Name | Coordinates |
|--------------|---------------------------------------------------------------|
| `Common` | `com.jetbrains.intellij.platform:test-framework-common` |
| `Core` | `com.jetbrains.intellij.platform:test-framework-core` |
| `Default` | `com.jetbrains.intellij.platform:test-framework` |
| `Go` | `com.jetbrains.intellij.go:go-test-framework` |
| `Ruby` | `com.jetbrains.intellij.idea:ruby-test-framework` |
| `Java` | `com.jetbrains.intellij.java:java-test-framework` |
| `JavaScript` | `com.jetbrains.intellij.javascript:javascript-test-framework` |
| `JUnit5` | `com.jetbrains.intellij.platform:test-framework-junit5` |
| `Maven` | `com.jetbrains.intellij.maven:maven-test-framework` |
| `ReSharper` | `com.jetbrains.intellij.resharper:resharper-test-framework` |
## VerificationReportsFormats
{#VerificationReportsFormats}