bugsnag-maze-runner 7.25.0 → 7.26.0

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: 02e955bef1519e412688dc3c061336307d211c724dedd39fce301e9e89113f6e
4
- data.tar.gz: c4643eab515e98e1acc179d9b5ddaf90c9d3bf937ace170860c52d7a9b1235f2
3
+ metadata.gz: 2740400fc6ee5bd904dc3a82f334967f6a154eb5bd99a343f324ef68da800461
4
+ data.tar.gz: '0787ae4e578768564cf8e377b4e3626afd8b8b637a26c9077401f2093e81747b'
5
5
  SHA512:
6
- metadata.gz: 6ce234fcc1913ba4b2b87cbe13e30ce02c3e726e3ff38f0b466282c8bb7f6236202186a224f92b6e9582715fb2eba3b3db19723e19227ae8249b72abbcd35a49
7
- data.tar.gz: 25fdf555f609bc45b19c09e53ffe23f2929ad0cddf7fc3c7d32891ebaf72a71c4426e932c7fe22151169dd60a1e177b86dafccf3b1f1e6aa218945b5354f0d30
6
+ metadata.gz: fc58669b1cc0d59f7b1a3762e34ac489f174e997a2fa313dd50f7b18c6f863bdab8550090019a007f96c23e908cb9a2d9417f7142afb45cc8f9f52e79cd755d8
7
+ data.tar.gz: 0c8d117361004c964f759459e2f3433701277633b518bb7afca0a831bdc40cc86a3127eec04fbfcfab4136d05e700ab1231084dee0316508b25330cfa5f9c111
@@ -132,14 +132,15 @@ end
132
132
 
133
133
  Then('a span string attribute {string} exists') do |attribute|
134
134
  spans = spans_from_request_list(Maze::Server.list_for('traces'))
135
- selected_attributes = spans.map { |span| span['attributes'].find { |a| a['key'] == attribute }['value']['stringValue'] }
135
+ selected_attributes = spans.map { |span| span['attributes'].find { |a| a['key'].eql?(attribute) && a['value'].has_key?('stringValue') } }.compact
136
136
  Maze.check.false(selected_attributes.empty?)
137
137
  end
138
138
 
139
139
  Then('a span string attribute {string} equals {string}') do |attribute, expected|
140
140
  spans = spans_from_request_list(Maze::Server.list_for('traces'))
141
- selected_attributes = spans.map { |span| span['attributes'].find { |a| a['key'] == attribute }['value']['stringValue'] }
142
- Maze.check.includes selected_attributes, expected
141
+ selected_attributes = spans.map { |span| span['attributes'].find { |a| a['key'].eql?(attribute) && a['value'].has_key?('stringValue') } }.compact
142
+ attribute_values = selected_attributes.map { |a| a['value']['stringValue'] }
143
+ Maze.check.includes attribute_values, expected
143
144
  end
144
145
 
145
146
  Then('a span field {string} equals {string}') do |key, expected|
@@ -186,6 +187,22 @@ Then('a span named {string} contains the attributes:') do |span_name, table|
186
187
  end
187
188
  end
188
189
 
190
+ Then('a span named {string} has a parent named {string}') do |child_name, parent_name|
191
+ spans = spans_from_request_list(Maze::Server.list_for('traces'))
192
+ child_spans = spans.find_all { |span| span['name'].eql?(child_name) }
193
+ raise Test::Unit::AssertionFailedError.new "No spans were found with the name #{child_name}" if child_spans.empty?
194
+ parent_spans = spans.find_all { |span| span['name'].eql?(parent_name) }
195
+ raise Test::Unit::AssertionFailedError.new "No spans were found with the name #{parent_name}" if parent_spans.empty?
196
+
197
+ expected_parent_ids = child_spans.map { |span| span['parentSpanId'] }
198
+ parent_ids = parent_spans.map { |span| span['spanId'] }
199
+ match = expected_parent_ids.any? { |expected_id| parent_ids.include?(expected_id) }
200
+
201
+ unless match
202
+ raise Test::Unit::AssertionFailedError.new "No child span named #{child_name} was found with a parent named #{parent_name}"
203
+ end
204
+ end
205
+
189
206
  def spans_from_request_list list
190
207
  return list.remaining
191
208
  .flat_map { |req| req[:body]['resourceSpans'] }
data/lib/maze.rb CHANGED
@@ -7,7 +7,7 @@ require_relative 'maze/timers'
7
7
  # Glues the various parts of MazeRunner together that need to be accessed globally,
8
8
  # providing an alternative to the proliferation of global variables or singletons.
9
9
  module Maze
10
- VERSION = '7.25.0'
10
+ VERSION = '7.26.0'
11
11
 
12
12
  class << self
13
13
  attr_accessor :check, :driver, :internal_hooks, :mode, :start_time, :dynamic_retry, :public_address, :run_uuid
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bugsnag-maze-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.25.0
4
+ version: 7.26.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Kirkland
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-05 00:00:00.000000000 Z
11
+ date: 2023-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber