bugsnag-maze-runner 9.30.3 → 9.31.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: eac101685a879d5f91ca75921261853610439d75f5701de753495f33065ee9cd
4
- data.tar.gz: 90ea5298d3429a8594d61776822c52653044ffa0369bb242f25cd0d21e411b16
3
+ metadata.gz: 3862de8fe5b923c2c6a5700dc5cb7dede86ee14c4a3abef2e6a042155ef1747d
4
+ data.tar.gz: 5da6f8d5c3a3f9c49f272bb76a6ca094e52fc497e14344d5381a511edd0f4a81
5
5
  SHA512:
6
- metadata.gz: 3c7ab11c67be9bd62b95490b5d2052ff3c2eb5e9985ba2292505cd945eb7213647d89672f03dab2ed35bcd229a430dee1ea40a1750605e7d9ac2ac089aa8e5ff
7
- data.tar.gz: f90d269e02fa279de84b20ffa50c69b9d6acca7a717126ce611c9ef778075e5ebee3c87dcc8b12680c09ecfd91e6aaf09791bfd7fa5a14527a90027f9cf352df
6
+ metadata.gz: 6094a05aa2d778c5824d5807629b70d1de3560b9cbe8bafa057a8a1b1c6e85d4ac2bd3b1cce7dce54759b5b6759d6d4b42b076e7fe99cf31b82eb578d0dd6dac
7
+ data.tar.gz: 9c179f2dc2d11c75cba4ee772e23463143add3079f9a33a5433725ac5d6dd496ec85be8cf3766533056074b3c34be7da2bac23f2eecc63e27a0e3380d496108c
data/bin/maze-runner CHANGED
@@ -95,7 +95,6 @@ require_relative '../lib/maze/hooks/logger_hooks'
95
95
  require_relative '../lib/maze/driver/appium'
96
96
  require_relative '../lib/maze/driver/browser'
97
97
 
98
- require_relative '../lib/maze/plugins/bugsnag_reporting_plugin'
99
98
  require_relative '../lib/maze/plugins/error_code_plugin'
100
99
  require_relative '../lib/maze/plugins/global_retry_plugin'
101
100
  require_relative '../lib/maze/plugins/datadog_metrics_plugin'
@@ -131,6 +131,15 @@ Then('I discard the oldest {request_type}') do |request_type|
131
131
  Maze::Server.list_for(request_type).next
132
132
  end
133
133
 
134
+ # Moves to the end of the request list
135
+ #
136
+ # @step_input request_type [String] The type of request (error, session, build, etc)
137
+ Then('I discard all {request_type}') do |request_type|
138
+ raise "No #{request_type} to discard" if Maze::Server.list_for(request_type).current.nil?
139
+
140
+ Maze::Server.list_for(request_type).end
141
+ end
142
+
134
143
  Then('the received errors match:') do |table|
135
144
  # Checks that each request matches one of the event fields
136
145
  requests = Maze::Server.errors.remaining
@@ -93,9 +93,6 @@ InstallPlugin do |config|
93
93
 
94
94
  # Add step logging
95
95
  config.filters << Maze::Plugins::LoggingScenariosPlugin.new(config)
96
-
97
- # Add bugsnag failed scenario reporting only if ENV['MAZE_SCENARIO_BUGSNAG_API_KEY'] is present
98
- config.filters << Maze::Plugins::BugsnagReportingPlugin.new(config) unless ENV['MAZE_SCENARIO_BUGSNAG_API_KEY'].nil?
99
96
  end
100
97
 
101
98
  # Before each scenario
@@ -20,7 +20,7 @@ module Maze
20
20
  rescue Selenium::WebDriver::Error::ServerError, Selenium::WebDriver::Error::UnknownError => e
21
21
  $logger.error "Failed to activate app: #{e.message}"
22
22
  # Assume the remote appium session has stopped, so crash out of the session
23
- fail_driver(e.message)
23
+ fail_driver(e)
24
24
  raise e
25
25
  end
26
26
 
@@ -39,7 +39,7 @@ module Maze
39
39
  rescue Selenium::WebDriver::Error::ServerError, Selenium::WebDriver::Error::UnknownError => e
40
40
  $logger.error "Failed to terminate app: #{e.message}"
41
41
  # Assume the remote appium session has stopped, so crash out of the session
42
- fail_driver(e.message) if fail_driver
42
+ fail_driver(e) if fail_driver
43
43
  raise e
44
44
  end
45
45
 
@@ -57,7 +57,7 @@ module Maze
57
57
  rescue Selenium::WebDriver::Error::ServerError, Selenium::WebDriver::Error::UnknownError => e
58
58
  $logger.error "Failed to background app: #{e.message}"
59
59
  # Assume the remote appium session has stopped, so crash out of the session
60
- fail_driver(e.message)
60
+ fail_driver(e)
61
61
  raise e
62
62
  end
63
63
 
@@ -74,7 +74,7 @@ module Maze
74
74
  rescue Selenium::WebDriver::Error::ServerError, Selenium::WebDriver::Error::UnknownError => e
75
75
  $logger.error "Failed to launch app: #{e.message}"
76
76
  # Assume the remote appium session has stopped, so crash out of the session
77
- fail_driver(e.message)
77
+ fail_driver(e)
78
78
  raise e
79
79
  end
80
80
 
@@ -91,7 +91,7 @@ module Maze
91
91
  rescue Selenium::WebDriver::Error::ServerError, Selenium::WebDriver::Error::UnknownError => e
92
92
  $logger.error "Failed to close app: #{e.message}"
93
93
  # Assume the remote appium session has stopped, so crash out of the session
94
- fail_driver(e.message)
94
+ fail_driver(e)
95
95
  raise e
96
96
  end
97
97
 
@@ -107,7 +107,7 @@ module Maze
107
107
  rescue Selenium::WebDriver::Error::ServerError, Selenium::WebDriver::Error::UnknownError => e
108
108
  $logger.error "Failed to get app state: #{e.message}"
109
109
  # Assume the remote appium session has stopped, so crash out of the session
110
- fail_driver(e.message)
110
+ fail_driver(e)
111
111
  raise e
112
112
  end
113
113
  end
@@ -21,7 +21,7 @@ module Maze
21
21
  rescue Selenium::WebDriver::Error::ServerError => e
22
22
  $logger.error "Failed to unlock the device: #{e.message}"
23
23
  # Assume the remote appium session has stopped, so crash out of the session
24
- fail_driver(e.message)
24
+ fail_driver(e)
25
25
  raise e
26
26
  end
27
27
 
@@ -38,7 +38,7 @@ module Maze
38
38
  rescue Selenium::WebDriver::Error::ServerError => e
39
39
  $logger.error "Failed to press back: #{e.message}"
40
40
  # Assume the remote appium session has stopped, so crash out of the session
41
- fail_driver(e.message)
41
+ fail_driver(e)
42
42
  raise e
43
43
  end
44
44
 
@@ -56,7 +56,7 @@ module Maze
56
56
  rescue Selenium::WebDriver::Error::ServerError => e
57
57
  $logger.error "Failed to get logs: #{e.message}"
58
58
  # Assume the remote appium session has stopped, so crash out of the session
59
- fail_driver(e.message)
59
+ fail_driver(e)
60
60
  raise e
61
61
  end
62
62
 
@@ -74,7 +74,7 @@ module Maze
74
74
  rescue Selenium::WebDriver::Error::ServerError => e
75
75
  $logger.error "Failed to set the device rotation: #{e.message}"
76
76
  # Assume the remote appium session has stopped, so crash out of the session
77
- fail_driver(e.message)
77
+ fail_driver(e)
78
78
  raise e
79
79
  end
80
80
 
@@ -90,7 +90,7 @@ module Maze
90
90
  rescue Selenium::WebDriver::Error::ServerError => e
91
91
  $logger.error "Failed to get the device info: #{e.message}"
92
92
  # Assume the remote appium session has stopped, so crash out of the session
93
- fail_driver(e.message)
93
+ fail_driver(e)
94
94
  raise e
95
95
  end
96
96
  end
@@ -37,7 +37,7 @@ module Maze
37
37
  rescue Selenium::WebDriver::Error::ServerError => e
38
38
  $logger.error "Error writing file to device: #{e.message}"
39
39
  # Assume the remote appium session has stopped, so crash out of the session
40
- fail_driver(e.message)
40
+ fail_driver(e)
41
41
  raise e
42
42
  end
43
43
 
@@ -75,7 +75,7 @@ module Maze
75
75
  rescue Selenium::WebDriver::Error::ServerError => e
76
76
  $logger.error "Error reading file from device: #{e.message}"
77
77
  # Assume the remote appium session has stopped, so crash out of the session
78
- fail_driver(e.message)
78
+ fail_driver(e)
79
79
  raise e
80
80
  end
81
81
 
@@ -105,7 +105,7 @@ module Maze
105
105
  rescue Selenium::WebDriver::Error::ServerError => e
106
106
  $logger.error "Error reading folder from device: #{e.message}"
107
107
  # Assume the remote appium session has stopped, so crash out of the session
108
- fail_driver(e.message)
108
+ fail_driver(e)
109
109
  raise e
110
110
  end
111
111
  end
@@ -11,8 +11,9 @@ module Maze
11
11
  @driver.failed?
12
12
  end
13
13
 
14
- def fail_driver(message)
15
- @driver.fail_driver(message)
14
+ def fail_driver(exception)
15
+ Bugsnag.notify(exception)
16
+ @driver.fail_driver(exception.message)
16
17
  end
17
18
  end
18
19
  end
@@ -24,7 +24,7 @@ module Maze
24
24
  rescue Selenium::WebDriver::Error::ServerError => e
25
25
  $logger.error "Error waiting for element #{element_id}: #{e.message}"
26
26
  # Assume the remote appium session has stopped, so crash out of the session
27
- fail_driver(e.message)
27
+ fail_driver(e)
28
28
  raise e
29
29
  end
30
30
 
@@ -44,7 +44,7 @@ module Maze
44
44
  rescue Selenium::WebDriver::Error::ServerError => e
45
45
  $logger.error "Error clicking element #{element_id}: #{e.message}"
46
46
  # Assume the remote appium session has stopped, so crash out of the session
47
- fail_driver(e.message)
47
+ fail_driver(e)
48
48
  raise e
49
49
  end
50
50
 
@@ -63,7 +63,7 @@ module Maze
63
63
  rescue Selenium::WebDriver::Error::ServerError => e
64
64
  $logger.error "Error clicking element #{element_id}: #{e.message}"
65
65
  # Assume the remote appium session has stopped, so crash out of the session
66
- fail_driver(e.message)
66
+ fail_driver(e)
67
67
  raise e
68
68
  end
69
69
  end
@@ -101,7 +101,7 @@ module Maze
101
101
  end
102
102
  rescue Selenium::WebDriver::Error::ServerError => e
103
103
  # Assume the remote appium session has stopped, so crash out of the session
104
- fail_driver(e.message)
104
+ fail_driver(e)
105
105
  raise e
106
106
  else
107
107
  true
@@ -112,7 +112,7 @@ module Maze
112
112
  super
113
113
  rescue Selenium::WebDriver::Error::ServerError => e
114
114
  # Assume the remote appium session has stopped, so crash out of the session
115
- fail_driver(e.message)
115
+ fail_driver(e)
116
116
  raise e
117
117
  end
118
118
 
@@ -121,7 +121,7 @@ module Maze
121
121
  super
122
122
  rescue Selenium::WebDriver::Error::ServerError => e
123
123
  # Assume the remote appium session has stopped, so crash out of the session
124
- fail_driver(e.message)
124
+ fail_driver(e)
125
125
  raise e
126
126
  end
127
127
 
@@ -132,7 +132,7 @@ module Maze
132
132
  end
133
133
  rescue Selenium::WebDriver::Error::ServerError => e
134
134
  # Assume the remote appium session has stopped, so crash out of the session
135
- fail_driver(e.message)
135
+ fail_driver(e)
136
136
  raise e
137
137
  end
138
138
 
@@ -146,7 +146,7 @@ module Maze
146
146
  end
147
147
  rescue Selenium::WebDriver::Error::ServerError => e
148
148
  # Assume the remote appium session has stopped, so crash out of the session
149
- fail_driver(e.message)
149
+ fail_driver(e)
150
150
  raise e
151
151
  end
152
152
 
@@ -164,7 +164,7 @@ module Maze
164
164
  false
165
165
  rescue Selenium::WebDriver::Error::ServerError => e
166
166
  # Assume the remote appium session has stopped, so crash out of the session
167
- fail_driver(e.message)
167
+ fail_driver(e)
168
168
  raise e
169
169
  end
170
170
 
@@ -178,7 +178,7 @@ module Maze
178
178
  end
179
179
  rescue Selenium::WebDriver::Error::ServerError => e
180
180
  # Assume the remote appium session has stopped, so crash out of the session
181
- fail_driver(e.message)
181
+ fail_driver(e)
182
182
  raise e
183
183
  end
184
184
 
@@ -203,7 +203,7 @@ module Maze
203
203
  end
204
204
  rescue Selenium::WebDriver::Error::ServerError => e
205
205
  # Assume the remote appium session has stopped, so crash out of the session
206
- fail_driver(e.message)
206
+ fail_driver(e)
207
207
  raise e
208
208
  end
209
209
 
@@ -240,7 +240,7 @@ module Maze
240
240
  end
241
241
  rescue Selenium::WebDriver::Error::ServerError => e
242
242
  # Assume the remote appium session has stopped, so crash out of the session
243
- fail_driver(e.message)
243
+ fail_driver(e)
244
244
  raise e
245
245
  end
246
246
 
@@ -36,7 +36,6 @@ module Maze
36
36
  manager.terminate(!close_fallback)
37
37
  rescue Selenium::WebDriver::Error::UnknownError, Selenium::WebDriver::Error::InvalidSessionIdError => e
38
38
  if close_fallback
39
- Bugsnag.notify(e)
40
39
  $logger.warn 'terminate_app failed, using the slower but more forceful close_app instead'
41
40
  manager.close
42
41
  else
@@ -59,6 +59,12 @@ module Maze
59
59
  @count -= 1
60
60
  end
61
61
 
62
+ # Moves to the end of the list
63
+ def end
64
+ @current = @requests.size
65
+ @count = 0
66
+ end
67
+
62
68
  # A frozen clone of all requests held, including those already processed
63
69
  def all
64
70
  @requests.clone.freeze
data/lib/maze.rb CHANGED
@@ -8,7 +8,7 @@ require_relative 'maze/timers'
8
8
  # providing an alternative to the proliferation of global variables or singletons.
9
9
  module Maze
10
10
 
11
- VERSION = '9.30.3'
11
+ VERSION = '9.31.0'
12
12
 
13
13
  class << self
14
14
  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.30.3
4
+ version: 9.31.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: 2025-05-14 00:00:00.000000000 Z
11
+ date: 2025-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -504,7 +504,6 @@ files:
504
504
  - lib/maze/option/parser.rb
505
505
  - lib/maze/option/processor.rb
506
506
  - lib/maze/option/validator.rb
507
- - lib/maze/plugins/bugsnag_reporting_plugin.rb
508
507
  - lib/maze/plugins/datadog_metrics_plugin.rb
509
508
  - lib/maze/plugins/error_code_plugin.rb
510
509
  - lib/maze/plugins/global_retry_plugin.rb
@@ -1,62 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bugsnag'
4
- require 'cucumber/core/filter'
5
-
6
- # Required to access the options
7
- module Cucumber
8
- class Configuration
9
- attr_accessor :options
10
- end
11
- end
12
-
13
- module Maze
14
- module Plugins
15
- class BugsnagReportingPlugin < Cucumber::Core::Filter.new(:configuration)
16
-
17
- def test_case(test_case)
18
- configuration.on_event(:test_step_finished) do |event|
19
- @last_test_step = event.test_step if event.result.failed?
20
- end
21
-
22
- configuration.on_event(:test_case_finished) do |event|
23
-
24
- # Ensure we're in the correct test case and that it's failed
25
- next unless event.test_case.eql?(test_case) && event.result.failed?
26
-
27
- Bugsnag.notify(event.result.exception) do |bsg_event|
28
- bsg_event.api_key = ENV['MAZE_SCENARIO_BUGSNAG_API_KEY'] unless selenium_report?(event.result.exception)
29
-
30
- unless @last_test_step.nil?
31
-
32
- repo = ENV['BUILDKITE_PIPELINE_SLUG']
33
- bsg_event.context = if repo.nil?
34
- @last_test_step.location
35
- else
36
- "#{repo}/#{@last_test_step.location}"
37
- end
38
- bsg_event.grouping_hash = @last_test_step.location
39
-
40
- bsg_event.add_metadata(:'scenario', {
41
- 'failing step': @last_test_step.to_s,
42
- 'failing step location': @last_test_step.location
43
- })
44
- end
45
- bsg_event.add_metadata(:'scenario', {
46
- 'scenario name': test_case.name,
47
- 'scenario location': test_case.location,
48
- 'scenario tags': test_case.tags,
49
- 'scenario duration (mS)': event.result.duration.nanoseconds/1000000
50
- })
51
- end
52
- end
53
-
54
- super
55
- end
56
-
57
- def selenium_report?(exception)
58
- exception.class.to_s.include?('Selenium')
59
- end
60
- end
61
- end
62
- end