coveralls_reborn 0.17.0 → 0.22.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: 33e597f0d8aa56b69519be43917d05b4ba6f2d2401d4f493c6a8dc00e90deba3
4
- data.tar.gz: 41f4c4f82f4a0dbd6140fd2585cd280710f78d39fa3fa62300832df8ed1a0c48
3
+ metadata.gz: 55f0c6a60495529b2f17ec669e53349429fe67118650ebbafcd32a39321c0c5c
4
+ data.tar.gz: 47eef8a83e435e6b91b27f4f121ba025021bbff6bca8d52c1ddf21599244b699
5
5
  SHA512:
6
- metadata.gz: 8c15cd369a3e020c4a1dc928cf2fd68ce154f1d5837cd0952305ec559aeeacabceeed516f5168bcbc4a55fe286af0afbfadcbfa78391854dcd00dc46e063bd05
7
- data.tar.gz: fff07f460d21d7a768c86855ffb12c46f03da073605dbc3c6563b9c8c5c40d1624f124737ba0ee26ba0fd5c0a45da325879bf40bc097e2b5d5cea0cc3b55dfd5
6
+ metadata.gz: 11b1f829d3afccaca4d4dd4048a9618c70adcae02bf7d05cfa50826886646f3a1cd4e18b45ea7804c3bc34325678c27b9520f240d8527e0c9b0c19b3dfd92bb9
7
+ data.tar.gz: e653bf5519256740d3f1b00d769f227b1ddf04feb3477edc0e61f64bfcc60006509ee376b46a36247bb60efeb06936d193aa3690dde9d859da9d6856280543ed
@@ -0,0 +1,8 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ time: "04:00"
8
+ open-pull-requests-limit: 10
data/.rubocop.yml CHANGED
@@ -1,9 +1,9 @@
1
1
  require:
2
2
  - rubocop-performance
3
+ - rubocop-rake
3
4
  - rubocop-rspec
4
5
 
5
6
  AllCops:
6
- TargetRubyVersion: 2.4
7
7
  NewCops: enable
8
8
  Exclude:
9
9
  - 'spec/coveralls/fixtures/**/*'
data/.travis.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  os: linux
2
- dist: bionic
2
+ dist: focal
3
3
  language: ruby
4
4
 
5
5
  cache: bundler
@@ -12,15 +12,22 @@ env:
12
12
  - JRUBY_OPTS="--dev --debug"
13
13
 
14
14
  rvm:
15
- - 2.4.10
16
- - 2.5.8
17
- - 2.6.6
18
- - 2.7.1
15
+ - 2.5.9
16
+ - 2.6.7
17
+ - 2.7.3
18
+ - 3.0.1
19
19
  - ruby-head
20
- - jruby-9.2.13.0
20
+ - jruby-9.2.17.0
21
21
 
22
22
  jobs:
23
23
  allow_failures:
24
24
  - rvm: ruby-head
25
- - rvm: jruby-9.2.13.0
25
+ - rvm: jruby-9.2.17.0
26
+ include:
27
+ - rvm: 2.5.9
28
+ gemfile: Gemfile
29
+ script: bundle exec rake rubocop
30
+ name: RuboCop
26
31
  fast_finish: true
32
+
33
+ script: bundle exec rake spec
data/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.22.0 / 2021-04-30
4
+
5
+ * [FEATURE] Drop Ruby 2.4 support
6
+ * [ENHANCEMENT] Test against latest Ruby versions
7
+
8
+ ## 0.21.0 / 2021-03-18
9
+
10
+ * [FEATURE] Allow GitLab parallel builds [#20](https://github.com/tagliala/coveralls-ruby-reborn/pull/20)
11
+ * [ENHANCEMENT] Test against JRuby 9.2.16.0
12
+
13
+ ## 0.20.0 / 2021-01-09
14
+
15
+ * [FEATURE] Add Ruby 3 compatibility
16
+ * [FEATURE] Add SimpleCov 0.21.0 compatibility
17
+ * [ENHANCEMENT] Update dependencies
18
+
19
+ ## 0.19.0 / 2020-12-02
20
+
21
+ * [FEATURE] Add SimpleCov 0.20.0 compatibility
22
+
23
+ ## 0.18.0 / 2020-09-07
24
+
25
+ * [ENHANCEMENT] Refactor HTTP client [#10](https://github.com/tagliala/coveralls-ruby-reborn/pull/10)
26
+ * [ENHANCEMENT] Update dependencies
27
+
3
28
  ## 0.17.0 / 2020-08-26
4
29
 
5
30
  * [FEATURE] Add SimpleCov 0.19.0 compatibility
data/Gemfile CHANGED
@@ -9,19 +9,15 @@ platforms :jruby do
9
9
  gem 'jruby-openssl', '~> 0.10.2'
10
10
  end
11
11
 
12
- group :development do
13
- gem 'rake', '~> 13.0'
14
- gem 'rspec', '~> 3.9'
15
- gem 'rubocop', '~> 0.89.1'
16
- gem 'rubocop-performance', '~> 1.7'
17
- gem 'rubocop-rspec', '~> 1.43'
18
- gem 'truthy', '~> 1.0'
19
- gem 'vcr', '~> 6.0'
20
- gem 'webmock', '~> 3.8'
21
- end
22
-
23
- group :development, :test do
24
- gem 'byebug', '~> 11.1', platforms: %i[mri mingw x64_mingw]
25
- gem 'pry', '~> 0.13.1'
26
- gem 'pry-byebug', '~> 3.9', platforms: %i[mri mingw x64_mingw]
27
- end
12
+ gem 'byebug', '~> 11.1', platforms: %i[mri mingw x64_mingw]
13
+ gem 'pry', '~> 0.13.1'
14
+ gem 'pry-byebug', '~> 3.9', platforms: %i[mri mingw x64_mingw]
15
+ gem 'rake', '~> 13.0'
16
+ gem 'rspec', '~> 3.10'
17
+ gem 'rubocop', '~> 1.13'
18
+ gem 'rubocop-performance', '~> 1.11'
19
+ gem 'rubocop-rake', '~> 0.5.1'
20
+ gem 'rubocop-rspec', '~> 2.2'
21
+ gem 'truthy', '~> 1.0'
22
+ gem 'vcr', '~> 6.0'
23
+ gem 'webmock', '~> 3.12'
data/LICENSE CHANGED
@@ -2,7 +2,7 @@ MIT License
2
2
 
3
3
  Copyright (c) 2018 Wil Gieseler
4
4
 
5
- Copyright (c) 2020 Geremia Taglialatela
5
+ Copyright (c) 2021 Geremia Taglialatela
6
6
 
7
7
  Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [Coveralls Reborn](http://coveralls.io) for Ruby [![Coverage Status](https://coveralls.io/repos/github/tagliala/coveralls-ruby-reborn/badge.svg?branch=master)](https://coveralls.io/github/tagliala/coveralls-ruby-reborn?branch=master) [![Build Status](https://secure.travis-ci.org/tagliala/coveralls-ruby-reborn.svg?branch=master)](https://travis-ci.org/tagliala/coveralls-ruby-reborn) [![Gem Version](https://badge.fury.io/rb/coveralls_reborn.svg)](http://badge.fury.io/rb/coveralls_reborn)
1
+ # [Coveralls Reborn](https://coveralls.io) for Ruby [![Coverage Status](https://coveralls.io/repos/github/tagliala/coveralls-ruby-reborn/badge.svg?branch=main)](https://coveralls.io/github/tagliala/coveralls-ruby-reborn?branch=main) [![Build Status](https://secure.travis-ci.org/tagliala/coveralls-ruby-reborn.svg?branch=main)](https://travis-ci.org/tagliala/coveralls-ruby-reborn) [![Gem Version](https://badge.fury.io/rb/coveralls_reborn.svg)](https://badge.fury.io/rb/coveralls_reborn)
2
2
 
3
3
  ### [Read the docs →](https://docs.coveralls.io/ruby-on-rails)
4
4
 
@@ -7,5 +7,5 @@ An up-to-date fork of [lemurheavy/coveralls-ruby](https://github.com/lemurheavy/
7
7
  Add to your `Gemfile`:
8
8
 
9
9
  ```rb
10
- gem 'coveralls_reborn', '~> 0.16.0', require: false
10
+ gem 'coveralls_reborn', '~> 0.22.0', require: false
11
11
  ```
@@ -20,12 +20,12 @@ Gem::Specification.new do |gem|
20
20
  gem.version = Coveralls::VERSION
21
21
 
22
22
  gem.metadata['bug_tracker_uri'] = 'https://github.com/tagliala/coveralls-ruby-reborn/issues'
23
- gem.metadata['changelog_uri'] = 'https://github.com/tagliala/coveralls-ruby-reborn/blob/master/CHANGELOG.md'
23
+ gem.metadata['changelog_uri'] = 'https://github.com/tagliala/coveralls-ruby-reborn/blob/main/CHANGELOG.md'
24
24
  gem.metadata['source_code_uri'] = 'https://github.com/tagliala/coveralls-ruby-reborn'
25
25
 
26
- gem.required_ruby_version = '>= 2.4'
26
+ gem.required_ruby_version = '>= 2.5'
27
27
 
28
- gem.add_dependency 'simplecov', '>= 0.18.1', '< 0.20.0'
28
+ gem.add_dependency 'simplecov', '>= 0.18.1', '< 0.22.0'
29
29
  gem.add_dependency 'term-ansicolor', '~> 1.6'
30
30
  gem.add_dependency 'thor', '>= 0.20.3', '< 2.0'
31
31
  gem.add_dependency 'tins', '~> 1.16'
data/lib/coveralls.rb CHANGED
@@ -66,7 +66,7 @@ module Coveralls
66
66
 
67
67
  if simplecov_setting
68
68
  Coveralls::Output.puts("[Coveralls] Using SimpleCov's '#{simplecov_setting}' settings.", color: 'green')
69
- if block_given?
69
+ if block
70
70
  ::SimpleCov.start(simplecov_setting) { instance_eval(&block) }
71
71
  else
72
72
  ::SimpleCov.start(simplecov_setting)
data/lib/coveralls/api.rb CHANGED
@@ -80,15 +80,7 @@ module Coveralls
80
80
 
81
81
  def build_client(uri)
82
82
  client = Net::HTTP.new(uri.host, uri.port)
83
- client.use_ssl = true if uri.port == 443
84
- client.verify_mode = OpenSSL::SSL::VERIFY_NONE
85
-
86
- unless client.respond_to?(:ssl_version=)
87
- Net::HTTP.ssl_context_accessor('ssl_version')
88
- end
89
-
90
- client.ssl_version = 'TLSv1'
91
-
83
+ client.use_ssl = uri.port == 443
92
84
  client
93
85
  end
94
86
 
@@ -13,10 +13,10 @@ module Coveralls
13
13
 
14
14
  if File.exist?('.travis.yml')
15
15
  cmds = begin
16
- YAML.load_file('.travis.yml')['script'] || cmds
17
- rescue StandardError
18
- cmds
19
- end
16
+ YAML.load_file('.travis.yml')['script'] || cmds
17
+ rescue StandardError
18
+ cmds
19
+ end
20
20
  end
21
21
 
22
22
  cmds.each { |cmd| system cmd }
@@ -107,6 +107,7 @@ module Coveralls
107
107
 
108
108
  def define_service_params_for_gitlab(config)
109
109
  config[:service_name] = 'gitlab-ci'
110
+ config[:service_number] = ENV['CI_PIPELINE_ID']
110
111
  config[:service_job_number] = ENV['CI_BUILD_NAME']
111
112
  config[:service_job_id] = ENV['CI_BUILD_ID']
112
113
  config[:service_branch] = ENV['CI_BUILD_REF_NAME']
@@ -179,8 +180,8 @@ module Coveralls
179
180
  # Remotes
180
181
  remotes = nil
181
182
  begin
182
- remotes = `git remote -v`.split(/\n/).map do |remote|
183
- splits = remote.split(' ').compact
183
+ remotes = `git remote -v`.split("\n").map do |remote|
184
+ splits = remote.split.compact
184
185
  { name: splits[0], url: splits[1] }
185
186
  end.uniq
186
187
  rescue StandardError => e
@@ -199,14 +200,14 @@ module Coveralls
199
200
  end
200
201
 
201
202
  def relevant_env
202
- hash = {
203
+ base_env = {
203
204
  pwd: pwd,
204
205
  rails_root: rails_root,
205
206
  simplecov_root: simplecov_root,
206
207
  gem_version: VERSION
207
208
  }
208
209
 
209
- hash.merge! begin
210
+ service_env =
210
211
  if ENV['TRAVIS']
211
212
  travis_env_hash
212
213
  elsif ENV['CIRCLECI']
@@ -218,9 +219,8 @@ module Coveralls
218
219
  else
219
220
  {}
220
221
  end
221
- end
222
222
 
223
- hash
223
+ base_env.merge! service_env
224
224
  end
225
225
 
226
226
  private
@@ -7,10 +7,10 @@ module Coveralls
7
7
  class Formatter
8
8
  def display_result(result)
9
9
  # Log which files would be submitted.
10
- if !result.files.empty?
11
- Coveralls::Output.puts '[Coveralls] Some handy coverage stats:'
12
- else
10
+ if result.files.empty?
13
11
  Coveralls::Output.puts '[Coveralls] There are no covered files.', color: 'yellow'
12
+ else
13
+ Coveralls::Output.puts '[Coveralls] Some handy coverage stats:'
14
14
  end
15
15
 
16
16
  result.files.each do |f|
@@ -95,10 +95,10 @@ module Coveralls
95
95
 
96
96
  def output_message(result)
97
97
  "Coverage is at #{begin
98
- result.covered_percent.round(2)
99
- rescue StandardError
100
- result.covered_percent.round
101
- end}%.\nCoverage report sent to Coveralls."
98
+ result.covered_percent.round(2)
99
+ rescue StandardError
100
+ result.covered_percent.round
101
+ end}%.\nCoverage report sent to Coveralls."
102
102
  end
103
103
 
104
104
  def short_filename(filename)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Coveralls
4
- VERSION = '0.17.0'
4
+ VERSION = '0.22.0'
5
5
  end
@@ -219,9 +219,11 @@ describe Coveralls::Configuration do
219
219
  let(:service_job_number) { 'spec:one' }
220
220
  let(:service_job_id) { 1234 }
221
221
  let(:service_branch) { 'feature' }
222
+ let(:service_number) { 5678 }
222
223
 
223
224
  before do
224
225
  allow(ENV).to receive(:[]).with('CI_BUILD_NAME').and_return(service_job_number)
226
+ allow(ENV).to receive(:[]).with('CI_PIPELINE_ID').and_return(service_number)
225
227
  allow(ENV).to receive(:[]).with('CI_BUILD_ID').and_return(service_job_id)
226
228
  allow(ENV).to receive(:[]).with('CI_BUILD_REF_NAME').and_return(service_branch)
227
229
  allow(ENV).to receive(:[]).with('CI_BUILD_REF').and_return(commit_sha)
@@ -231,6 +233,7 @@ describe Coveralls::Configuration do
231
233
  config = {}
232
234
  described_class.define_service_params_for_gitlab(config)
233
235
  expect(config[:service_name]).to eq('gitlab-ci')
236
+ expect(config[:service_number]).to eq(service_number)
234
237
  expect(config[:service_job_number]).to eq(service_job_number)
235
238
  expect(config[:service_job_id]).to eq(service_job_id)
236
239
  expect(config[:service_branch]).to eq(service_branch)
@@ -80,6 +80,14 @@ describe Coveralls do
80
80
  end
81
81
 
82
82
  describe '#push!' do
83
+ let(:coverage_hash) do
84
+ { 'file.rb'=>{ 'lines'=>[nil] } }
85
+ end
86
+
87
+ before do
88
+ allow(SimpleCov::ResultMerger).to receive(:merge_valid_results).and_return([['RSpec'], coverage_hash])
89
+ end
90
+
83
91
  it 'sends existing test results' do
84
92
  result = false
85
93
  silence do
@@ -91,12 +99,12 @@ describe Coveralls do
91
99
 
92
100
  describe '#setup!' do
93
101
  it 'sets SimpleCov adapter' do
94
- # rubocop:disable RSpec/LeakyConstantDeclaration
102
+ # rubocop:disable Lint/ConstantDefinitionInBlock, RSpec/LeakyConstantDeclaration
95
103
  SimpleCovTmp = SimpleCov
96
104
  Object.send :remove_const, :SimpleCov
97
105
  silence { described_class.setup! }
98
106
  SimpleCov = SimpleCovTmp
99
- # rubocop:enable RSpec/LeakyConstantDeclaration
107
+ # rubocop:enable Lint/ConstantDefinitionInBlock, RSpec/LeakyConstantDeclaration
100
108
  end
101
109
  end
102
110
  end
@@ -12,13 +12,17 @@ describe Coveralls::SimpleCov::Formatter do
12
12
  end
13
13
 
14
14
  let(:result) do
15
- SimpleCov::Result.new(source_fixture('app/controllers/sample.rb') => [nil, 1, 1, 1, nil, 0, 1, 1, nil, nil],
16
- source_fixture('app/models/airplane.rb') => [0, 0, 0, 0, 0],
17
- source_fixture('app/models/dog.rb') => [1, 1, 1, 1, 1],
18
- source_fixture('app/models/house.rb') => [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil],
19
- source_fixture('app/models/robot.rb') => [1, 1, 1, 1, nil, nil, 1, 0, nil, nil],
20
- source_fixture('app/models/user.rb') => [nil, 1, 1, 1, 1, 0, 1, 0, nil, nil],
21
- source_fixture('sample.rb') => [nil, 1, 1, 1, nil, 0, 1, 1, nil, nil])
15
+ options = {
16
+ source_fixture('app/controllers/sample.rb') => { lines: [nil, 1, 1, 1, nil, 0, 1, 1, nil, nil] },
17
+ source_fixture('app/models/airplane.rb') => { lines: [0, 0, 0, 0, 0] },
18
+ source_fixture('app/models/dog.rb') => { lines: [1, 1, 1, 1, 1] },
19
+ source_fixture('app/models/house.rb') => { lines: [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil] },
20
+ source_fixture('app/models/robot.rb') => { lines: [1, 1, 1, 1, nil, nil, 1, 0, nil, nil] },
21
+ source_fixture('app/models/user.rb') => { lines: [nil, 1, 1, 1, 1, 0, 1, 0, nil, nil] },
22
+ source_fixture('sample.rb') => { lines: [nil, 1, 1, 1, nil, 0, 1, 1, nil, nil] }
23
+ }
24
+
25
+ SimpleCov::Result.new(options)
22
26
  end
23
27
 
24
28
  describe '#format' do
data/spec/spec_helper.rb CHANGED
@@ -49,15 +49,8 @@ end
49
49
 
50
50
  def stub_api_post
51
51
  body = '{"message":"","url":""}'
52
- stub_request(:post, "#{Coveralls::API::API_BASE}/jobs").with(
53
- headers: {
54
- 'Accept' => '*/*; q=0.5, application/xml',
55
- 'Accept-Encoding' => 'gzip, deflate',
56
- 'Content-Length' => /.+/,
57
- 'Content-Type' => /.+/,
58
- 'User-Agent' => 'Ruby'
59
- }
60
- ).to_return(status: 200, body: body, headers: {})
52
+ stub_request(:post, "#{Coveralls::API::API_BASE}/jobs")
53
+ .to_return(status: 200, body: body, headers: {})
61
54
  end
62
55
 
63
56
  def silence(&block)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coveralls_reborn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Merwin
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-08-26 00:00:00.000000000 Z
13
+ date: 2021-04-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: simplecov
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 0.18.1
22
22
  - - "<"
23
23
  - !ruby/object:Gem::Version
24
- version: 0.20.0
24
+ version: 0.22.0
25
25
  type: :runtime
26
26
  prerelease: false
27
27
  version_requirements: !ruby/object:Gem::Requirement
@@ -31,7 +31,7 @@ dependencies:
31
31
  version: 0.18.1
32
32
  - - "<"
33
33
  - !ruby/object:Gem::Version
34
- version: 0.20.0
34
+ version: 0.22.0
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: term-ansicolor
37
37
  requirement: !ruby/object:Gem::Requirement
@@ -110,6 +110,7 @@ executables:
110
110
  extensions: []
111
111
  extra_rdoc_files: []
112
112
  files:
113
+ - ".github/dependabot.yml"
113
114
  - ".gitignore"
114
115
  - ".rspec"
115
116
  - ".rubocop.yml"
@@ -147,7 +148,7 @@ licenses:
147
148
  - MIT
148
149
  metadata:
149
150
  bug_tracker_uri: https://github.com/tagliala/coveralls-ruby-reborn/issues
150
- changelog_uri: https://github.com/tagliala/coveralls-ruby-reborn/blob/master/CHANGELOG.md
151
+ changelog_uri: https://github.com/tagliala/coveralls-ruby-reborn/blob/main/CHANGELOG.md
151
152
  source_code_uri: https://github.com/tagliala/coveralls-ruby-reborn
152
153
  post_install_message:
153
154
  rdoc_options: []
@@ -157,14 +158,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
157
158
  requirements:
158
159
  - - ">="
159
160
  - !ruby/object:Gem::Version
160
- version: '2.4'
161
+ version: '2.5'
161
162
  required_rubygems_version: !ruby/object:Gem::Requirement
162
163
  requirements:
163
164
  - - ">="
164
165
  - !ruby/object:Gem::Version
165
166
  version: '0'
166
167
  requirements: []
167
- rubygems_version: 3.1.3
168
+ rubygems_version: 3.1.6
168
169
  signing_key:
169
170
  specification_version: 4
170
171
  summary: A Ruby implementation of the Coveralls API.