Skip to content

Commit 730fee4

Browse files
Update CI scripts (#5287) (#5291)
* Update ci scripts * Update snippets for 7.x * Update readme Co-authored-by: Steve Gordon <sgordon@hotmail.co.uk>
1 parent 46caff6 commit 730fee4

File tree

7 files changed

+25
-28
lines changed

7 files changed

+25
-28
lines changed

.ci/functions/imports.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ require_stack_version
1818
if [[ -z $es_node_name ]]; then
1919
# only set these once
2020
set -euo pipefail
21-
export TEST_SUITE=${TEST_SUITE-oss}
21+
export TEST_SUITE=${TEST_SUITE-free}
2222
export RUNSCRIPTS=${RUNSCRIPTS-}
2323
export DETACH=${DETACH-false}
2424
export CLEANUP=${CLEANUP-false}
@@ -27,8 +27,7 @@ if [[ -z $es_node_name ]]; then
2727
export elastic_password=changeme
2828
export elasticsearch_image=elasticsearch
2929
export elasticsearch_url=https://elastic:${elastic_password}@${es_node_name}:9200
30-
if [[ $TEST_SUITE != "xpack" ]]; then
31-
export elasticsearch_image=elasticsearch-${TEST_SUITE}
30+
if [[ $TEST_SUITE != "platinum" ]]; then
3231
export elasticsearch_url=http://${es_node_name}:9200
3332
fi
3433
export external_elasticsearch_url=${elasticsearch_url/$es_node_name/localhost}

.ci/readme.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,38 @@ Each `do` section in the yaml is mapped to a low level client method. To aid wit
1313
way to deal with elasticsearch responses in a semi typed fashion.
1414

1515
These `rest-api-spec` tests are in addition to the unit and integration tests that live under `src/Tests/Tests` which for 90% of the cases focuses
16-
more on the high level client `NEST` where as these `rest-api-spec` test fully focus on the low level client `Elasticsearch.Net`
16+
more on the high level client `NEST` where as these `rest-api-spec` tests fully focus on the low level client `Elasticsearch.Net`
1717

18-
The `DockerFile` in this folder sets up this repos inside a docker container ready to run our build.
18+
The `DockerFile` in this folder sets up this repo inside a docker container ready to run our build.
1919

2020
The `rest-api-spec` runner expects Elasticsearch to be started before invocation and uses the endpoint its passed to discover the current Elasticsearch
2121
`build hash` that is running and downloads the tests matching that `build hash`.
2222

23-
If you want to run the tests the same that the Jenkins instance on elastic.co does you can call
23+
If you want to run the tests the same way that the Jenkins instance on elastic.co does you can call
2424

2525
```bash
26-
$ ELASTICSEARCH_VERSION=8.0.0-SNAPSHOT ./.ci/run-tests
26+
$ STACK_VERSION=7.x-SNAPSHOT ELASTICSEARCH_VERSION=7.x-SNAPSHOT ./.ci/run-tests
2727
```
2828

2929
| Variable Name | Default | Description |
3030
|-------------------------|-------------|-------------|
31-
| `ELASTICSEARCH_VERSION` | `N/A` | The elasticsearch version to target
32-
| `TEST_SUITE` | `oss` | `oss` or `xpack` sets which test suite to run and which container to run against. |
31+
| `STACK_VERSION` | `N/A` | The elasticsearch version to target
32+
| `TEST_SUITE` | `basic` | `free` or `platinum` sets which test suite to run and which container to run against. |
3333
| `DOTNET_VERSION` | `5.0.100` | The .NET sdk version used to grab the proper container |
3434

3535

36-
If you want to manually spin up elasticsearch for this tests and call the runner afterwards you can use
36+
If you want to manually spin up elasticsearch for these tests and call the runner afterwards you can use
3737

3838
```bash
39-
$ ELASTICSEARCH_VERSION=elasticsearch-oss:8.0.0-SNAPSHOT DETACH=true bash .ci/run-elasticsearch.sh
39+
$ STACK_VERSION=7.x-SNAPSHOT DETACH=true bash .ci/run-elasticsearch.sh
4040
```
4141

42-
Note that `ELASTICSEARCH_VERSION` here is the full docker reference, `.ci/run-tests` is smart enough to compose this based on `TEST_SUITE`
42+
Note that `STACK_VERSION` here is the full docker reference, `.ci/run-tests` is smart enough to compose this based on `TEST_SUITE`
4343

4444
Spinning down the cluster can be done by passing `CLEANUP=true` using the same args
4545

4646
```bash
47-
$ ELASTICSEARCH_VERSION=elasticsearch-oss:8.0.0-SNAPSHOT CLEANUP=true bash .ci/run-elasticsearch.sh
47+
$ STACK_VERSION=7.x-SNAPSHOT CLEANUP=true bash .ci/run-elasticsearch.sh
4848
```
4949

5050
To kick off the `rest-api-spec` tests manually after starting the cluster manually:
@@ -62,6 +62,5 @@ $ ./build.sh rest-spec-tests -f --help
6262
Against in most cases running through `./ci/run-tests` is all you need:
6363

6464
```bash
65-
$ ELASTICSEARCH_VERSION=8.0.0-SNAPSHOT ./.ci/run-tests
66-
```
67-
65+
$ STACK_VERSION=7.x-SNAPSHOT ./.ci/run-tests
66+
```

.ci/run-elasticsearch.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ $volumes = @(
166166
"--volume", "${volume_name}:/usr/share/elasticsearch/data"
167167
)
168168

169-
if (-not $env:ELASTICSEARCH_VERSION -contains "oss") {
169+
if (-not $env:ELASTICSEARCH_VERSION -contains "free") {
170170
$environment += @(
171171
"--env", "ELASTIC_PASSWORD=`"$ELASTIC_PASSWORD`"",
172172
"--env", "xpack.license.self_generated.type=trial",
@@ -190,7 +190,7 @@ if (-not $env:ELASTICSEARCH_VERSION -contains "oss") {
190190
}
191191

192192
$url="http://$NODE_NAME"
193-
if (-not $env:ELASTICSEARCH_VERSION -contains "oss") {
193+
if (-not $env:ELASTICSEARCH_VERSION -contains "free") {
194194
$url="https://elastic:$ELASTIC_PASSWORD@$NODE_NAME"
195195
}
196196

.ci/run-elasticsearch.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# to form a cluster suitable for running the REST API tests.
55
#
66
# Export the STACK_VERSION variable, eg. '8.0.0-SNAPSHOT'.
7-
# Export the TEST_SUITE variable, eg. 'oss' or 'xpack' defaults to 'oss'.
7+
# Export the TEST_SUITE variable, eg. 'free' or 'platinum' defaults to 'free'.
88
# Export the NUMBER_OF_NODES variable to start more than 1 node
99

1010
# Version 1.1.0
@@ -38,7 +38,7 @@ environment=($(cat <<-END
3838
--env repositories.url.allowed_urls=http://snapshot.test*
3939
END
4040
))
41-
if [[ "$TEST_SUITE" == "xpack" ]]; then
41+
if [[ "$TEST_SUITE" == "platinum" ]]; then
4242
environment+=($(cat <<-END
4343
--env ELASTIC_PASSWORD=$elastic_password
4444
--env xpack.license.self_generated.type=trial
@@ -63,7 +63,7 @@ END
6363
fi
6464

6565
cert_validation_flags=""
66-
if [[ "$TEST_SUITE" == "xpack" ]]; then
66+
if [[ "$TEST_SUITE" == "platinum" ]]; then
6767
cert_validation_flags="--insecure --cacert /usr/share/elasticsearch/config/certs/ca.crt --resolve ${es_node_name}:443:127.0.0.1"
6868
fi
6969

.ci/run-repository.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# parameters are available to this script
33

44
# STACK_VERSION -- version e.g Major.Minor.Patch(-Prelease)
5-
# TEST_SUITE -- which test suite to run: oss or xpack
5+
# TEST_SUITE -- which test suite to run: free or platinum
66
# ELASTICSEARCH_URL -- The url at which elasticsearch is reachable, a default is composed based on STACK_VERSION and TEST_SUITE
77
# DOTNET_VERSION -- SDK version (defined in test-matrix.yml, a default is hardcoded here)
88
script_path=$(dirname $(realpath -s $0))

.ci/run-tests.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ param (
44
$ELASTICSEARCH_VERSION,
55

66
[string]
7-
[ValidateSet("oss", "xpack")]
8-
$TEST_SUITE = "oss",
7+
[ValidateSet("free", "platinum")]
8+
$TEST_SUITE = "free",
99

1010
[string]
1111
$DOTNET_VERSION = "5.0.100"
@@ -16,8 +16,7 @@ $NODE_NAME = "es1"
1616
$elasticsearch_image= "elasticsearch"
1717
$elasticsearch_url = "https://elastic:changeme@${NODE_NAME}:9200"
1818

19-
if ($TEST_SUITE -ne "xpack") {
20-
$elasticsearch_image= "elasticsearch-${TEST_SUITE}"
19+
if ($TEST_SUITE -ne "platinum") {
2120
$elasticsearch_url = "http://${NODE_NAME}:9200"
2221
}
2322

.ci/test-matrix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ STACK_VERSION:
44
- 7.x-SNAPSHOT
55

66
TEST_SUITE:
7-
- oss
8-
- xpack
7+
- free
8+
- platinum
99

1010
DOTNET_VERSION:
1111
- 5.0.100

0 commit comments

Comments
 (0)