codecov 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/codecov.rb +11 -9
  3. metadata +16 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8a7910be87b931e578ca118951e56d194e4eacce5bae5c43f00008ee5da7ba6
4
- data.tar.gz: 10ebc17802361f6940bbec66dd8bf0407af083b0eaeccad17c480e72a587b79f
3
+ metadata.gz: daba8db072c6615d0e1715680a1753b8e8edf9d8c587674acf22d92edceec613
4
+ data.tar.gz: e139f061377a88e8a7266db95acd9354b20f81885e49c2d070c8075a13c701d4
5
5
  SHA512:
6
- metadata.gz: bcbb1f88c22749834ca20f87869a8d189fb0ac592a1b2a5507c69d7177376850085caaf0f414cfbb778af8e9c9002fa2e6c4994be59fdc5fb42a3b39149ccf9d
7
- data.tar.gz: e02d2cda3d6bcc3e5d26391b49a737b31ea992679444dfbc53633eb999574929e2d7e67d2f180c7200daa00a7c6b9f8e94e5c6c80da2c94440748dd81b734a1b
6
+ metadata.gz: 8a9ab0aee0e4c10821f6663b6f6577fba04f0408cbc1e76a55beb7d7113a07c6cbb2951c3ba88c9eb65af0f8599c1414caaa4b89f853c82441a21db0d37bd099
7
+ data.tar.gz: 51f0f8a2ebf765daa5687b2337db53c3a5a2aaf086a307629f5f463a4d3b435f6e3586586059def772ede349c2d2eb8273c2e967eb9a14be01c432098d31b1fc
@@ -8,7 +8,7 @@ require 'colorize'
8
8
  require 'zlib'
9
9
 
10
10
  class SimpleCov::Formatter::Codecov
11
- VERSION = '0.2.1'
11
+ VERSION = '0.2.2'
12
12
 
13
13
  ### CIs
14
14
  RECOGNIZED_CIS = [
@@ -280,20 +280,21 @@ class SimpleCov::Formatter::Codecov
280
280
  retries = 3
281
281
  begin
282
282
  response = https.request(req)
283
- rescue Timeout::Error => e
283
+ rescue Timeout::Error, SocketError => e
284
284
  retries -= 1
285
285
 
286
286
  if retries.zero?
287
- puts 'Timeout error uploading coverage reports to Codecov. Out of retries.'
287
+ puts 'Timeout or connection error uploading coverage reports to Codecov. Out of retries.'
288
288
  puts e
289
289
  return response
290
290
  end
291
291
 
292
- puts 'Timeout error uploading coverage reports to Codecov. Retrying...'
292
+ puts 'Timeout or connection error uploading coverage reports to Codecov. Retrying...'
293
293
  puts e
294
294
  retry
295
295
  rescue StandardError => e
296
296
  puts 'Error uploading coverage reports to Codecov. Sorry'
297
+ puts e.class.name
297
298
  puts e
298
299
  return response
299
300
  end
@@ -362,8 +363,8 @@ class SimpleCov::Formatter::Codecov
362
363
  }
363
364
  )
364
365
  response = retry_request(req, https)
365
- if response.code == '400'
366
- puts response.body.red
366
+ if !response&.code || response.code == '400'
367
+ puts response&.body&.red
367
368
  return false
368
369
  end
369
370
 
@@ -429,8 +430,8 @@ class SimpleCov::Formatter::Codecov
429
430
  end
430
431
  end
431
432
 
432
- def format(result)
433
- net_blockers(:off)
433
+ def format(result, disable_net_blockers = true)
434
+ net_blockers(:off) if disable_net_blockers
434
435
 
435
436
  display_header
436
437
  ci = detect_ci
@@ -443,7 +444,8 @@ class SimpleCov::Formatter::Codecov
443
444
 
444
445
  report['result'] = JSON.parse(response)
445
446
  handle_report_response(report)
446
- net_blockers(:on)
447
+
448
+ net_blockers(:on) if disable_net_blockers
447
449
  report
448
450
  end
449
451
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codecov
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - codecov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-15 00:00:00.000000000 Z
11
+ date: 2020-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: webmock
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  description: hosted code coverage
112
126
  email:
113
127
  - hello@codecov.io