Skip to content

Commit 90af065

Browse files
committed
[API] Test Runner: Adds config for running tests in 8.0.0
1 parent a033fc3 commit 90af065

File tree

2 files changed

+36
-7
lines changed

2 files changed

+36
-7
lines changed

.ci/run-repository.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ if [[ $STACK_VERSION == "8.0.0-SNAPSHOT" ]]; then
4343
--env ELASTIC_API_VERSIONING=true
4444
--env ELASTIC_PASSWORD=${elastic_password}
4545
--env ELASTIC_USER=elastic
46+
--env QUIET=false
4647
--env STACK_VERSION=${STACK_VERSION}
4748
EOF
4849
))
@@ -55,7 +56,7 @@ if [[ $TEST_SUITE != "platinum" ]]; then
5556
--network="${network_name}" \
5657
--env "TEST_ES_SERVER=${elasticsearch_url}" \
5758
--env "TEST_SUITE=${TEST_SUITE}" \
58-
"${environment[@]}" \
59+
"${environment[@]:-}" \
5960
--volume $repo:/usr/src/app \
6061
--volume=/tmp:/tmp \
6162
--name elasticsearch-ruby \

elasticsearch-api/spec/rest_yaml_tests_helper.rb

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,42 @@
3737
if defined?(TEST_HOST) && defined?(TEST_PORT)
3838
URL = "http://#{TEST_HOST}:#{TEST_PORT}"
3939

40-
ADMIN_CLIENT = Elasticsearch::Client.new(host: URL, transport_options: TRANSPORT_OPTIONS)
40+
if ENV['STACK_VERSION'] == '8.0.0-SNAPSHOT'
41+
user = 'elastic'.freeze
42+
password = 'changeme'.freeze
43+
ADMIN_CLIENT = Elasticsearch::Client.new(
44+
host: URL,
45+
transport_options: TRANSPORT_OPTIONS,
46+
user: user,
47+
password: password
48+
)
4149

42-
if ENV['QUIET'] == 'true'
43-
DEFAULT_CLIENT = Elasticsearch::Client.new(host: URL, transport_options: TRANSPORT_OPTIONS)
50+
if ENV['QUIET'] == 'true'
51+
DEFAULT_CLIENT = Elasticsearch::Client.new(
52+
host: URL,
53+
transport_options: TRANSPORT_OPTIONS,
54+
user: user,
55+
password: password
56+
)
57+
else
58+
DEFAULT_CLIENT = Elasticsearch::Client.new(
59+
host: URL,
60+
transport_options: TRANSPORT_OPTIONS,
61+
user: user,
62+
password: password,
63+
tracer: Logger.new($stdout)
64+
)
65+
end
4466
else
45-
DEFAULT_CLIENT = Elasticsearch::Client.new(host: URL,
46-
transport_options: TRANSPORT_OPTIONS,
47-
tracer: Logger.new($stdout))
67+
ADMIN_CLIENT = Elasticsearch::Client.new(host: URL, transport_options: TRANSPORT_OPTIONS)
68+
69+
if ENV['QUIET'] == 'true'
70+
DEFAULT_CLIENT = Elasticsearch::Client.new(host: URL, transport_options: TRANSPORT_OPTIONS)
71+
else
72+
DEFAULT_CLIENT = Elasticsearch::Client.new(host: URL,
73+
transport_options: TRANSPORT_OPTIONS,
74+
tracer: Logger.new($stdout))
75+
end
4876
end
4977
end
5078

0 commit comments

Comments
 (0)