File tree Expand file tree Collapse file tree 3 files changed +11
-10
lines changed
elasticsearch-api/spec/elasticsearch/api
elasticsearch-xpack/spec/xpack Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ class TestFile
39
39
# TestFile.new(file_name)
40
40
#
41
41
# @param [ String ] file_name The name of the test file.
42
+ # @param [ Client] An instance of the client
42
43
# @param [ Array<Symbol> ] skip_features The names of features to skip.
43
44
#
44
45
# @since 6.1.0
@@ -105,14 +106,14 @@ def tests
105
106
# Run the setup tasks defined for a single test file.
106
107
#
107
108
# @example Run the setup tasks.
108
- # test_file.setup(client)
109
+ # test_file.setup
109
110
#
110
111
# @param [ Elasticsearch::Client ] client The client to use to perform the setup tasks.
111
112
#
112
113
# @return [ self ]
113
114
#
114
115
# @since 6.2.0
115
- def setup ( client )
116
+ def setup
116
117
return unless @setup
117
118
118
119
actions = @setup [ 'setup' ] . select { |action | action [ 'do' ] } . map { |action | Action . new ( action [ 'do' ] ) }
@@ -147,14 +148,14 @@ def setup(client)
147
148
# Run the teardown tasks defined for a single test file.
148
149
#
149
150
# @example Run the teardown tasks.
150
- # test_file.teardown(client)
151
+ # test_file.teardown
151
152
#
152
153
# @param [ Elasticsearch::Client ] client The client to use to perform the teardown tasks.
153
154
#
154
155
# @return [ self ]
155
156
#
156
157
# @since 6.2.0
157
- def teardown ( client )
158
+ def teardown
158
159
return unless @teardown
159
160
160
161
actions = @teardown [ 'teardown' ] . select { |action | action [ 'do' ] } . map { |action | Action . new ( action [ 'do' ] ) }
Original file line number Diff line number Diff line change 9
9
# Traverse YAML files and create TestFile object:
10
10
REST_API_YAML_FILES . each do |file |
11
11
begin
12
- test_file = Elasticsearch ::RestAPIYAMLTests ::TestFile . new ( file , REST_API_YAML_SKIP_FEATURES )
12
+ test_file = Elasticsearch ::RestAPIYAMLTests ::TestFile . new ( file , ADMIN_CLIENT , REST_API_YAML_SKIP_FEATURES )
13
13
rescue SkipTestsException => _e
14
14
# If the test file has a `skip` at the top level that applies to this
15
15
# version of Elasticsearch, continue with the next text.
29
29
# Runs once before each test in a test file
30
30
before ( :all ) do
31
31
Elasticsearch ::RestAPIYAMLTests ::TestFile . wipe_cluster ( ADMIN_CLIENT )
32
- test_file . setup ( ADMIN_CLIENT )
32
+ test_file . setup
33
33
end
34
34
35
35
after ( :all ) do
36
- test_file . teardown ( ADMIN_CLIENT )
36
+ test_file . teardown
37
37
Elasticsearch ::RestAPIYAMLTests ::TestFile . wipe_cluster ( ADMIN_CLIENT )
38
38
end
39
39
Original file line number Diff line number Diff line change 21
21
describe 'XPack Rest API YAML tests' do
22
22
REST_API_YAML_FILES . each do |file |
23
23
begin
24
- test_file = Elasticsearch ::RestAPIYAMLTests ::TestFile . new ( file , DEFAULT_CLIENT , REST_API_YAML_SKIP_FEATURES )
24
+ test_file = Elasticsearch ::RestAPIYAMLTests ::TestFile . new ( file , ADMIN_CLIENT , REST_API_YAML_SKIP_FEATURES )
25
25
rescue SkipTestsException => _e
26
26
# If the test file has a `skip` at the top level that applies to this
27
27
# version of Elasticsearch, continue with the next text.
55
55
ADMIN_CLIENT . cluster . put_settings ( body : { transient : { "xpack.ml.max_model_memory_limit" => nil } } )
56
56
ADMIN_CLIENT . cluster . put_settings ( body : { persistent : { "xpack.ml.max_model_memory_limit" => nil } } )
57
57
Elasticsearch ::RestAPIYAMLTests ::TestFile . wipe_cluster ( ADMIN_CLIENT )
58
- test_file . setup ( ADMIN_CLIENT )
58
+ test_file . setup
59
59
end
60
60
61
61
after ( :all ) do
62
- test_file . teardown ( ADMIN_CLIENT )
62
+ test_file . teardown
63
63
end
64
64
65
65
test . task_groups . each do |task_group |
You can’t perform that action at this time.
0 commit comments