elasticsearch-test-runner 0.3.0 โ†’ 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 736ee5a6506aad22d554ba00880706b6641192297e69c42a815050e4e6d784fd
4
- data.tar.gz: 2faea7eacfc8c421675cbae4783fcce40866daf380a8d5fd417b297cd9de7e51
3
+ metadata.gz: 371dabd8cff033ef7d2656b874f4fcb5fd63f5bde3093d5ce1ee830e9e253187
4
+ data.tar.gz: 43006ff9d74aea61684af8abc8e660099c009a1e7293d489c5796887efb9756e
5
5
  SHA512:
6
- metadata.gz: '0529c7247fe886df1ac6f99f95b45f2fd576dce42bcc80e01d032d57e3adda91f0556da62000201fa447fe7895b7799844c4479077f7136df382bcabb69f5ab8'
7
- data.tar.gz: 90f5be281f003fb63ad11bb1180d47d5b3d50ab3db4914ff7652e2eb89cbfc828a78f2118ebf665e60e688f0e065011154b3bf7c4703b562d9f7a3f3256cc3e1
6
+ metadata.gz: b927b0015746d72b19d26ac3812243f4b91df653d785b924a58a8dd219608358ed1e3dbbf6b76af3ce240b4d3289371ded4615e38f8d891438b929311b9abe77
7
+ data.tar.gz: a5b2ef6724092c8d6d4a39893346d233ca2c170121d59778ef4f85fea66e339e4db33ccfe40deac23d1d9b4f55dc306ffaa7c4ad5ba4bee8288b53887870b3b6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.3.1] - 2024-06-27
4
+
5
+ - Fixes in error handling.
6
+
3
7
  ## [0.3.0] - 2024-06-27
4
8
 
5
9
  - Fixes exit code.
@@ -34,18 +34,21 @@ module Elasticsearch
34
34
  def print_failure(action, response)
35
35
  puts "๐Ÿ”ด #{@file} #{@title} failed"
36
36
  puts "Expected result: #{action}" # TODO: Show match/length differently
37
- if response.is_a?(ElasticsearchServerless::API::Response)
37
+ if defined?(ElasticsearchServerless) &&
38
+ response.is_a?(ElasticsearchServerless::API::Response) ||
39
+ defined?(Elasticsearch::API) && response.is_a?(Elasticsearch::API::Response)
38
40
  puts 'Response:'
39
41
  pp response.body
40
42
  else
41
43
  pp response
42
44
  end
43
- raise Elasticsearch::Tests::ActionError.new('ERROR', @file, action)
45
+ raise Elasticsearch::Tests::ActionError.new(response.body, @file, action)
44
46
  end
45
47
 
46
48
  def print_match_failure(action)
47
49
  keys = action['match'].keys.first
48
50
  value = action['match'].values.first
51
+
49
52
  message = <<~MSG
50
53
  ๐Ÿ”ด #{@file} #{@title} failed
51
54
  Expected: { #{keys}: #{value} }
@@ -66,7 +69,7 @@ module Elasticsearch
66
69
  puts "+++ โŒ Errors/Failures: #{errors.count}"
67
70
  errors.map do |error|
68
71
  puts "๐Ÿงช Test: #{error[:file]}"
69
- puts "โ–ถ Action: #{error[:action]['do']}" if error[:action]
72
+ puts "โ–ถ Action: #{error[:action].first}" if error[:action]
70
73
  puts "๐Ÿ”ฌ #{error[:error].message}"
71
74
  pp error[:error].backtrace.join("$/\n") if ENV['DEBUG']
72
75
  puts
@@ -19,6 +19,6 @@
19
19
 
20
20
  module Elasticsearch
21
21
  module Tests
22
- VERSION = '0.3.0'
22
+ VERSION = '0.3.1'
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch-test-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic Client Library Maintainers