elasticsearch-test-runner 0.4.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -1
- data/lib/elasticsearch/tests/code_runner.rb +9 -3
- data/lib/elasticsearch/tests/printer.rb +2 -1
- data/lib/elasticsearch/tests/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee56a5237bb5f84f1736eadf3d0bc16368cccd7889bbaf2a5a9f39f4c252e821
|
4
|
+
data.tar.gz: 102d52581d5663b0848d3b2a794b12c20bc11f195a79f2cb8ac57c94e1b818c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0bdd05bd218933af4dc65c51917829bc68f07e312c959fbce1b0efbf6446444af48fd1ae72620a98cd9ce8836a5454807a988f007de0ccd7201a13f3868de9e
|
7
|
+
data.tar.gz: 1cfb660fe7e81c143e42e6aaf886b4f2b3d5f33dbee48a78234f27518725bfacf52af1ca5a27d6f65521de9a8139e18fbe6926c6fdc93c13fb54eaebd182009a
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,14 @@
|
|
1
|
-
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## [0.6.0] - 2024-08-07
|
4
|
+
|
5
|
+
- Adds `header` support, headers can be specified for an action.
|
6
|
+
- Show response in errors.
|
7
|
+
|
8
|
+
## [0.5.0] - 2024-07-30
|
9
|
+
|
10
|
+
- Clears `@response` before running a new action
|
11
|
+
- Fixes `expected_exception?` for failures
|
2
12
|
|
3
13
|
## [0.4.0] - 2024-07-08
|
4
14
|
|
@@ -35,8 +35,15 @@ module Elasticsearch
|
|
35
35
|
# specifications. These are function calls to the Elasticsearch clients.
|
36
36
|
#
|
37
37
|
def do_action(action)
|
38
|
+
@response = nil
|
38
39
|
catchable = action.delete('catch')
|
39
40
|
client = @client
|
41
|
+
if action['headers']
|
42
|
+
client.transport.options[:transport_options][:headers].merge(
|
43
|
+
{ headers: action.delete('headers') }
|
44
|
+
)
|
45
|
+
end
|
46
|
+
|
40
47
|
action = action.first if action.is_a?(Array)
|
41
48
|
method, params = action.is_a?(String) ? [action, {}] : action.first
|
42
49
|
|
@@ -46,17 +53,16 @@ module Elasticsearch
|
|
46
53
|
client = @client.send(arrayed_method.first)
|
47
54
|
method = arrayed_method.last
|
48
55
|
end
|
49
|
-
|
50
56
|
@response = client.send(method.to_sym, process_params(params))
|
51
57
|
puts @response if ENV['DEBUG']
|
52
58
|
@response
|
53
59
|
rescue StandardError => e
|
54
60
|
raise e unless expected_exception?(catchable, e)
|
55
|
-
|
56
|
-
@response
|
57
61
|
end
|
58
62
|
|
59
63
|
def expected_exception?(error_type, e)
|
64
|
+
return false if error_type.nil?
|
65
|
+
|
60
66
|
case error_type
|
61
67
|
when 'request_timeout'
|
62
68
|
e.is_a?(Elastic::Transport::Transport::Errors::RequestTimeout)
|
@@ -29,7 +29,7 @@ module Elasticsearch
|
|
29
29
|
@response.status
|
30
30
|
end
|
31
31
|
if ENV['QUIET']
|
32
|
-
print
|
32
|
+
print '🟢 '
|
33
33
|
else
|
34
34
|
puts "🟢 #{@file} #{@title} passed. Response: #{response}"
|
35
35
|
end
|
@@ -57,6 +57,7 @@ module Elasticsearch
|
|
57
57
|
🔴 #{@file} #{@title} failed
|
58
58
|
Expected: { #{keys}: #{value} }
|
59
59
|
Actual : { #{keys}: #{search_in_response(action['match'].keys.first)} }
|
60
|
+
Response: #{@response}
|
60
61
|
MSG
|
61
62
|
raise Elasticsearch::Tests::TestFailure.new(message)
|
62
63
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elasticsearch-test-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic Client Library Maintainers
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07
|
11
|
+
date: 2024-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: elasticsearch
|
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
|
-
rubygems_version: 3.5.
|
87
|
+
rubygems_version: 3.5.11
|
88
88
|
signing_key:
|
89
89
|
specification_version: 4
|
90
90
|
summary: Tool to test Elasticsearch clients against the YAML clients test suite.
|