bugsnag-maze-runner 9.10.0 → 9.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f31a10f7c03fd26a7adb3b26696fde6fb12aefccab2f115e61cd8ec2e3fef0a
4
- data.tar.gz: 8933cafd8a45b449ff30da1f11b8df3855b881187e3cd84e42aa56713be6ad0b
3
+ metadata.gz: 4b0f13e3bc3237d32a7bf41c6807e043b154a71b8f1832fe8c1b69290dd8b075
4
+ data.tar.gz: 65661961ef9e706583a283807c144fed3f4e011741819d413793237c277fcb48
5
5
  SHA512:
6
- metadata.gz: 4f881d7fdcc3cf4644224405ab72480ec3db8ffa7fe252ca9aef145769bf0e7e3dd48b62b20226a144c87db9a7affad66945d451ea936fe92a7e108cd9bf3a40
7
- data.tar.gz: 8778dcf0f07489e3be5a744e7279013fd8a50b72fff6f1ce7d80d447b0dbd03fd2ff16a36032e526430392bd7ab6a05e0ea6110789277054242c5d14a6046439
6
+ metadata.gz: a051cc35b09023db1afc3ca5b1d8c7db49ff254c5292c13731afc999b498cdfcbe8038814260b7a402b0623b07182ed3601bcd1eca4d4f83b956c31660cbdd15
7
+ data.tar.gz: 1b5d887497d813b64e7e2427247b8117ace37a8db1c17338a131a3c2383ad22b8d64bdcb593b73931f384b42e0d514a4ec3dfeed80933630bafa2cd02caca044
@@ -96,6 +96,10 @@ Then('the trace payload field {string} boolean attribute {string} is false') do
96
96
  assert_attribute field, key, { 'boolValue' => false }
97
97
  end
98
98
 
99
+ Then('the trace payload field {string} double attribute {string} equals {float}') do |field, attribute, expected|
100
+ check_attribute_equal field, attribute, 'doubleValue', expected
101
+ end
102
+
99
103
  # @!group Span steps
100
104
  Then('a span {word} equals {string}') do |attribute, expected|
101
105
  spans = spans_from_request_list(Maze::Server.list_for('traces'))
@@ -259,8 +263,10 @@ def attribute_value_matches?(attribute_value, expected_type, expected_value)
259
263
  expected_value.to_f.eql?(attribute_value[expected_type])
260
264
  when 'boolValue'
261
265
  expected_value.eql?('true').eql?(attribute_value[expected_type])
262
- when 'arrayValue', 'kvlistValue'
263
- $logger.error('Span attribute validation does not currently support the "arrayValue" or "kvlistValue" types')
266
+ when 'arrayValue'
267
+ expected_value == attribute_value[expected_type]['values']
268
+ when 'kvlistValue'
269
+ $logger.error('Span attribute validation does not currently support the "kvlistValue" type')
264
270
  false
265
271
  else
266
272
  $logger.error("An invalid attribute type was expected: '#{expected_type}'")
@@ -323,3 +329,46 @@ def assert_attribute(field, key, expected)
323
329
  attributes = Maze::Helper.read_key_path(list.current[:body], "#{field}.attributes")
324
330
  Maze.check.equal({ 'key' => key, 'value' => expected }, attributes.find { |a| a['key'] == key })
325
331
  end
332
+
333
+ def check_array_attribute_equal(field, attribute, expected_values)
334
+ actual_values = get_attribute_value(field, attribute, 'arrayValue')['values']
335
+
336
+ # Convert string representations of integers to integers for comparison
337
+ actual_values.map! do |value|
338
+ if value.key?('intValue')
339
+ value['intValue'].to_i
340
+ else
341
+ value
342
+ end
343
+ end
344
+
345
+ expected_values.map! do |value|
346
+ if value.key?('intValue')
347
+ value['intValue'].to_i
348
+ else
349
+ value
350
+ end
351
+ end
352
+
353
+ Maze.check.equal(expected_values, actual_values)
354
+ end
355
+
356
+ Then('the trace payload field {string} string array attribute {string} equals the array:') do |field, attribute, expected_values|
357
+ expected_values_list = expected_values.raw.flatten.map { |v| { 'stringValue' => v } }
358
+ check_array_attribute_equal field, attribute, expected_values_list
359
+ end
360
+
361
+ Then('the trace payload field {string} integer array attribute {string} equals the array:') do |field, attribute, expected_values|
362
+ expected_values_list = expected_values.raw.flatten.map { |v| { 'intValue' => v.to_i } }
363
+ check_array_attribute_equal(field, attribute, expected_values_list)
364
+ end
365
+
366
+ Then('the trace payload field {string} double array attribute {string} equals the array:') do |field, attribute, expected_values|
367
+ expected_values_list = expected_values.raw.flatten.map { |v| { 'doubleValue' => v.to_f } }
368
+ check_array_attribute_equal field, attribute, expected_values_list
369
+ end
370
+
371
+ Then('the trace payload field {string} boolean array attribute {string} equals the array:') do |field, attribute, expected_values|
372
+ expected_values_list = expected_values.raw.flatten.map { |v| { 'boolValue' => v == 'true' } }
373
+ check_array_attribute_equal field, attribute, expected_values_list
374
+ end
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 = '9.10.0'
10
+ VERSION = '9.11.0'
11
11
 
12
12
  class << self
13
13
  attr_accessor :check, :driver, :internal_hooks, :mode, :start_time, :dynamic_retry, :public_address,
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: 9.10.0
4
+ version: 9.11.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: 2024-07-02 00:00:00.000000000 Z
11
+ date: 2024-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber