1
1
[config ]
2
2
default_to_workspace = false
3
+ init_task = " init"
3
4
4
5
[env ]
5
- # Determines the version of Elasticsearch docker container used
6
- STACK_VERSION = { value = " 9.0.0-SNAPSHOT" , condition = { env_not_set = [" STACK_VERSION" ] }}
7
- # Determines the distribution of docker container used. Either platinum or free
8
- TEST_SUITE = { value = " free" , condition = { env_not_set = [" TEST_SUITE" ] }}
9
6
# Set publish flags to dry-run by default, to force user to explicitly define for publishing
10
7
CARGO_MAKE_CARGO_PUBLISH_FLAGS = " --dry-run"
11
8
# RUST_BACKTRACE is set to "full" in cargo make's builtin makefiles/stable.toml
12
9
RUST_BACKTRACE = { value = " 0" , condition = { env_not_set = [" RUST_BACKTRACE" ]}}
10
+ ELASTICSEARCH_URL = " https://elastic:changeme@localhost:9200"
13
11
14
- [tasks .set-free-env ]
15
- category = " Elasticsearch"
16
- description = " Sets ELASTICSEARCH_URL environment variable if not already set for later tasks when free test suite used"
17
- private = true
18
- condition = { env = { "TEST_SUITE" = " free" }, env_not_set = [" ELASTICSEARCH_URL" ] }
19
- env = { "ELASTICSEARCH_URL" = " http://elastic:changeme@localhost:9200" }
20
-
21
- [tasks .set-platinum-env ]
22
- category = " Elasticsearch"
23
- description = " Sets ELASTICSEARCH_URL environment variable if not already set for later tasks when platinum test suite used"
12
+ [tasks .init ]
24
13
private = true
25
- condition = { env = { "TEST_SUITE" = " platinum" }, env_not_set = [" ELASTICSEARCH_URL" ] }
26
- env = { "ELASTICSEARCH_URL" = " https://elastic:changeme@localhost:9200" }
14
+ condition = { env_not_set = [" STACK_VERSION" ] }
15
+ script = [
16
+ ' echo "Environment variable STACK_VERSION is required but not set."' ,
17
+ ' exit 1' ,
18
+ ]
27
19
28
20
[tasks .download-specs ]
29
21
category = " Elasticsearch"
@@ -35,36 +27,9 @@ command = "cargo"
35
27
args = [" run" , " -q" , " -p" , " xtask" , " --" , " download-specs" , " --url" , " ${ELASTICSEARCH_URL}" ]
36
28
dependencies = [" start-elasticsearch" ]
37
29
38
- [tasks .run-yaml-test-runner ]
39
- category = " Elasticsearch"
40
- description = '''
41
- Runs yaml_test_runner package to generate tests from yaml files for a given Elasticsearch commit.
42
- The commit to use is retrieved from the running Elasticsearch instance
43
- '''
44
- private = true
45
- command = " cargo"
46
- args = [" run" , " -p" , " yaml_test_runner" , " --" , " -u" , " ${ELASTICSEARCH_URL}" ]
47
- dependencies = [" download-specs" ]
48
-
49
- [tasks .test-yaml-test-runner ]
50
- category = " Elasticsearch"
51
- private = true
52
- condition = { env_set = [ " ELASTICSEARCH_URL" ], env_false = [" CARGO_MAKE_CI" ] }
53
- command = " cargo"
54
- args = [" test" , " -p" , " yaml_test_runner" , " --" , " --test-threads" , " 1" ]
55
- dependencies = [" generate-yaml-tests" ]
56
-
57
- [tasks .test-yaml-test-runner-ci ]
58
- category = " Elasticsearch"
59
- private = true
60
- condition = { env_set = [ " ELASTICSEARCH_URL" ], env_true = [" CARGO_MAKE_CI" ] }
61
- script = [" cargo test -p yaml_test_runner -- --test-threads 1 | tee test_results/results.txt" ]
62
- dependencies = [" generate-yaml-tests" ]
63
-
64
30
[tasks .test-elasticsearch ]
65
31
category = " Elasticsearch"
66
32
private = true
67
- condition = { env_set = [ " ELASTICSEARCH_URL" ], env = { "TEST_SUITE" = " platinum" } }
68
33
command = " cargo"
69
34
args = [" test" , " -p" , " elasticsearch" ]
70
35
dependencies = [" start-elasticsearch" ]
@@ -97,8 +62,7 @@ script = ["[ -d test_results ] || mkdir -p test_results"]
97
62
[tasks .run-elasticsearch ]
98
63
category = " Elasticsearch"
99
64
private = true
100
- condition = { env_set = [ " STACK_VERSION" , " TEST_SUITE" ], env_false = [" CARGO_MAKE_CI" ] }
101
- dependencies = [" set-free-env" , " set-platinum-env" ]
65
+ condition = { env_set = [ " STACK_VERSION" ], env_false = [" CARGO_MAKE_CI" ] }
102
66
103
67
[tasks .run-elasticsearch .linux ]
104
68
command = " ./.buildkite/run-elasticsearch.sh"
@@ -110,7 +74,7 @@ command = "./.buildkite/run-elasticsearch.sh"
110
74
script_runner = " cmd"
111
75
script = [
112
76
'''
113
- bash -c "STACK_VERSION=%STACK_VERSION% TEST_SUITE=%TEST_SUITE% DETACH=%DETACH% CLEANUP=%CLEANUP% bash .buildkite/run-elasticsearch.sh"
77
+ bash -c "STACK_VERSION=%STACK_VERSION% DETACH=%DETACH% CLEANUP=%CLEANUP% bash .buildkite/run-elasticsearch.sh"
114
78
'''
115
79
]
116
80
@@ -147,13 +111,6 @@ private = false
147
111
description = " Stops Elasticsearch docker container, if running"
148
112
env = { "CLEANUP" = true , "DETACH" = false }
149
113
150
- [tasks .test-yaml ]
151
- category = " Elasticsearch"
152
- description = " Generates and runs yaml_test_runner package platinum/free tests against a given Elasticsearch version"
153
- condition = { env_set = [ " STACK_VERSION" , " TEST_SUITE" ] }
154
- dependencies = [" generate-yaml-tests" , " create-test-results-dir" , " test-yaml-test-runner" , " test-yaml-test-runner-ci" ]
155
- run_task = " stop-elasticsearch"
156
-
157
114
[tasks .test-generator ]
158
115
category = " Elasticsearch"
159
116
clear = true
@@ -165,16 +122,9 @@ args = ["test", "-p", "api_generator"]
165
122
category = " Elasticsearch"
166
123
clear = true
167
124
description = " Runs elasticsearch package tests against a given Elasticsearch version"
168
- env = { "TEST_SUITE" = { value = " platinum" , condition = { env_set = [" TEST_SUITE" ] } } }
169
125
dependencies = [" test-elasticsearch" ]
170
126
run_task = " stop-elasticsearch"
171
127
172
- [tasks .generate-yaml-tests ]
173
- category = " Elasticsearch"
174
- description = " Generates Elasticsearch client tests from YAML tests"
175
- dependencies = [" run-yaml-test-runner" ]
176
- run_task = " format"
177
-
178
128
[tasks .generate-api ]
179
129
category = " Elasticsearch"
180
130
description = " Generates Elasticsearch client from REST API specs"
@@ -343,7 +293,6 @@ script = ['''
343
293
echo - start-elasticsearch: Starts Elasticsearch docker container with the given version and distribution
344
294
echo - stop-elasticsearch: Stops Elasticsearch docker container, if running
345
295
echo
346
- echo - test-yaml: Generates and runs yaml_test_runner package platinum/free tests against a given Elasticsearch version
347
296
echo - test-generator: Generates and runs api_generator package tests
348
297
echo - test: Runs elasticsearch package tests against a given Elasticsearch version
349
298
echo
@@ -358,7 +307,6 @@ script = ['''
358
307
echo
359
308
echo Most tasks use these environment variables:
360
309
echo - STACK_VERSION (default '${STACK_VERSION}'): the version of Elasticsearch
361
- echo - TEST_SUITE ('free' or 'platinum', default '${TEST_SUITE}'): the distribution of Elasticsearch
362
310
echo - CI (default not set): set when running on CI to determine whether to start Elasticsearch and format test output as JSON
363
311
echo
364
312
echo Run 'cargo make --list-all-steps' for a complete list of available tasks.
0 commit comments