minitest_rollbar 0.3.1 → 0.3.3
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 +4 -4
- data/lib/minitest_rollbar/reporters.rb +15 -16
- data/lib/minitest_rollbar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32ce6e93eae1a3574774ebb77611485bf366e6d7
|
4
|
+
data.tar.gz: f3ebec98ec6b0d9e91908fb1b172191d4b79c352
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e25c6103a31fb6263fac2f80e0be6b5c101c7ecd695c89dcfbd09f5702be15e75f3ed2719ef4608c64e3bcc4fb09c12dddf7397ddcc170bea1ed46a02e833a04
|
7
|
+
data.tar.gz: d65d445cd3b9f57b9fc5a5a5d6a5a020bd3e05009d5624fc21e026bb56d9d5c33d56d56f3b176a289dd733c6fb788c1c3893c007433a63d43838de728b17eed4
|
@@ -1,29 +1,24 @@
|
|
1
1
|
require 'rollbar'
|
2
2
|
require 'minitest/reporters'
|
3
3
|
module MinitestRollbar
|
4
|
-
class << self
|
5
|
-
attr_accessor :use_default_grouping
|
6
|
-
end
|
7
4
|
|
8
5
|
class RollbarReporter < Minitest::Reporters::BaseReporter
|
6
|
+
|
7
|
+
attr_accessor :use_default_grouping
|
8
|
+
|
9
9
|
def initialize(options = {})
|
10
|
-
rollbar_config = options.delete(:rollbar_config) || {}
|
10
|
+
@rollbar_config = options.delete(:rollbar_config) || {}
|
11
11
|
super(options)
|
12
12
|
|
13
13
|
@sequential_exception_count = 0
|
14
|
-
|
15
|
-
# E.g #<Selenium::WebDriver::Error::NoSuchWindowError: Window not found. The browser window may have been closed.>
|
16
|
-
# Use this as a criteria for log batch grouping
|
14
|
+
@use_default_grouping = false
|
17
15
|
@previous_exception_inspect_result = nil
|
18
16
|
@previous_exception = nil
|
19
17
|
|
20
|
-
Rollbar
|
21
|
-
|
22
|
-
config.send "#{key}=", value
|
23
|
-
end
|
24
|
-
end
|
18
|
+
# Rollbar global setting, notifier instance won't report if this is not set
|
19
|
+
Rollbar.configuration.enabled = true
|
25
20
|
|
26
|
-
raise 'Must set rollbar access token' if
|
21
|
+
raise 'Must set rollbar access token' if @rollbar_config[:access_token].nil?
|
27
22
|
end
|
28
23
|
|
29
24
|
def record(result)
|
@@ -67,11 +62,15 @@ module MinitestRollbar
|
|
67
62
|
end
|
68
63
|
|
69
64
|
def notifier
|
70
|
-
if
|
71
|
-
Rollbar.scope({count: @sequential_exception_count, commit_hash: git_commit_hash, build_config: build_config_name
|
65
|
+
if @use_default_grouping
|
66
|
+
@notifier = Rollbar.scope({environment: 'PossibleInfraFlaky',count: @sequential_exception_count, commit_hash: git_commit_hash, build_config: build_config_name})
|
72
67
|
else
|
73
|
-
Rollbar.scope({count: @sequential_exception_count, commit_hash: git_commit_hash, build_config: build_config_name})
|
68
|
+
@notifier = Rollbar.scope({environment: 'PossibleInfraFlaky',count: @sequential_exception_count, commit_hash: git_commit_hash, build_config: build_config_name, fingerprint: @previous_exception_inspect_result})
|
69
|
+
end
|
70
|
+
@rollbar_config.each do |key,value|
|
71
|
+
@notifier.configuration.send("#{key}=", value)
|
74
72
|
end
|
73
|
+
@notifier
|
75
74
|
end
|
76
75
|
|
77
76
|
def report_error_to_rollbar(notifier)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest_rollbar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuesong Wang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|