From ed99ef5f0c59017d21164d32afbe8b6007cc3fd9 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Thu, 17 May 2018 08:48:57 +0200 Subject: [PATCH 1/3] [Build] Add test admin when starting gradle run with trial license and also add more documentation around gradle run task. --- TESTING.asciidoc | 31 +++++++++++++++++++++++++++++++ distribution/build.gradle | 2 ++ 2 files changed, 33 insertions(+) diff --git a/TESTING.asciidoc b/TESTING.asciidoc index 15cdfdd1c52ba..019f5107f874d 100644 --- a/TESTING.asciidoc +++ b/TESTING.asciidoc @@ -25,6 +25,37 @@ run it using Gradle: ./gradlew run ------------------------------------- +==== Distribution + +By default a node is started with the zip distribution. +In order to start with a different distribution use the `-Drun.distribution` argument. + +To for example start the open source distribution: + +------------------------------------- +./gradlew run -Drun.distribution=oss-zip +------------------------------------- + +==== License type + +By default a node is started with the `basic` license type. +In order to start with a different license type use the `-Drun.distribution` argument. + +In order to start a node with a trail license execute the following command: + +------------------------------------- +./gradlew run -Dlicense_type=trial +------------------------------------- + +This enables security and other paid features and adds a superuser with the username: `elastic-admin` and +password: `elastic-password`. + +==== Other useful arguments + +In order to start a node with a different max heap space add: `-Dtests.heap.size=4G` +In order to disable annotations add: `-Dtests.asserts=false` +In order to set an Elasticsearch setting, provide a setting with the following prefix: `-Dtests.es.` + === Test case filtering. - `tests.class` is a class-filtering shell-like glob pattern, diff --git a/distribution/build.gradle b/distribution/build.gradle index d2e2810bc7eec..64adab8b3b028 100644 --- a/distribution/build.gradle +++ b/distribution/build.gradle @@ -316,6 +316,8 @@ task run(type: RunTask) { setting 'xpack.graph.enabled', 'true' setting 'xpack.watcher.enabled', 'true' setting 'xpack.license.self_generated.type', 'trial' + setupCommand 'setupTestAdmin', + 'bin/elasticsearch-users', 'useradd', 'elastic-admin', '-p', 'elastic-password', '-r', 'superuser' } else if (licenseType != 'basic') { throw new IllegalArgumentException("Unsupported self-generated license type: [" + licenseType + "[basic] or [trial].") } From 2b8cd7bcb192551d5e22fc30b6552ab6cd37f179 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Thu, 17 May 2018 08:53:56 +0200 Subject: [PATCH 2/3] moved `--debug-jvm` docs next to other gradle run docs --- TESTING.asciidoc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/TESTING.asciidoc b/TESTING.asciidoc index 019f5107f874d..56a652bc24934 100644 --- a/TESTING.asciidoc +++ b/TESTING.asciidoc @@ -25,6 +25,15 @@ run it using Gradle: ./gradlew run ------------------------------------- +==== Launching and debugging from an IDE + +If you want to run Elasticsearch from your IDE, the `./gradlew run` task +supports a remote debugging option: + +--------------------------------------------------------------------------- +./gradlew run --debug-jvm +--------------------------------------------------------------------------- + ==== Distribution By default a node is started with the zip distribution. @@ -603,15 +612,6 @@ as its build system. Since the switch to Gradle though, this is no longer possib the code currently used to build Elasticsearch does not allow JaCoCo to recognize its tests. For more information on this, see the discussion in https://github.com/elastic/elasticsearch/issues/28867[issue #28867]. -== Launching and debugging from an IDE - -If you want to run Elasticsearch from your IDE, the `./gradlew run` task -supports a remote debugging option: - ---------------------------------------------------------------------------- -./gradlew run --debug-jvm ---------------------------------------------------------------------------- - == Debugging remotely from an IDE If you want to run Elasticsearch and be able to remotely attach the process From 09e228b09f4a9db5985475e1164b96515d1ff119 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Fri, 18 May 2018 08:01:17 +0200 Subject: [PATCH 3/3] rename --- TESTING.asciidoc | 6 +++--- distribution/build.gradle | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TESTING.asciidoc b/TESTING.asciidoc index 56a652bc24934..1461dae5ae107 100644 --- a/TESTING.asciidoc +++ b/TESTING.asciidoc @@ -48,12 +48,12 @@ To for example start the open source distribution: ==== License type By default a node is started with the `basic` license type. -In order to start with a different license type use the `-Drun.distribution` argument. +In order to start with a different license type use the `-Drun.license_type` argument. -In order to start a node with a trail license execute the following command: +In order to start a node with a trial license execute the following command: ------------------------------------- -./gradlew run -Dlicense_type=trial +./gradlew run -Drun.license_type=trial ------------------------------------- This enables security and other paid features and adds a superuser with the username: `elastic-admin` and diff --git a/distribution/build.gradle b/distribution/build.gradle index 64adab8b3b028..940a4152bfd55 100644 --- a/distribution/build.gradle +++ b/distribution/build.gradle @@ -310,7 +310,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) { task run(type: RunTask) { distribution = System.getProperty('run.distribution', 'zip') if (distribution == 'zip') { - String licenseType = System.getProperty("license_type", "basic") + String licenseType = System.getProperty("run.license_type", "basic") if (licenseType == 'trial') { setting 'xpack.ml.enabled', 'true' setting 'xpack.graph.enabled', 'true'