minitest_rollbar 0.3.1 → 0.3.3

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
  SHA1:
3
- metadata.gz: f85c64bd781dc64fa18e568f441420d3a519affc
4
- data.tar.gz: d468c26e153becb6a59d6fa0f5f027c3f22c5a66
3
+ metadata.gz: 32ce6e93eae1a3574774ebb77611485bf366e6d7
4
+ data.tar.gz: f3ebec98ec6b0d9e91908fb1b172191d4b79c352
5
5
  SHA512:
6
- metadata.gz: 6e90e7b0e11c0daa0126112805b62bc9158026d62ad5b62291429ef70a08713ebd480e76d32ae59917a2755a6240a26e7344e0d2c2ce1cf3ca5cc7ffea7366a8
7
- data.tar.gz: 7d5d29fcf1728faef3a421e58cedeb002d3cfbae70d97cd58240accb1b80c437c6ab63d884dca54b525cf581000515194abb9ef99f5fb46255c0df15810e193f
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
- # Inspect will return ExceptionType + Message.
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.configure do |config|
21
- rollbar_config.each do |key, value|
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 Rollbar.configuration.access_token.nil?
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 MinitestRollbar.use_default_grouping.nil?
71
- Rollbar.scope({count: @sequential_exception_count, commit_hash: git_commit_hash, build_config: build_config_name, fingerprint: @previous_exception_inspect_result})
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)
@@ -1,3 +1,3 @@
1
1
  module MinitestRollbar
2
- VERSION = '0.3.1'.freeze
2
+ VERSION = '0.3.3'.freeze
3
3
  end
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.1
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-07-23 00:00:00.000000000 Z
11
+ date: 2016-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler