Add new option to allow full delegation of IntelliJ tests to Gradle (#126772) (#129620)

* Add new option to allow full delegation of tests to gradle in IntelliJ plus docs

* Update CONTRIBUTING.md



* Update CONTRIBUTING.md

Fix typo in settings file name in docs

---------

Co-authored-by: Rene Groeschke <rene@breskeby.com>
This commit is contained in:
Luke Whiting 2025-06-18 12:26:35 +01:00 committed by GitHub
parent 9203140003
commit 95a5ac7aa2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions

View file

@ -206,6 +206,18 @@ Alternative manual steps for IntelliJ.
3. Navigate to the file `build-conventions/formatterConfig.xml`
4. Click "OK"
#### Options
When importing to IntelliJ, we offer a few options that can be used to
configure the behaviour of the import:
| Property | Description | Values (* = default) |
|--------------------------------------------|------------------------------------------------------------------------------------------------------|----------------------|
| `org.elasticsearch.idea-configuration-cache` | Should IntelliJ enable the Gradle Configuration cache to speed up builds when generating run configs | *`true`, `false` |
| `org.elasticsearch.idea-delegate-to-gradle` | Should IntelliJ use Gradle for all generated run / test configs or prompt each time | `true`, *`false` |
These options can be set anywhere on the Gradle config path including in `~/.gradle/gradle.properties`
### REST endpoint conventions
Elasticsearch typically uses singular nouns rather than plurals in URLs.

View file

@ -175,6 +175,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
// this path is produced by the extractLibs task above
String testLibraryPath = TestUtil.getTestLibraryPath("${elasticsearchProject.left()}/libs/native/libraries/build/platform")
def enableIdeaCC = providers.gradleProperty("org.elasticsearch.idea-configuration-cache").getOrElse("true").toBoolean()
def delegateToGradle = providers.gradleProperty("org.elasticsearch.idea-delegate-to-gradle").getOrElse("false").toBoolean()
idea {
project {
vcs = 'Git'
@ -183,7 +184,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
settings {
delegateActions {
delegateBuildRunToGradle = false
testRunner = 'choose_per_test'
testRunner = delegateToGradle ? 'gradle' : 'choose_per_test'
}
taskTriggers {
afterSync tasks.named('configureIdeCheckstyle'),