simplecov 0.16.1 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +17 -0
- data/README.md +14 -44
- data/doc/alternate-formatters.md +5 -0
- data/lib/simplecov.rb +24 -4
- data/lib/simplecov/defaults.rb +2 -0
- data/lib/simplecov/profiles/hidden_filter.rb +5 -0
- data/lib/simplecov/profiles/rails.rb +1 -1
- data/lib/simplecov/source_file.rb +1 -1
- data/lib/simplecov/version.rb +1 -1
- metadata +120 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 569ced8e75b24bc774f1f9f605bb3f911dcd6b2f3283422b2ee74e2b9e5a6e0f
|
4
|
+
data.tar.gz: ffb2595e60dc4fb924834501738637c79001798fe2e59119511a64269f0e523b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef85e6fa5ada514035d46978943e10c5a5f15609106b67b0184049495295edfa25893bc2961f8defaf7d90b5f93eaa88fdf98ed51d5e05b2d070ec686c19dfbc
|
7
|
+
data.tar.gz: 1d5f92a76a7c2d3ce49cfb2a9b176eb1ae1b391c5a29d40a4cc479a5e34522eacc0cb8c36c11b989049b996fa32c014ce40f863108a5bf289ab48897bb5d3619
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
0.17.0 (2019-07-02)
|
2
|
+
===================
|
3
|
+
|
4
|
+
Maintenance release with nice convenience features and important bugfixes.
|
5
|
+
Notably this **will be the last release to support ruby versions that have reached their end of life**. Moving forward official CRuby support will be 2.4+ and JRuby support will be 9.1+. Older versions might still work but no guarantees.
|
6
|
+
|
7
|
+
## Enhancements
|
8
|
+
|
9
|
+
* Per default filter hidden files and folders. See [#721](https://github.com/colszowka/simplecov/pull/721) (thanks [Renuo AG](https://www.renuo.ch))
|
10
|
+
* Print the exit status explicitly when it's not a successful build so it's easier figure out SimpleCov failed the build in the output. See [#688](https://github.com/colszowka/simplecov/pull/688) (thanks [@daemonsy](https://github.com/daemonsy))
|
11
|
+
|
12
|
+
## Bugfixes
|
13
|
+
|
14
|
+
* Avoid a premature failure exit code when setting `minimum_coverage` in combination with using [parallel_tests](https://github.com/grosser/parallel_tests). See [#706](https://github.com/colszowka/simplecov/pull/706) (thanks [@f1sherman](https://github.com/f1sherman))
|
15
|
+
* Project roots with special characters no longer cause crashes. See [#717](https://github.com/colszowka/simplecov/pull/717) (thanks [@deivid-rodriguez](https://github.com/deivid-rodriguez))
|
16
|
+
* Avoid continously overriding test results with manual `ResultMergere.store_results` usage. See [#674](https://github.com/colszowka/simplecov/pull/674) (thanks [@tomeon](https://github.com/tomeon))
|
17
|
+
|
1
18
|
0.16.1 (2018-03-16)
|
2
19
|
===================
|
3
20
|
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
SimpleCov [![Build Status](https://travis-ci.org/colszowka/simplecov.svg)][Continuous Integration] [![
|
1
|
+
SimpleCov [![Build Status](https://travis-ci.org/colszowka/simplecov.svg)][Continuous Integration] [![Code Climate](https://codeclimate.com/github/colszowka/simplecov.svg)](https://codeclimate.com/github/colszowka/simplecov) [![Inline docs](http://inch-ci.org/github/colszowka/simplecov.svg)](http://inch-ci.org/github/colszowka/simplecov)
|
2
2
|
=========
|
3
3
|
**Code coverage for Ruby**
|
4
4
|
|
@@ -87,7 +87,11 @@ Getting started
|
|
87
87
|
are not tracked by Git (optional):
|
88
88
|
|
89
89
|
```
|
90
|
-
coverage
|
90
|
+
echo "coverage" >> .gitignore
|
91
|
+
```
|
92
|
+
Or if you use Windows:
|
93
|
+
```
|
94
|
+
echo coverage >> .gitignore
|
91
95
|
```
|
92
96
|
|
93
97
|
If you're making a Rails application, SimpleCov comes with built-in configurations (see below for information on profiles)
|
@@ -133,17 +137,6 @@ to use SimpleCov with them. Here's an overview of the known ones:
|
|
133
137
|
|
134
138
|
<table>
|
135
139
|
<tr><th>Framework</th><th>Notes</th><th>Issue</th></tr>
|
136
|
-
<tr>
|
137
|
-
<th>
|
138
|
-
bootsnap
|
139
|
-
</th>
|
140
|
-
<td>
|
141
|
-
<a href="#want-to-use-bootsnap-with-simplecov">See section below.</a>
|
142
|
-
</td>
|
143
|
-
<td>
|
144
|
-
<a href="https://github.com/Shopify/bootsnap/issues/35">Shopify/bootsnap#35</a>
|
145
|
-
</td>
|
146
|
-
</tr>
|
147
140
|
<tr>
|
148
141
|
<th>
|
149
142
|
parallel_tests
|
@@ -630,41 +623,18 @@ Try [Coverband](https://github.com/danmayer/coverband).
|
|
630
623
|
|
631
624
|
If you're using [Spring](https://github.com/rails/spring) to speed up test suite runs and want to run SimpleCov along with them, you'll find that it often misreports coverage with the default config due to some sort of eager loading issue. Don't despair!
|
632
625
|
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
# For Rails
|
637
|
-
# Do not eager load code on boot
|
638
|
-
config.eager_load = false
|
639
|
-
```
|
640
|
-
2. Add your SimpleCov config, as you normally would, to your `spec_helper.rb`
|
641
|
-
(or `rails_helper.rb` for RSpec 3). If you have a `config/spring.rb` file
|
642
|
-
(or anything similar), add it to the start of such file. Here's a simple
|
643
|
-
version of what the config should look like:
|
644
|
-
|
645
|
-
```ruby
|
646
|
-
if ENV['RAILS_ENV'] == 'test'
|
647
|
-
require 'simplecov'
|
648
|
-
SimpleCov.start
|
649
|
-
end
|
650
|
-
```
|
651
|
-
3. Run `spring rspec <path>` as normal. Remember to run `spring stop` after
|
652
|
-
making important changes to your app or its specs!
|
653
|
-
|
654
|
-
## Want to use bootsnap with SimpleCov?
|
655
|
-
|
656
|
-
As mentioned in [this issue](https://github.com/Shopify/bootsnap/issues/35) iseq
|
657
|
-
loading/dumping doesn't work with coverage. Hence you need to deactivate it when
|
658
|
-
you run coverage so for instance when you use the environment `COVERAGE=true` to
|
659
|
-
decide that you want to gather coverage you can do:
|
626
|
+
One solution is to [explicitly call eager
|
627
|
+
load](https://github.com/colszowka/simplecov/issues/381#issuecomment-347651728)
|
628
|
+
in your `test_helper.rb` / `spec_helper.rb` after calling `SimpleCov.start`.
|
660
629
|
|
661
630
|
```ruby
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
)
|
631
|
+
require 'simplecov'
|
632
|
+
SimpleCov.start 'rails'
|
633
|
+
Rails.application.eager_load!
|
666
634
|
```
|
667
635
|
|
636
|
+
Or you could remove `gem 'spring'` from your `Gemfile`.
|
637
|
+
|
668
638
|
## Troubleshooting
|
669
639
|
|
670
640
|
The **most common problem is that simplecov isn't required and started before everything else**. In order to track coverage for your whole application **simplecov needs to be the first one** so that it (and the underlying coverage library) can subsequently track loaded files and their usage.
|
data/doc/alternate-formatters.md
CHANGED
@@ -10,6 +10,11 @@ If you have built or found one that is missing here, please send a Pull Request
|
|
10
10
|
|
11
11
|
A formatter that generates a coverage badge for use in your project's readme using ImageMagick.
|
12
12
|
|
13
|
+
#### [simplecov-small-badge](https://github.com/marcgrimme/simplecov-small-badge)
|
14
|
+
*by Marc Grimme*
|
15
|
+
|
16
|
+
A formatter that generates a small coverage badge for use in your project's readme using the SVG.
|
17
|
+
|
13
18
|
#### [simplecov-cobertura](https://github.com/dashingrocket/simplecov-cobertura)
|
14
19
|
*by Jesse Bowes*
|
15
20
|
|
data/lib/simplecov.rb
CHANGED
@@ -90,6 +90,7 @@ module SimpleCov
|
|
90
90
|
# If we're using merging of results, store the current result
|
91
91
|
# first (if there is one), then merge the results and return those
|
92
92
|
if use_merging
|
93
|
+
wait_for_other_processes
|
93
94
|
SimpleCov::ResultMerger.store_result(@result) if result?
|
94
95
|
@result = SimpleCov::ResultMerger.merged_result
|
95
96
|
end
|
@@ -199,11 +200,16 @@ module SimpleCov
|
|
199
200
|
|
200
201
|
SimpleCov.at_exit.call
|
201
202
|
|
202
|
-
|
203
|
+
# Don't modify the exit status unless the result has already been
|
204
|
+
# computed
|
205
|
+
exit_status = SimpleCov.process_result(SimpleCov.result, exit_status) if SimpleCov.result?
|
203
206
|
|
204
207
|
# Force exit with stored status (see github issue #5)
|
205
208
|
# unless it's nil or 0 (see github issue #281)
|
206
|
-
|
209
|
+
if exit_status && exit_status > 0
|
210
|
+
$stderr.printf("SimpleCov failed with exit %d", exit_status)
|
211
|
+
Kernel.exit exit_status
|
212
|
+
end
|
207
213
|
end
|
208
214
|
|
209
215
|
# @api private
|
@@ -212,7 +218,6 @@ module SimpleCov
|
|
212
218
|
# exit_status = SimpleCov.process_result(SimpleCov.result, exit_status)
|
213
219
|
#
|
214
220
|
def process_result(result, exit_status)
|
215
|
-
return exit_status unless SimpleCov.result? # Result has been computed
|
216
221
|
return exit_status if exit_status != SimpleCov::ExitCodes::SUCCESS # Existing errors
|
217
222
|
|
218
223
|
covered_percent = result.covered_percent.round(2)
|
@@ -220,7 +225,7 @@ module SimpleCov
|
|
220
225
|
if result_exit_status == SimpleCov::ExitCodes::SUCCESS # No result errors
|
221
226
|
write_last_run(covered_percent)
|
222
227
|
end
|
223
|
-
result_exit_status
|
228
|
+
final_result_process? ? result_exit_status : SimpleCov::ExitCodes::SUCCESS
|
224
229
|
end
|
225
230
|
|
226
231
|
# @api private
|
@@ -248,6 +253,21 @@ module SimpleCov
|
|
248
253
|
end
|
249
254
|
# rubocop:enable Metrics/MethodLength
|
250
255
|
|
256
|
+
#
|
257
|
+
# @api private
|
258
|
+
#
|
259
|
+
def final_result_process?
|
260
|
+
!defined?(ParallelTests) || ParallelTests.last_process?
|
261
|
+
end
|
262
|
+
|
263
|
+
#
|
264
|
+
# @api private
|
265
|
+
#
|
266
|
+
def wait_for_other_processes
|
267
|
+
return unless defined?(ParallelTests) && final_result_process?
|
268
|
+
ParallelTests.wait_for_other_processes_to_finish
|
269
|
+
end
|
270
|
+
|
251
271
|
#
|
252
272
|
# @api private
|
253
273
|
#
|
data/lib/simplecov/defaults.rb
CHANGED
@@ -6,12 +6,14 @@ require "pathname"
|
|
6
6
|
require "simplecov/profiles/root_filter"
|
7
7
|
require "simplecov/profiles/test_frameworks"
|
8
8
|
require "simplecov/profiles/bundler_filter"
|
9
|
+
require "simplecov/profiles/hidden_filter"
|
9
10
|
require "simplecov/profiles/rails"
|
10
11
|
|
11
12
|
# Default configuration
|
12
13
|
SimpleCov.configure do
|
13
14
|
formatter SimpleCov::Formatter::HTMLFormatter
|
14
15
|
load_profile "bundler_filter"
|
16
|
+
load_profile "hidden_filter"
|
15
17
|
# Exclude files outside of SimpleCov.root
|
16
18
|
load_profile "root_filter"
|
17
19
|
end
|
@@ -7,7 +7,7 @@ SimpleCov.profiles.define "rails" do
|
|
7
7
|
add_filter %r{^/db/}
|
8
8
|
|
9
9
|
add_group "Controllers", "app/controllers"
|
10
|
-
add_group "Channels", "app/channels"
|
10
|
+
add_group "Channels", "app/channels"
|
11
11
|
add_group "Models", "app/models"
|
12
12
|
add_group "Mailers", "app/mailers"
|
13
13
|
add_group "Helpers", "app/helpers"
|
@@ -84,7 +84,7 @@ module SimpleCov
|
|
84
84
|
|
85
85
|
# The path to this source file relative to the projects directory
|
86
86
|
def project_filename
|
87
|
-
@filename.sub(
|
87
|
+
@filename.sub(Regexp.new("^#{Regexp.escape(SimpleCov.root)}"), "")
|
88
88
|
end
|
89
89
|
|
90
90
|
# The source code for this file. Aliased as :source
|
data/lib/simplecov/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplecov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christoph Olszowka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -62,16 +62,128 @@ dependencies:
|
|
62
62
|
name: bundler
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- - "
|
65
|
+
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
67
|
+
version: '0'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- - "
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rake
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: rspec
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: test-unit
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: cucumber
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "<"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '3'
|
124
|
+
type: :development
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "<"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '3'
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: aruba
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - ">="
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
138
|
+
type: :development
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
145
|
+
- !ruby/object:Gem::Dependency
|
146
|
+
name: capybara
|
147
|
+
requirement: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - "<"
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '3'
|
152
|
+
type: :development
|
153
|
+
prerelease: false
|
154
|
+
version_requirements: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - "<"
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '3'
|
159
|
+
- !ruby/object:Gem::Dependency
|
160
|
+
name: phantomjs
|
161
|
+
requirement: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - ">="
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '0'
|
166
|
+
type: :development
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
requirements:
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: '0'
|
173
|
+
- !ruby/object:Gem::Dependency
|
174
|
+
name: poltergeist
|
175
|
+
requirement: !ruby/object:Gem::Requirement
|
176
|
+
requirements:
|
177
|
+
- - ">="
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '0'
|
180
|
+
type: :development
|
181
|
+
prerelease: false
|
182
|
+
version_requirements: !ruby/object:Gem::Requirement
|
183
|
+
requirements:
|
184
|
+
- - ">="
|
73
185
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
186
|
+
version: '0'
|
75
187
|
description: Code coverage for Ruby 1.9+ with a powerful configuration library and
|
76
188
|
automatic merging of coverage across test suites
|
77
189
|
email:
|
@@ -105,6 +217,7 @@ files:
|
|
105
217
|
- lib/simplecov/no_defaults.rb
|
106
218
|
- lib/simplecov/profiles.rb
|
107
219
|
- lib/simplecov/profiles/bundler_filter.rb
|
220
|
+
- lib/simplecov/profiles/hidden_filter.rb
|
108
221
|
- lib/simplecov/profiles/rails.rb
|
109
222
|
- lib/simplecov/profiles/root_filter.rb
|
110
223
|
- lib/simplecov/profiles/test_frameworks.rb
|
@@ -134,8 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
247
|
- !ruby/object:Gem::Version
|
135
248
|
version: '0'
|
136
249
|
requirements: []
|
137
|
-
|
138
|
-
rubygems_version: 2.6.13
|
250
|
+
rubygems_version: 3.0.1
|
139
251
|
signing_key:
|
140
252
|
specification_version: 4
|
141
253
|
summary: Code coverage for Ruby 1.9+ with a powerful configuration library and automatic
|