11[config ]
22default_to_workspace = false
3+ init_task = " init"
34
45[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" ] }}
96# Set publish flags to dry-run by default, to force user to explicitly define for publishing
107CARGO_MAKE_CARGO_PUBLISH_FLAGS = " --dry-run"
118# RUST_BACKTRACE is set to "full" in cargo make's builtin makefiles/stable.toml
129RUST_BACKTRACE = { value = " 0" , condition = { env_not_set = [" RUST_BACKTRACE" ]}}
10+ ELASTICSEARCH_URL = " https://elastic:changeme@localhost:9200"
1311
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 ]
2413private = 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+ ]
2719
2820[tasks .download-specs ]
2921category = " Elasticsearch"
@@ -35,36 +27,9 @@ command = "cargo"
3527args = [" run" , " -q" , " -p" , " xtask" , " --" , " download-specs" , " --url" , " ${ELASTICSEARCH_URL}" ]
3628dependencies = [" start-elasticsearch" ]
3729
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-
6430[tasks .test-elasticsearch ]
6531category = " Elasticsearch"
6632private = true
67- condition = { env_set = [ " ELASTICSEARCH_URL" ], env = { "TEST_SUITE" = " platinum" } }
6833command = " cargo"
6934args = [" test" , " -p" , " elasticsearch" ]
7035dependencies = [" start-elasticsearch" ]
@@ -97,8 +62,7 @@ script = ["[ -d test_results ] || mkdir -p test_results"]
9762[tasks .run-elasticsearch ]
9863category = " Elasticsearch"
9964private = 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" ] }
10266
10367[tasks .run-elasticsearch .linux ]
10468command = " ./.buildkite/run-elasticsearch.sh"
@@ -110,7 +74,7 @@ command = "./.buildkite/run-elasticsearch.sh"
11074script_runner = " cmd"
11175script = [
11276'''
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"
11478'''
11579]
11680
@@ -147,13 +111,6 @@ private = false
147111description = " Stops Elasticsearch docker container, if running"
148112env = { "CLEANUP" = true , "DETACH" = false }
149113
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-
157114[tasks .test-generator ]
158115category = " Elasticsearch"
159116clear = true
@@ -165,16 +122,9 @@ args = ["test", "-p", "api_generator"]
165122category = " Elasticsearch"
166123clear = true
167124description = " Runs elasticsearch package tests against a given Elasticsearch version"
168- env = { "TEST_SUITE" = { value = " platinum" , condition = { env_set = [" TEST_SUITE" ] } } }
169125dependencies = [" test-elasticsearch" ]
170126run_task = " stop-elasticsearch"
171127
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-
178128[tasks .generate-api ]
179129category = " Elasticsearch"
180130description = " Generates Elasticsearch client from REST API specs"
@@ -343,7 +293,6 @@ script = ['''
343293 echo - start-elasticsearch: Starts Elasticsearch docker container with the given version and distribution
344294 echo - stop-elasticsearch: Stops Elasticsearch docker container, if running
345295 echo
346- echo - test-yaml: Generates and runs yaml_test_runner package platinum/free tests against a given Elasticsearch version
347296 echo - test-generator: Generates and runs api_generator package tests
348297 echo - test: Runs elasticsearch package tests against a given Elasticsearch version
349298 echo
@@ -358,7 +307,6 @@ script = ['''
358307 echo
359308 echo Most tasks use these environment variables:
360309 echo - STACK_VERSION (default '${STACK_VERSION}'): the version of Elasticsearch
361- echo - TEST_SUITE ('free' or 'platinum', default '${TEST_SUITE}'): the distribution of Elasticsearch
362310 echo - CI (default not set): set when running on CI to determine whether to start Elasticsearch and format test output as JSON
363311 echo
364312 echo Run 'cargo make --list-all-steps' for a complete list of available tasks.
0 commit comments