bugsnag-maze-runner 9.3.0 → 9.4.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: dacde3d4eb35539a0dbaf40020e42b1d08cac2a20a733a7b03588168677bda74
4
- data.tar.gz: c9a60049b25661b69885754b9dc11cd44024af2abc7131c719b7d67d94754ee0
3
+ metadata.gz: ebfe5ec9f34345cf0f5c2cbb5d94f9ed3ebfce52ad87f4e69580103c57c57870
4
+ data.tar.gz: cf4a7628f486f944dda441b62caa8945fe315106e96966f4ffde1a40cee23c6d
5
5
  SHA512:
6
- metadata.gz: 12688ef4e48762c83b9535529ddc5881f30ea19f1779eb475e447d7046d6f80f98ccdbf1cb4b5319b943758e07e0dda9ed79bf1bfb2ae039f2d108d2d5f13715
7
- data.tar.gz: b8e56857f38a47bf60474deb504b7a90fe9661f06f8597ec95948bfd47c76ff1b6a904953c5498eb1a592bec886cb4d9ce79320d7779b69a4be977661ab7b601
6
+ metadata.gz: a03d87778582af7a94ff562b0794db23dfb4b9fc73df5545fec781514583f38b7f1cdf7cdf98dd9363a51089680bc84c43d8361d8471e08e29fd4182ae16d4f1
7
+ data.tar.gz: 00d069f3ad7eb7f6d96bd89d08714f82507567c94ef518b3373fb0c5a533752e1fc63c396bc2ffee47be6042fa41975a00a21da91e249cc6b6e24559ed845b77
@@ -95,8 +95,8 @@ InstallPlugin do |config|
95
95
  # Add step logging
96
96
  config.filters << Maze::Plugins::LoggingScenariosPlugin.new(config)
97
97
 
98
- # TODO: Reporting of test failures as errors deactivated pending PLAT-10963
99
- #config.filters << Maze::Plugins::BugsnagReportingPlugin.new(config)
98
+ # Add bugsnag failed scenario reporting only if ENV['MAZE_SCENARIO_BUGSNAG_API_KEY'] is present
99
+ config.filters << Maze::Plugins::BugsnagReportingPlugin.new(config) unless ENV['MAZE_SCENARIO_BUGSNAG_API_KEY'].nil?
100
100
  end
101
101
 
102
102
  # Before each scenario
@@ -12,6 +12,8 @@ module Maze
12
12
  TUNNEL_FAILURE = 101
13
13
  SESSION_CREATION_FAILURE = 102
14
14
  APPIUM_SESSION_FAILURE = 103
15
+ # A catch-all for certain errors related to Appium failures when the app is running app hang or ANR tests
16
+ APPIUM_APP_HANG_FAILURE = 104
15
17
  end
16
18
  end
17
19
  end
@@ -11,7 +11,6 @@ module Maze
11
11
  Bugsnag.configure do |config|
12
12
  config.api_key = ENV['MAZE_BUGSNAG_API_KEY']
13
13
  config.app_version = Maze::VERSION
14
- config.discard_classes << 'Test::Unit::AssertionFailedError'
15
14
  config.add_metadata(:'test driver', {
16
15
  'driver type': Maze.driver.class,
17
16
  'device farm': Maze.config.farm,
@@ -32,6 +31,7 @@ module Maze
32
31
  metadata['job url'] = ENV['BUILDKITE_BUILD_URL'] + "#" + ENV['BUILDKITE_JOB_ID']
33
32
  end
34
33
  end
34
+ config.middleware.use(AssertErrorMiddleware)
35
35
  config.add_metadata(:'buildkite', metadata)
36
36
  config.project_root = Dir.pwd
37
37
  end
@@ -45,5 +45,27 @@ module Maze
45
45
  end
46
46
  end
47
47
  end
48
+
49
+ class AssertErrorMiddleware
50
+ IGNORE_CLASS_NAME = 'Test::Unit::AssertionFailedError'
51
+
52
+ # @param middleware [#call] The next middleware to call
53
+ def initialize(middleware)
54
+ @middleware = middleware
55
+ end
56
+
57
+ def call(report)
58
+ # Only ignore automated notifies with assertion errors
59
+ automated = report.unhandled
60
+
61
+ class_match = report.raw_exceptions.any? do |ex|
62
+ ex.class.name.eql?(IGNORE_CLASS_NAME)
63
+ end
64
+
65
+ report.ignore! if automated && class_match
66
+
67
+ @middleware.call(report)
68
+ end
69
+ end
48
70
  end
49
71
  end
@@ -42,7 +42,7 @@ module Maze
42
42
  default: true
43
43
 
44
44
  opt Option::BUGSNAG,
45
- 'Enables reporting to Bugsnag on scenario failure (requires MAZE_BUGSNAG_API_KEY)',
45
+ 'Enables reporting to Bugsnag on scenario failure (requires MAZE_BUGSNAG_API_KEY for errors, MAZE_SCENARIO_BUGSNAG_API_KEY for test failures)',
46
46
  type: :boolean,
47
47
  short: :none,
48
48
  default: true
@@ -25,6 +25,9 @@ module Maze
25
25
  next unless event.test_case.eql?(test_case) && event.result.failed?
26
26
 
27
27
  Bugsnag.notify(event.result.exception) do |bsg_event|
28
+
29
+ bsg_event.api_key = ENV['MAZE_SCENARIO_BUGSNAG_API_KEY']
30
+
28
31
  unless @last_test_step.nil?
29
32
 
30
33
  repo = ENV['BUILDKITE_PIPELINE_SLUG']
@@ -39,7 +39,6 @@ module Maze
39
39
  element_int_in_range('resourceSpans.0.scopeSpans.0.spans.0.kind', 0..5)
40
40
  regex_comparison('resourceSpans.0.scopeSpans.0.spans.0.startTimeUnixNano', '^[0-9]+$')
41
41
  regex_comparison('resourceSpans.0.scopeSpans.0.spans.0.endTimeUnixNano', '^[0-9]+$')
42
- element_contains('resourceSpans.0.resource.attributes', 'service.version')
43
42
  element_contains('resourceSpans.0.resource.attributes', 'device.id')
44
43
  each_element_contains('resourceSpans.0.scopeSpans.0.spans', 'attributes', 'bugsnag.sampling.p')
45
44
  element_contains('resourceSpans.0.resource.attributes', 'deployment.environment')
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.3.0'
10
+ VERSION = '9.4.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.3.0
4
+ version: 9.4.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-02-29 00:00:00.000000000 Z
11
+ date: 2024-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber