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

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

* Update CONTRIBUTING.md

Co-authored-by: Rene Groeschke <rene@breskeby.com>

* 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 11:20:36 +01:00 committed by GitHub
parent a229c8d932
commit 996c99bd04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions

View file

@ -203,6 +203,18 @@ Alternative manual steps for IntelliJ.
3. Navigate to the file `build-conventions/formatterConfig.xml` 3. Navigate to the file `build-conventions/formatterConfig.xml`
4. Click "OK" 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 ### REST endpoint conventions
Elasticsearch typically uses singular nouns rather than plurals in URLs. Elasticsearch typically uses singular nouns rather than plurals in URLs.

View file

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