coverband-service-client 0.0.9 → 0.0.10

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: 613941985d4fb60122f3e35a84c5139a7aa1395008a443b3a3478eef59df2b30
4
- data.tar.gz: 03eabff6d96401aede1ed1263fdc26a400e93fc4e26ad164977e6b77a4b9a4a7
3
+ metadata.gz: f8d7b393a8c8e038d9ec952cea42d257685e93e68d8e00a1dcd6c5be2c46272c
4
+ data.tar.gz: 9aeba81b92f75f43557cbb891b9cee1927e46d03683927d8cfabaad8caf10d46
5
5
  SHA512:
6
- metadata.gz: 2d800e7c8abc0056866a6f9f96b1c89b9c1fc2ebcd7f5bdc17477199445f5740cc968d795cca1ad9a2ca9951480f32b8960f8e4729e975c2f19eea69aa57c8e7
7
- data.tar.gz: 32d5360aa6a50d722d53481f22736e8c47c05844b9372fdd3d1e993ea2209fbdd3043e66dd2c016aad04df7195cffeb124d9fa8ca4bd66ce361f75462a368ffa
6
+ metadata.gz: 466d704e4b97b84c5ae198e997292c3207179cdd185e3087a2067365223cfcb6971b691decb78d7eeb8ed08be88a718c5a448aca5c3abe01c1ff4a76069a9757
7
+ data.tar.gz: 0c6b6c7db5364d591c0fbcbcd74e61c04aadebcca9e3ef3dd02b44ae952a6e86e0a800a9110db819bc4cf0d66cd5d43691ad42ad8c157049ba68a1e42ea957f9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- coverband-service-client (0.0.9)
4
+ coverband-service-client (0.0.10)
5
5
  coverband (~> 4.2.4)
6
6
 
7
7
  GEM
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ COVERBAND_ORIGINAL_START = ENV['COVERBAND_DISABLE_AUTO_START']
4
+ ENV['COVERBAND_DISABLE_AUTO_START'] = 'true'
3
5
  require 'coverband'
4
6
  require 'coverband/service/client/version'
5
7
  require 'securerandom'
@@ -22,7 +24,7 @@ module Coverband
22
24
  def self.report_coverage
23
25
  # for now disable coverband reporting in test & dev env by default
24
26
  if Coverband.configuration.verbose
25
- puts "Coverband: disabled for #{COVERBAND_ENV}, set COVERBAND_ENABLE_DEV_MODE or COVERBAND_ENABLE_TEST_MODE to enable"
27
+ puts "Coverband: disabled for #{COVERBAND_ENV}, set COVERBAND_ENABLE_DEV_MODE or COVERBAND_ENABLE_TEST_MODE to enable" if Coverband.configuration.verbose || COVERBAND_ENABLE_DEV_MODE
26
28
  end
27
29
  end
28
30
  end
@@ -116,13 +118,12 @@ module Coverband
116
118
  end
117
119
 
118
120
  uri = URI("#{coverband_url}/api/collector")
119
- logger&.info "Coverband: saving #{uri}" if Coverband.configuration.verbose
120
121
  req = Net::HTTP::Post.new(uri,
121
122
  'Content-Type' => 'application/json',
122
123
  'Coverband-Token' => api_key)
123
124
  req.body = { remote_uuid: SecureRandom.uuid, data: data }.to_json
124
125
 
125
- logger&.info "Coverband: saving #{req.body}" if Coverband.configuration.verbose
126
+ logger&.info "Coverband: saving (#{uri}) #{req.body}" if Coverband.configuration.verbose
126
127
  res = Net::HTTP.start(
127
128
  uri.hostname,
128
129
  uri.port,
@@ -134,7 +135,7 @@ module Coverband
134
135
  http.request(req)
135
136
  end
136
137
  rescue StandardError => e
137
- puts "Coverband: Error while saving coverage #{e}"
138
+ logger&.info "Coverband: Error while saving coverage #{e}" if Coverband.configuration.verbose || COVERBAND_ENABLE_DEV_MODE
138
139
  end
139
140
  end
140
141
  end
@@ -168,7 +169,7 @@ module Coverband
168
169
  rescue StandardError => e
169
170
  # we don't want to raise errors if Coverband can't reach redis.
170
171
  # This is a nice to have not a bring the system down
171
- logger&.error "Coverband: view_tracker failed to store, error #{e.class.name}"
172
+ logger&.error "Coverband: view_tracker failed to store, error #{e.class.name}" if Coverband.configuration.verbose || COVERBAND_ENABLE_DEV_MODE
172
173
  end
173
174
 
174
175
  private
@@ -196,7 +197,7 @@ module Coverband
196
197
  http.request(req)
197
198
  end
198
199
  rescue StandardError => e
199
- puts "Coverband: Error while saving coverage #{e}"
200
+ logger&.error "Coverband: Error while saving coverage #{e}" if Coverband.configuration.verbose || COVERBAND_ENABLE_DEV_MODE
200
201
  end
201
202
  end
202
203
  end
@@ -208,6 +209,7 @@ module Coverband
208
209
  end
209
210
  end
210
211
 
212
+ ENV['COVERBAND_DISABLE_AUTO_START'] = COVERBAND_ORIGINAL_START
211
213
  Coverband.configure do |config|
212
214
  # Use The Test Service Adapter
213
215
  config.store = Coverband::Adapters::Service.new(Coverband::COVERBAND_SERVICE_URL)
@@ -234,7 +236,10 @@ end
234
236
  # NOTE: it is really hard to bypass / overload our config we should fix this in Coverband
235
237
  # this hopefully detects anyone that has both gems and was trying to configure Coverband themselves.
236
238
  if File.exist?('./config/coverband.rb')
237
- puts "Warning: config/coverband.rb found, this overrides coverband service allowing one to setup open source Coverband"
239
+ puts "Warning: config/coverband.rb found, this overrides coverband service allowing one to setup open source Coverband" if Coverband.configuration.verbose || COVERBAND_ENABLE_DEV_MODE
238
240
  end
239
241
 
240
242
  Coverband.configure('./config/coverband_service.rb') if File.exist?('./config/coverband_service.rb')
243
+ Coverband.start
244
+ require "coverband/utils/railtie" if defined? ::Rails::Railtie
245
+ require "coverband/integrations/resque" if defined? ::Resque
@@ -1,7 +1,7 @@
1
1
  module Coverband
2
2
  module Service
3
3
  module Client
4
- VERSION = '0.0.9'
4
+ VERSION = '0.0.10'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coverband-service-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Mayer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-05-17 00:00:00.000000000 Z
12
+ date: 2020-05-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler