Skip to content

Commit ed99ef5

Browse files
committed
[Build] Add test admin when starting gradle run with trial license and
also add more documentation around gradle run task.
1 parent 890afad commit ed99ef5

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

TESTING.asciidoc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,37 @@ run it using Gradle:
2525
./gradlew run
2626
-------------------------------------
2727

28+
==== Distribution
29+
30+
By default a node is started with the zip distribution.
31+
In order to start with a different distribution use the `-Drun.distribution` argument.
32+
33+
To for example start the open source distribution:
34+
35+
-------------------------------------
36+
./gradlew run -Drun.distribution=oss-zip
37+
-------------------------------------
38+
39+
==== License type
40+
41+
By default a node is started with the `basic` license type.
42+
In order to start with a different license type use the `-Drun.distribution` argument.
43+
44+
In order to start a node with a trail license execute the following command:
45+
46+
-------------------------------------
47+
./gradlew run -Dlicense_type=trial
48+
-------------------------------------
49+
50+
This enables security and other paid features and adds a superuser with the username: `elastic-admin` and
51+
password: `elastic-password`.
52+
53+
==== Other useful arguments
54+
55+
In order to start a node with a different max heap space add: `-Dtests.heap.size=4G`
56+
In order to disable annotations add: `-Dtests.asserts=false`
57+
In order to set an Elasticsearch setting, provide a setting with the following prefix: `-Dtests.es.`
58+
2859
=== Test case filtering.
2960

3061
- `tests.class` is a class-filtering shell-like glob pattern,

distribution/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@ task run(type: RunTask) {
316316
setting 'xpack.graph.enabled', 'true'
317317
setting 'xpack.watcher.enabled', 'true'
318318
setting 'xpack.license.self_generated.type', 'trial'
319+
setupCommand 'setupTestAdmin',
320+
'bin/elasticsearch-users', 'useradd', 'elastic-admin', '-p', 'elastic-password', '-r', 'superuser'
319321
} else if (licenseType != 'basic') {
320322
throw new IllegalArgumentException("Unsupported self-generated license type: [" + licenseType + "[basic] or [trial].")
321323
}

0 commit comments

Comments
 (0)