bugsnag-maze-runner 7.25.0 → 7.26.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: 02e955bef1519e412688dc3c061336307d211c724dedd39fce301e9e89113f6e
4
- data.tar.gz: c4643eab515e98e1acc179d9b5ddaf90c9d3bf937ace170860c52d7a9b1235f2
3
+ metadata.gz: 73f329df5934008d114f663a224e93592bc7d785024e20d0b015771abc1ca027
4
+ data.tar.gz: c566d0a2aaccaf1bfe36107290ffd8519d777a7c9e5dbe77769a1674dd751e6e
5
5
  SHA512:
6
- metadata.gz: 6ce234fcc1913ba4b2b87cbe13e30ce02c3e726e3ff38f0b466282c8bb7f6236202186a224f92b6e9582715fb2eba3b3db19723e19227ae8249b72abbcd35a49
7
- data.tar.gz: 25fdf555f609bc45b19c09e53ffe23f2929ad0cddf7fc3c7d32891ebaf72a71c4426e932c7fe22151169dd60a1e177b86dafccf3b1f1e6aa218945b5354f0d30
6
+ metadata.gz: e8fadbe837d32d0f8804c168eadf175aa6b0e1a3448d3072243ff25f8b0c64933a1b00edacf24c22de9bf4aa607e328cfa0351d94010c1a688ca612d347c9411
7
+ data.tar.gz: e7eb8c09b447af8b4b473a28b80b023a70dcf31100ea1d9fb0677f9c52a4322156f289eb102751be282cbdac47b451a7ba63490595fd98fe30bad3c8fa6e5170
data/bin/upload-app CHANGED
@@ -59,9 +59,8 @@ class UploadAppEntry
59
59
  end
60
60
 
61
61
  if options[:access_key].nil?
62
- $logger.warn 'An access_key is required to upload the app'
63
62
  Optimist::with_standard_exception_handling parser do
64
- raise Optimist::HelpNeeded
63
+ parser.die('An access_key is required to upload the app', 1)
65
64
  end
66
65
  end
67
66
 
@@ -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'] }
@@ -68,7 +68,9 @@ module Maze
68
68
  #
69
69
  # @returns
70
70
  def account_credentials(tms_uri)
71
- Maze::Wait.new(interval: 10, timeout: 1800).until do
71
+ interval_seconds = 10
72
+
73
+ credentials = Maze::Wait.new(interval: interval_seconds, timeout: 1800).until do
72
74
  output = request_account_index(tms_uri)
73
75
  case output.code
74
76
  when '200'
@@ -81,7 +83,7 @@ module Maze
81
83
  }
82
84
  when '409'
83
85
  # All accounts are in use, wait for one to become available
84
- $logger.info 'All accounts are currently in use, retrying in 30s'
86
+ $logger.info("All accounts are currently in use, retrying in #{interval_seconds}s")
85
87
  false
86
88
  else
87
89
  # Something has gone wrong, throw an error
@@ -89,6 +91,10 @@ module Maze
89
91
  raise
90
92
  end
91
93
  end
94
+
95
+ return credentials if credentials
96
+
97
+ raise "Could not fetch BitBar credentials in time"
92
98
  end
93
99
 
94
100
  # Makes the HTTP call to acquire an account id
@@ -7,6 +7,10 @@ module Maze
7
7
  Maze.driver.start_driver
8
8
  end
9
9
 
10
+ def log_run_outro
11
+ # Nothing to do
12
+ end
13
+
10
14
  def stop_session
11
15
  # No need to quit the local driver
12
16
  end
@@ -27,7 +27,7 @@ module Maze
27
27
 
28
28
  # Refreshes the page
29
29
  def refresh
30
- @driver.refresh
30
+ @driver.navigate.refresh
31
31
  end
32
32
 
33
33
  # Quits the driver
data/lib/maze/helper.rb CHANGED
@@ -83,7 +83,7 @@ module Maze
83
83
  return argument unless argument.start_with? '@'
84
84
 
85
85
  file = argument[1..argument.size]
86
- File.read file
86
+ (File.read file).strip
87
87
  end
88
88
 
89
89
  # Returns the current platform all lower-case.
@@ -108,7 +108,7 @@ module Maze
108
108
  errors << "Browser type '#{browser}' unknown on BitBar. Must be one of: #{browser_list}."
109
109
  end
110
110
  elsif device
111
- app = options[Option::APP]
111
+ app = Maze::Helper.read_at_arg_file options[Option::APP]
112
112
  if app.nil?
113
113
  errors << "--#{Option::APP} must be provided when running on a device"
114
114
  else
@@ -5,8 +5,11 @@ module Maze
5
5
  class TraceServlet < Servlet
6
6
  def set_response_header(header)
7
7
  super
8
+
8
9
  value = Maze::Server.sampling_probability
9
- header['Bugsnag-Sampling-Probability'] = value unless value == 'null'
10
+ header['Bugsnag-Sampling-Probability'] = value unless value == 'null'
11
+
12
+ header['Access-Control-Expose-Headers'] = 'Bugsnag-Sampling-Probability'
10
13
  end
11
14
  end
12
15
  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 = '7.25.0'
10
+ VERSION = '7.26.1'
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.1
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-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber