Skip to content

Commit 0ae51d0

Browse files
committed
Cleanup: remove yaml tests and TEST_SUITE
1 parent d58f3f8 commit 0ae51d0

29 files changed

+13
-4250
lines changed

.buildkite/DockerFile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ COPY api_generator ./api_generator
2525
COPY elasticsearch/Cargo.toml ./elasticsearch/Cargo.toml
2626
COPY elasticsearch/src ./elasticsearch/src
2727
COPY elasticsearch/build.rs ./elasticsearch/build.rs
28-
COPY yaml_test_runner ./yaml_test_runner
2928
COPY xtask ./xtask
3029

3130
RUN cargo build --tests

.buildkite/functions/imports.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
# - Initial version after refactor
77
# - Validate STACK_VERSION asap
88

9+
# Hardcoded, there's no more a distinction between "free" and "platinum" and security is on by default
10+
export TEST_SUITE="platinum"
11+
912
function require_stack_version() {
1013
if [[ -z $STACK_VERSION ]]; then
1114
echo -e "\033[31;1mERROR:\033[0m Required environment variable [STACK_VERSION] not set\033[0m"

.buildkite/pipeline.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@ steps:
44
provider: "gcp"
55
env:
66
STACK_VERSION: "{{ matrix.stack_version }}"
7-
TEST_SUITE: "{{ matrix.test_suite }}"
87
RUST_TOOLCHAIN: "{{ matrix.toolchain }}"
98
matrix:
109
setup:
1110
stack_version:
1211
- "9.0.0"
13-
test_suite:
14-
- "platinum"
1512
toolchain:
1613
- "latest"
1714
command: ./.buildkite/run-tests

.dockerignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,3 @@ docs
99
*.iml
1010

1111
api_generator/src/bin
12-
13-
yaml_test_runner/tests
14-
!yaml_test_runner/tests/common

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,5 @@ pkg
66
*.iml
77
.vscode/
88
*.log
9-
yaml_test_runner/tests/free
10-
yaml_test_runner/tests/xpack
11-
yaml_test_runner/tests/platinum
12-
yaml_test_runner/tests/mod.rs
139
test_results/
1410
checkout/

CONTRIBUTING.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,6 @@ The `Elasticsearch` category of steps are specifically defined for this project
7676
cargo make test --env STACK_VERSION=7.9.0
7777
```
7878

79-
- Run YAML tests
80-
81-
Optionally pass
82-
83-
- `STACK_VERSION`: Elasticsearch version like `7.9.0` or can be
84-
a snapshot release like `7.x-SNAPSHOT`
85-
- `TEST_SUITE`: Elasticsearch distribution of `free` or `platinum`
86-
87-
```sh
88-
cargo make test-yaml --env STACK_VERSION=7.9.0 --env TEST_SUITE=free
89-
```
90-
9179
### Packages
9280

9381
The workspace contains the following packages:
@@ -109,15 +97,6 @@ The `quote!` macro is particularly useful as it accepts Rust code that can inclu
10997
that will be interpolated during expansion. Unlike procedural macros, the token stream returned by the `quote!` macro
11098
can be `to_string()`'ed and written to disk, and this is used to create much of the client scaffolding.
11199

112-
- #### `yaml_test_runner`
113-
114-
A small executable that downloads YAML tests from GitHub and generates client tests from the YAML tests. The
115-
version of YAML tests to download are determined from the commit hash of a running Elasticsearch instance.
116-
117-
The `yaml_test_runner` package can be run with `cargo make test-yaml` to run the generated client tests,
118-
passing environment variables `TEST_SUITE` and `STACK_VERSION` to control the distribution and version,
119-
respectively.
120-
121100
### Design principles
122101

123102
1. Generate as much of the client as feasible from the REST API specs

Cargo.lock

Lines changed: 0 additions & 66 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
members = [
33
"api_generator",
44
"elasticsearch",
5-
"yaml_test_runner",
65
"xtask"
76
]
87

Makefile.toml

Lines changed: 10 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,21 @@
11
[config]
22
default_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
107
CARGO_MAKE_CARGO_PUBLISH_FLAGS = "--dry-run"
118
# RUST_BACKTRACE is set to "full" in cargo make's builtin makefiles/stable.toml
129
RUST_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]
2413
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+
]
2719

2820
[tasks.download-specs]
2921
category = "Elasticsearch"
@@ -35,36 +27,9 @@ command = "cargo"
3527
args = ["run", "-q", "-p", "xtask", "--", "download-specs", "--url", "${ELASTICSEARCH_URL}"]
3628
dependencies = ["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]
6531
category = "Elasticsearch"
6632
private = true
67-
condition = { env_set = [ "ELASTICSEARCH_URL" ], env = { "TEST_SUITE" = "platinum" } }
6833
command = "cargo"
6934
args = ["test", "-p", "elasticsearch"]
7035
dependencies = ["start-elasticsearch"]
@@ -97,8 +62,7 @@ script = ["[ -d test_results ] || mkdir -p test_results"]
9762
[tasks.run-elasticsearch]
9863
category = "Elasticsearch"
9964
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"] }
10266

10367
[tasks.run-elasticsearch.linux]
10468
command = "./.buildkite/run-elasticsearch.sh"
@@ -110,7 +74,7 @@ command = "./.buildkite/run-elasticsearch.sh"
11074
script_runner = "cmd"
11175
script = [
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
147111
description = "Stops Elasticsearch docker container, if running"
148112
env = { "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]
158115
category = "Elasticsearch"
159116
clear = true
@@ -165,16 +122,9 @@ args = ["test", "-p", "api_generator"]
165122
category = "Elasticsearch"
166123
clear = true
167124
description = "Runs elasticsearch package tests against a given Elasticsearch version"
168-
env = { "TEST_SUITE" = { value = "platinum", condition = { env_set = ["TEST_SUITE"] } } }
169125
dependencies = ["test-elasticsearch"]
170126
run_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]
179129
category = "Elasticsearch"
180130
description = "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.

yaml_test_runner/Cargo.toml

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)