bugsnag-maze-runner 9.12.0 → 9.13.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: 325db4804e14fcf97c4cb8f53782676a597d29975d1ead996810979e94466207
4
- data.tar.gz: 9b63455da005c6e4a1db345c74301801538425573c1fc02737034b0717a81e46
3
+ metadata.gz: 0faaa4d935a7db46b9c6bd717fb7a5679e30c4add8e9a8010ae33708ee9a9cca
4
+ data.tar.gz: afee3aba6ca6e9e6a917bd8c243c4e118426bfa568aa5f97d9b8d2f175c2568c
5
5
  SHA512:
6
- metadata.gz: f7b981946519533317ff0f07782d12cc78cadda9e0f82227a6d7b7bc1d8ed4f0b52009040eab4fb5c399862e0b652583652f25e9921389fa64d996ea886d3c59
7
- data.tar.gz: 9e0ee212669d3dbc3d78ef6ee29dd0843a6b0d0ee6ecb9282ed53761c5b6da180be2fe8fc7590db8d6012d2543c121c9cf9f27f3c631cfffc4fa85c5c3ba42e6
6
+ metadata.gz: 680e8b3f617e71d67fd3a8cf5fa24303cbbfcb0ea853b63bb306d133a3c7bdcc323da256892b5dcd8367d8440f4000d393e74353591831ab26b3c3f565c2e265
7
+ data.tar.gz: 827d8aa95c7dc4b18ef253ae96e24e3ad7f3b0e61c0175474c86c35fa60ba9d47872e19fecfbb8167259c5b874349e5c1f470bd2c14e7aeebb0ac08e973153c0
@@ -1,5 +1,11 @@
1
1
  # @!group Trace steps
2
2
 
3
+ # Disable timestamp validation for spans
4
+ #
5
+ When('I disable timestamp validation for spans') do
6
+ Maze.config.span_timestamp_validation = false
7
+ end
8
+
3
9
  # Waits for a given number of spans to be received, which may be spread across one or more trace requests.
4
10
  #
5
11
  # @step_input span_count [Integer] The number of spans to wait for
@@ -29,6 +35,10 @@ Then('I should have received no spans') do
29
35
  Maze.check.equal spans_from_request_list(Maze::Server.list_for('traces')).size, 0
30
36
  end
31
37
 
38
+ Then('I enter unmanaged traces mode') do
39
+ Maze.config.unmanaged_traces_mode = true
40
+ end
41
+
32
42
  Then('the trace payload field {string} bool attribute {string} is true') do |field, attribute|
33
43
  check_attribute_equal field, attribute, 'boolValue', true
34
44
  end
@@ -111,6 +111,9 @@ Before do |scenario|
111
111
  $stdout.puts "--- Scenario: #{scenario.name} #{location}"
112
112
  end
113
113
 
114
+ # Reset configuration values to their defaults
115
+ Maze.config.unmanaged_traces_mode = false
116
+
114
117
  # Invoke the internal hook for the mode of operation
115
118
  Maze.internal_hooks.before scenario
116
119
 
@@ -119,6 +122,8 @@ Before do |scenario|
119
122
 
120
123
  # Invoke the logger hook for the scenario
121
124
  Maze::Hooks::LoggerHooks.before scenario
125
+
126
+ Maze.config.span_timestamp_validation = true
122
127
  end
123
128
 
124
129
  # General processing to be run after each scenario
@@ -242,7 +247,7 @@ AfterAll do
242
247
  # create a zip file from the maze_output directory
243
248
  maze_output = File.join(Dir.pwd, 'maze_output')
244
249
  maze_output_zip = File.join(Dir.pwd, 'maze_output.zip')
245
-
250
+
246
251
  # zip a folder with files and subfolders
247
252
  Zip::File.open(maze_output_zip, Zip::File::CREATE) do |zipfile|
248
253
  Dir["#{maze_output}/**/**"].each do |file|
@@ -12,6 +12,8 @@ module Maze
12
12
  self.enforce_bugsnag_integrity = true
13
13
  self.captured_invalid_requests = Set[:errors, :sessions, :builds, :uploads, :sourcemaps]
14
14
  self.android_app_files_directory = nil
15
+ self.span_timestamp_validation = true
16
+ self.unmanaged_traces_mode = false
15
17
  @legacy_driver = false
16
18
  end
17
19
 
@@ -75,6 +77,12 @@ module Maze
75
77
  # Enables awareness of a public IP address on Buildkite with the Elastic CI Stack for AWS.
76
78
  attr_accessor :aws_public_ip
77
79
 
80
+ # Whether timestamp validation should be performed on spans
81
+ attr_accessor :span_timestamp_validation
82
+
83
+ # Enables unmanaged trace mode.
84
+ attr_accessor :unmanaged_traces_mode
85
+
78
86
  #
79
87
  # General appium configuration
80
88
  #
@@ -53,6 +53,7 @@ module Maze
53
53
  end
54
54
 
55
55
  def validate_timestamp(path, tolerance)
56
+ return unless Maze.config.span_timestamp_validation
56
57
  timestamp = Maze::Helper.read_key_path(@body, path)
57
58
  unless timestamp.kind_of?(String)
58
59
  @success = false
@@ -104,12 +105,14 @@ module Maze
104
105
 
105
106
  # Bugsnag-Span-Sampling
106
107
  # of the format x:y where x is a decimal between 0 and 1 (inclusive) and y is the number of spans in the batch (if possible at this stage - we could weaken this if necessary)
107
- validate_header('bugsnag-span-sampling') do |sampling|
108
- begin
109
- expected = Regexp.new(SAMPLING_HEADER)
110
- unless expected.match(sampling)
111
- @success = false
112
- @errors << "bugsnag-span-sampling header was expected to match the regex '#{SAMPLING_HEADER}', but was '#{sampling}'"
108
+ unless Maze.config.unmanaged_traces_mode
109
+ validate_header('bugsnag-span-sampling') do |sampling|
110
+ begin
111
+ expected = Regexp.new(SAMPLING_HEADER)
112
+ unless expected.match(sampling)
113
+ @success = false
114
+ @errors << "bugsnag-span-sampling header was expected to match the regex '#{SAMPLING_HEADER}', but was '#{sampling}'"
115
+ end
113
116
  end
114
117
  end
115
118
  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.12.0'
10
+ VERSION = '9.13.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.12.0
4
+ version: 9.13.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-31 00:00:00.000000000 Z
11
+ date: 2024-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber