coverband 5.1.0 → 5.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +2 -2
- data/changes.md +2 -58
- data/coverband.gemspec +2 -0
- data/lib/coverband.rb +1 -0
- data/lib/coverband/adapters/null_store.rb +42 -0
- data/lib/coverband/utils/railtie.rb +2 -1
- data/lib/coverband/version.rb +2 -2
- data/roadmap.md +56 -0
- data/test/coverband/adapters/null_store_test.rb +39 -0
- data/test/unique_files.rb +3 -3
- metadata +11 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87c963a2d00531451c8759262e428dc9a6f46d136639672e4149550facf01da6
|
4
|
+
data.tar.gz: 26b11c7ad8c5fd3f1cd93167b5c9ee1d0118cd984f462702d593680d55995e99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51e48c5cb61f1dafc5b7f25c57d6a25ecea36579956267f99d1c9b4343a579d469c4d46e6ea32244ebbf91af08ed0dc427653a6aa0b2f1a245995751c2ec46c4
|
7
|
+
data.tar.gz: 25aad7fbe0940710f58f20a64cd2b6364151861ae239c88322253dd567ddb9e2986e8268ec7d3117c8f8de8218f18aa42d04c1dcb9613bdcacff0f157d8237c6
|
data/.github/workflows/main.yml
CHANGED
@@ -17,8 +17,8 @@ jobs:
|
|
17
17
|
# remove until I sort out CI issues for truffle
|
18
18
|
# truffleruby,
|
19
19
|
# truffleruby-head,
|
20
|
-
ruby: [2.3, 2.4, 2.5, 2.6, 2.7, jruby, jruby-head]
|
21
|
-
redis-version: [5]
|
20
|
+
ruby: [2.3, 2.4, 2.5, 2.6, 2.7, 3.0, jruby, jruby-head]
|
21
|
+
redis-version: [4, 5, 6]
|
22
22
|
runs-on: ${{ matrix.os }}-latest
|
23
23
|
steps:
|
24
24
|
- uses: actions/checkout@v2
|
data/changes.md
CHANGED
@@ -1,64 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
### Research Alternative Redis formats
|
4
|
-
|
5
|
-
- Look at alternative storage formats for Redis
|
6
|
-
- [redis bitmaps](http://blog.getspool.com/2011/11/29/fast-easy-realtime-metrics-using-redis-bitmaps/)
|
7
|
-
- [redis bitfield](https://stackoverflow.com/questions/47100606/optimal-way-to-store-array-of-integers-in-redis-database)
|
8
|
-
- Add support for [zadd](http://redis.io/topics/data-types-intro) so one could determine single call versus multiple calls on a line, letting us determine the most executed code in production.
|
9
|
-
|
10
|
-
### Coverband Future...
|
11
|
-
|
12
|
-
Will be the fully modern release that drops maintenance legacy support in favor of increased performance, ease of use, and maintainability.
|
13
|
-
|
14
|
-
- Release will be aimed as significantly simplifying ease of use
|
15
|
-
- near zero config setup for Rails apps
|
16
|
-
- add built-in support for easy loading via Railties
|
17
|
-
- built in support for activejob, sidekiq, and other common frameworks
|
18
|
-
- reduced configuration options
|
19
|
-
- support oneshot
|
20
|
-
- drop middleware figure out a way to kick off background without middelware
|
21
|
-
- options on reporting
|
22
|
-
- background reporting
|
23
|
-
- or middleware reporting
|
24
|
-
- Support for file versions
|
25
|
-
- md5 or release tags
|
26
|
-
- add coverage timerange support
|
27
|
-
- Drop Simplecov dependency
|
28
|
-
- improved web reporting
|
29
|
-
- lists current config options
|
30
|
-
- eventually allow updating remote config
|
31
|
-
- full theming
|
32
|
-
- list redis data dump for debugging
|
33
|
-
- additional adapters: Memcache, S3, and ActiveRecord
|
34
|
-
- add articles / podcasts like prontos readme https://github.com/prontolabs/pronto
|
35
|
-
- Add detailed Gem usage report, if we collect and send gem usage we can give percentage of gem code used, which should help application developers know when to remove gem dependencies (0%) or perhaps inline single methods for little usage (using <= 5%) for example.
|
36
|
-
- add meta data information first seen last recorded to the coverage report views (probably need to drop simplecov for that).
|
37
|
-
- more details in this issue: https://github.com/danmayer/coverband/issues/118
|
38
|
-
- Make good video on setup, install, usage
|
39
|
-
- See if we can add support for views / templates
|
40
|
-
- using this technique https://github.com/ioquatix/covered
|
41
|
-
- Better default grouping (could use groups features for gems for rails controllers, models, lib, etc)
|
42
|
-
- Improved logging for easier debugging and development
|
43
|
-
- drop the verbose mode and better support standard logger levels
|
44
|
-
- Possibly setup a build assets system
|
45
|
-
- my JS rules expanded the compressed JS at the top of application.js, basically we want to stitch together JS
|
46
|
-
- I guess we could also load multiple JS files as most of the JS is just default compressed JS and a tiny amount of actual app JS.
|
47
|
-
- lazy load for Coverband results
|
48
|
-
- view layer file coverage
|
49
|
-
- move all code to work with relative paths leaving only stdlib Coverage working on full paths
|
50
|
-
- add gem_safe_lists to track only some gems
|
51
|
-
- add gem_details_safe list to report on details on some gems
|
52
|
-
- - display gems that are in loaded with 0 coverage, thanks @kbaum
|
53
|
-
|
54
|
-
# Alpha / Beta / Release Candidates
|
55
|
-
|
56
|
-
### Coverband 5.0.4
|
1
|
+
### Coverband 5.1.0
|
57
2
|
|
3
|
+
- add support for dead method detection rake task
|
58
4
|
- add support for tracking email view templates/partials
|
59
5
|
|
60
|
-
# Released
|
61
|
-
|
62
6
|
### Coverband 5.0.3
|
63
7
|
|
64
8
|
- fix for non standard root paths for view_tracker thx @markshawtoronto
|
data/coverband.gemspec
CHANGED
@@ -20,6 +20,8 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
21
21
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
22
22
|
spec.require_paths = %w[lib]
|
23
|
+
|
24
|
+
spec.required_ruby_version = '>= 2.3'
|
23
25
|
|
24
26
|
spec.add_development_dependency "benchmark-ips"
|
25
27
|
spec.add_development_dependency "capybara"
|
data/lib/coverband.rb
CHANGED
@@ -13,6 +13,7 @@ require "coverband/adapters/redis_store"
|
|
13
13
|
require "coverband/adapters/hash_redis_store"
|
14
14
|
require "coverband/adapters/file_store"
|
15
15
|
require "coverband/adapters/stdout_store"
|
16
|
+
require "coverband/adapters/null_store"
|
16
17
|
require "coverband/utils/file_hasher"
|
17
18
|
require "coverband/collectors/coverage"
|
18
19
|
require "coverband/collectors/view_tracker"
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Coverband
|
4
|
+
module Adapters
|
5
|
+
###
|
6
|
+
# NullStore is for benchmarking the impacts of calculating
|
7
|
+
# and storing coverage data independant of Coverband/Coverage
|
8
|
+
#
|
9
|
+
# Usage:
|
10
|
+
# config.store = Coverband::Adapters::NullStore.new
|
11
|
+
###
|
12
|
+
class NullStore < Base
|
13
|
+
def initialize(_opts = {})
|
14
|
+
super()
|
15
|
+
end
|
16
|
+
|
17
|
+
def clear!
|
18
|
+
# NOOP
|
19
|
+
end
|
20
|
+
|
21
|
+
def size
|
22
|
+
0
|
23
|
+
end
|
24
|
+
|
25
|
+
def migrate!
|
26
|
+
raise NotImplementedError, "NullStore doesn't support migrations"
|
27
|
+
end
|
28
|
+
|
29
|
+
def coverage(_local_type = nil)
|
30
|
+
{}
|
31
|
+
end
|
32
|
+
|
33
|
+
def save_report(report)
|
34
|
+
# NOOP
|
35
|
+
end
|
36
|
+
|
37
|
+
def raw_store
|
38
|
+
raise NotImplementedError, "NullStore doesn't support raw_store"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -21,7 +21,7 @@ module Coverband
|
|
21
21
|
|
22
22
|
config.after_initialize do
|
23
23
|
unless Coverband.tasks_to_ignore?
|
24
|
-
Coverband.configure
|
24
|
+
Coverband.configure unless Coverband.configured?
|
25
25
|
Coverband.eager_loading_coverage!
|
26
26
|
Coverband.report_coverage
|
27
27
|
Coverband.runtime_coverage!
|
@@ -50,6 +50,7 @@ module Coverband
|
|
50
50
|
config.before_configuration do
|
51
51
|
unless ENV["COVERBAND_DISABLE_AUTO_START"]
|
52
52
|
begin
|
53
|
+
Coverband.configure unless Coverband.configured?
|
53
54
|
Coverband.start
|
54
55
|
rescue Redis::CannotConnectError => error
|
55
56
|
Coverband.configuration.logger.info "Redis is not available (#{error}), Coverband not configured"
|
data/lib/coverband/version.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
###
|
4
4
|
# ensure we properly do release candidate versioning; https://github.com/danmayer/coverband/issues/288
|
5
|
-
# use format
|
5
|
+
# use format "4.2.1.rc.1" ~> 4.2.1.rc to prerelease versions like v4.2.1.rc.2 and v4.2.1.rc.3
|
6
6
|
###
|
7
7
|
module Coverband
|
8
|
-
VERSION = '5.1.
|
8
|
+
VERSION = '5.1.1'
|
9
9
|
end
|
data/roadmap.md
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
# Future Roadmap
|
2
|
+
|
3
|
+
### Research Alternative Redis formats
|
4
|
+
|
5
|
+
- Look at alternative storage formats for Redis
|
6
|
+
- [redis bitmaps](http://blog.getspool.com/2011/11/29/fast-easy-realtime-metrics-using-redis-bitmaps/)
|
7
|
+
- [redis bitfield](https://stackoverflow.com/questions/47100606/optimal-way-to-store-array-of-integers-in-redis-database)
|
8
|
+
- Add support for [zadd](http://redis.io/topics/data-types-intro) so one could determine single call versus multiple calls on a line, letting us determine the most executed code in production.
|
9
|
+
|
10
|
+
### Coverband Future...
|
11
|
+
|
12
|
+
Will be the fully modern release that drops maintenance legacy support in favor of increased performance, ease of use, and maintainability.
|
13
|
+
|
14
|
+
- Release will be aimed as significantly simplifying ease of use
|
15
|
+
- near zero config setup for Rails apps
|
16
|
+
- add built-in support for easy loading via Railties
|
17
|
+
- built in support for activejob, sidekiq, and other common frameworks
|
18
|
+
- reduced configuration options
|
19
|
+
- support oneshot
|
20
|
+
- drop middleware figure out a way to kick off background without middelware
|
21
|
+
- options on reporting
|
22
|
+
- background reporting
|
23
|
+
- or middleware reporting
|
24
|
+
- Support for file versions
|
25
|
+
- md5 or release tags
|
26
|
+
- add coverage timerange support
|
27
|
+
- Drop Simplecov dependency
|
28
|
+
- improved web reporting
|
29
|
+
- lists current config options
|
30
|
+
- eventually allow updating remote config
|
31
|
+
- full theming
|
32
|
+
- list redis data dump for debugging
|
33
|
+
- additional adapters: Memcache, S3, and ActiveRecord
|
34
|
+
- add articles / podcasts like prontos readme https://github.com/prontolabs/pronto
|
35
|
+
- Add detailed Gem usage report, if we collect and send gem usage we can give percentage of gem code used, which should help application developers know when to remove gem dependencies (0%) or perhaps inline single methods for little usage (using <= 5%) for example.
|
36
|
+
- add meta data information first seen last recorded to the coverage report views (probably need to drop simplecov for that).
|
37
|
+
- more details in this issue: https://github.com/danmayer/coverband/issues/118
|
38
|
+
- Make good video on setup, install, usage
|
39
|
+
- See if we can add support for views / templates
|
40
|
+
- using this technique https://github.com/ioquatix/covered
|
41
|
+
- Better default grouping (could use groups features for gems for rails controllers, models, lib, etc)
|
42
|
+
- Improved logging for easier debugging and development
|
43
|
+
- drop the verbose mode and better support standard logger levels
|
44
|
+
- Possibly setup a build assets system
|
45
|
+
- my JS rules expanded the compressed JS at the top of application.js, basically we want to stitch together JS
|
46
|
+
- I guess we could also load multiple JS files as most of the JS is just default compressed JS and a tiny amount of actual app JS.
|
47
|
+
- lazy load for Coverband results
|
48
|
+
- view layer file coverage
|
49
|
+
- move all code to work with relative paths leaving only stdlib Coverage working on full paths
|
50
|
+
- add gem_safe_lists to track only some gems
|
51
|
+
- add gem_details_safe list to report on details on some gems
|
52
|
+
- - display gems that are in loaded with 0 coverage, thanks @kbaum
|
53
|
+
|
54
|
+
# Alpha / Beta / Release Candidates
|
55
|
+
|
56
|
+
### Coverband 5.?.?
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require File.expand_path("../../test_helper", File.dirname(__FILE__))
|
4
|
+
|
5
|
+
class AdaptersNullStoreTest < Minitest::Test
|
6
|
+
def test_covered_lines_when_no_file
|
7
|
+
@store = Coverband::Adapters::NullStore.new("")
|
8
|
+
expected = {}
|
9
|
+
assert_equal expected, @store.coverage
|
10
|
+
end
|
11
|
+
|
12
|
+
describe "Coverband::Adapters::NullStore" do
|
13
|
+
def setup
|
14
|
+
super
|
15
|
+
@store = Coverband::Adapters::NullStore.new(@test_file_path)
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_coverage
|
19
|
+
assert_equal @store.coverage, {}
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_covered_lines_when_null
|
23
|
+
assert_nil @store.coverage["none.rb"]
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_covered_files
|
27
|
+
assert_equal @store.covered_files.include?("dog.rb"), false
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_clear
|
31
|
+
assert_nil @store.clear!
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_save_report
|
35
|
+
@store.send(:save_report, "cat.rb" => [0, 1])
|
36
|
+
assert_equal @store.coverage, {}
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/test/unique_files.rb
CHANGED
@@ -20,10 +20,10 @@ def require_unique_file(file = "dog.rb", variables = {})
|
|
20
20
|
Coverband::Utils::RelativeFileConverter.convert(File.expand_path(temp_file))
|
21
21
|
end
|
22
22
|
|
23
|
-
@@dogs = 0
|
24
23
|
def require_class_unique_file
|
25
|
-
|
26
|
-
|
24
|
+
@dogs ||= 0
|
25
|
+
@dogs += 1
|
26
|
+
require_unique_file("dog.rb.erb", dog_number: @dogs)
|
27
27
|
end
|
28
28
|
|
29
29
|
def remove_unique_files
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coverband
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.1.
|
4
|
+
version: 5.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Mayer
|
8
8
|
- Karl Baum
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-08-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: benchmark-ips
|
@@ -293,6 +293,7 @@ files:
|
|
293
293
|
- lib/coverband/adapters/base.rb
|
294
294
|
- lib/coverband/adapters/file_store.rb
|
295
295
|
- lib/coverband/adapters/hash_redis_store.rb
|
296
|
+
- lib/coverband/adapters/null_store.rb
|
296
297
|
- lib/coverband/adapters/redis_store.rb
|
297
298
|
- lib/coverband/adapters/stdout_store.rb
|
298
299
|
- lib/coverband/adapters/web_service_store.rb
|
@@ -358,6 +359,7 @@ files:
|
|
358
359
|
- public/images/ui-icons_cd0a0a_256x240.png
|
359
360
|
- public/loading.gif
|
360
361
|
- public/magnify.png
|
362
|
+
- roadmap.md
|
361
363
|
- test/benchmarks/.gitignore
|
362
364
|
- test/benchmarks/benchmark.rake
|
363
365
|
- test/benchmarks/coverage_fork.sh
|
@@ -368,6 +370,7 @@ files:
|
|
368
370
|
- test/coverband/adapters/base_test.rb
|
369
371
|
- test/coverband/adapters/file_store_test.rb
|
370
372
|
- test/coverband/adapters/hash_redis_store_test.rb
|
373
|
+
- test/coverband/adapters/null_store_test.rb
|
371
374
|
- test/coverband/adapters/redis_store_test.rb
|
372
375
|
- test/coverband/adapters/web_service_store_test.rb
|
373
376
|
- test/coverband/at_exit_test.rb
|
@@ -473,7 +476,7 @@ homepage: https://github.com/danmayer/coverband
|
|
473
476
|
licenses:
|
474
477
|
- MIT
|
475
478
|
metadata: {}
|
476
|
-
post_install_message:
|
479
|
+
post_install_message:
|
477
480
|
rdoc_options: []
|
478
481
|
require_paths:
|
479
482
|
- lib
|
@@ -481,15 +484,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
481
484
|
requirements:
|
482
485
|
- - ">="
|
483
486
|
- !ruby/object:Gem::Version
|
484
|
-
version: '
|
487
|
+
version: '2.3'
|
485
488
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
486
489
|
requirements:
|
487
490
|
- - ">="
|
488
491
|
- !ruby/object:Gem::Version
|
489
492
|
version: '0'
|
490
493
|
requirements: []
|
491
|
-
rubygems_version: 3.
|
492
|
-
signing_key:
|
494
|
+
rubygems_version: 3.2.3
|
495
|
+
signing_key:
|
493
496
|
specification_version: 4
|
494
497
|
summary: Rack middleware to measure production code usage (LOC runtime usage)
|
495
498
|
test_files:
|
@@ -503,6 +506,7 @@ test_files:
|
|
503
506
|
- test/coverband/adapters/base_test.rb
|
504
507
|
- test/coverband/adapters/file_store_test.rb
|
505
508
|
- test/coverband/adapters/hash_redis_store_test.rb
|
509
|
+
- test/coverband/adapters/null_store_test.rb
|
506
510
|
- test/coverband/adapters/redis_store_test.rb
|
507
511
|
- test/coverband/adapters/web_service_store_test.rb
|
508
512
|
- test/coverband/at_exit_test.rb
|