coverband 4.2.5.rc.2 → 5.0.0.rc.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.standard.yml +25 -0
- data/.travis.yml +2 -1
- data/Gemfile +5 -7
- data/Gemfile.rails4 +0 -3
- data/Gemfile.rails6 +0 -3
- data/README.md +24 -77
- data/Rakefile +17 -17
- data/changes.md +26 -30
- data/config.ru +1 -1
- data/coverband.gemspec +29 -34
- data/lib/alternative_coverband_patch.rb +5 -0
- data/lib/coverband.rb +55 -43
- data/lib/coverband/adapters/base.rb +17 -17
- data/lib/coverband/adapters/file_store.rb +2 -2
- data/lib/coverband/adapters/hash_redis_store.rb +24 -21
- data/lib/coverband/adapters/redis_store.rb +12 -12
- data/lib/coverband/at_exit.rb +1 -1
- data/lib/coverband/collectors/coverage.rb +15 -27
- data/lib/coverband/collectors/delta.rb +19 -9
- data/lib/coverband/collectors/view_tracker.rb +19 -11
- data/lib/coverband/configuration.rb +48 -84
- data/lib/coverband/integrations/background.rb +3 -3
- data/lib/coverband/integrations/rack_server_check.rb +3 -3
- data/lib/coverband/integrations/resque.rb +13 -1
- data/lib/coverband/reporters/base.rb +10 -10
- data/lib/coverband/reporters/console_report.rb +1 -1
- data/lib/coverband/reporters/html_report.rb +10 -30
- data/lib/coverband/reporters/web.rb +56 -49
- data/lib/coverband/utils/absolute_file_converter.rb +6 -6
- data/lib/coverband/utils/html_formatter.rb +32 -61
- data/lib/coverband/utils/railtie.rb +16 -4
- data/lib/coverband/utils/relative_file_converter.rb +2 -2
- data/lib/coverband/utils/result.rb +6 -11
- data/lib/coverband/utils/results.rb +0 -10
- data/lib/coverband/utils/source_file.rb +21 -30
- data/lib/coverband/utils/tasks.rb +7 -11
- data/lib/coverband/version.rb +1 -1
- data/public/application.js +0 -30
- data/test/benchmarks/benchmark.rake +97 -92
- data/test/benchmarks/dog.rb +1 -1
- data/test/benchmarks/init_rails.rake +4 -4
- data/test/coverband/adapters/base_test.rb +29 -30
- data/test/coverband/adapters/file_store_test.rb +15 -16
- data/test/coverband/adapters/hash_redis_store_test.rb +57 -57
- data/test/coverband/adapters/redis_store_test.rb +26 -26
- data/test/coverband/at_exit_test.rb +2 -2
- data/test/coverband/collectors/coverage_test.rb +33 -47
- data/test/coverband/collectors/delta_test.rb +51 -23
- data/test/coverband/collectors/view_tracker_test.rb +35 -35
- data/test/coverband/configuration_test.rb +27 -53
- data/test/coverband/coverband_test.rb +11 -11
- data/test/coverband/integrations/background_middleware_test.rb +10 -10
- data/test/coverband/integrations/background_test.rb +3 -2
- data/test/coverband/integrations/rack_server_check_test.rb +7 -7
- data/test/coverband/integrations/report_middleware_test.rb +9 -9
- data/test/coverband/integrations/resque_worker_test.rb +9 -9
- data/test/coverband/integrations/test_resque_job.rb +1 -1
- data/test/coverband/reporters/base_test.rb +9 -9
- data/test/coverband/reporters/console_test.rb +6 -6
- data/test/coverband/reporters/html_test.rb +36 -48
- data/test/coverband/reporters/web_test.rb +16 -18
- data/test/coverband/utils/absolute_file_converter_test.rb +22 -22
- data/test/coverband/utils/file_hasher_test.rb +6 -12
- data/test/coverband/utils/file_list_test.rb +13 -13
- data/test/coverband/utils/html_formatter_test.rb +9 -23
- data/test/coverband/utils/lines_classifier_test.rb +29 -29
- data/test/coverband/utils/relative_file_converter_test.rb +13 -13
- data/test/coverband/utils/result_test.rb +18 -18
- data/test/coverband/utils/results_test.rb +17 -17
- data/test/coverband/utils/source_file_line_test.rb +46 -46
- data/test/coverband/utils/source_file_test.rb +38 -88
- data/test/dog.rb +1 -1
- data/test/fake_app/basic_rack.rb +2 -2
- data/test/fixtures/app/controllers/sample_controller.rb +1 -1
- data/test/fixtures/app/models/user.rb +1 -1
- data/test/fixtures/sample.rb +1 -1
- data/test/fixtures/utf-8.rb +0 -2
- data/test/forked/rails_full_stack_test.rb +24 -27
- data/test/forked/rails_rake_full_stack_test.rb +7 -26
- data/test/integration/full_stack_test.rb +11 -22
- data/test/jruby_check.rb +2 -3
- data/test/rails4_dummy/Rakefile +1 -1
- data/test/rails4_dummy/config.ru +1 -1
- data/test/rails4_dummy/config/application.rb +4 -4
- data/test/rails4_dummy/config/boot.rb +2 -2
- data/test/rails4_dummy/config/coverband.rb +1 -1
- data/test/rails4_dummy/config/coverband_missing_redis.rb +1 -1
- data/test/rails4_dummy/config/environment.rb +1 -1
- data/test/rails4_dummy/config/routes.rb +2 -2
- data/test/rails5_dummy/Rakefile +1 -1
- data/test/rails5_dummy/config.ru +1 -1
- data/test/rails5_dummy/config/application.rb +3 -3
- data/test/rails5_dummy/config/coverband.rb +8 -8
- data/test/rails5_dummy/config/coverband_missing_redis.rb +8 -8
- data/test/rails5_dummy/config/environment.rb +1 -1
- data/test/rails5_dummy/config/routes.rb +2 -2
- data/test/rails6_dummy/Rakefile +1 -1
- data/test/rails6_dummy/config.ru +1 -1
- data/test/rails6_dummy/config/application.rb +4 -4
- data/test/rails6_dummy/config/boot.rb +2 -2
- data/test/rails6_dummy/config/coverband.rb +1 -1
- data/test/rails6_dummy/config/coverband_missing_redis.rb +1 -1
- data/test/rails6_dummy/config/environment.rb +1 -1
- data/test/rails6_dummy/config/routes.rb +2 -2
- data/test/rails_test_helper.rb +11 -11
- data/test/test_helper.rb +41 -34
- data/test/unique_files.rb +10 -10
- data/views/layout.erb +2 -12
- metadata +5 -43
- data/.rubocop.yml +0 -84
- data/lib/coverband/integrations/bundler.rb +0 -8
- data/lib/coverband/utils/file_groups.rb +0 -53
- data/lib/coverband/utils/gem_list.rb +0 -31
- data/lib/coverband/utils/s3_report.rb +0 -105
- data/test/coverband/utils/file_groups_test.rb +0 -61
- data/test/coverband/utils/gem_list_test.rb +0 -48
- data/test/coverband/utils/s3_report_test.rb +0 -44
- data/views/gem_list.erb +0 -63
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c59cff2fa063db7a0c165e9cfefa8607151ee39699bf57cbb6bb6fce849abe97
|
4
|
+
data.tar.gz: 6fedd5cc2efd695370b3136f293209184b8c633e093ae75ac2f7d083c1eec13d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75740ba292febb787cbb40beaa47b1a355d9303b23b43fc949d77f918848497fca538e080e86baf5d898b4a5001a9a838ed64846cb5a039a6aaa2a300f39edf0
|
7
|
+
data.tar.gz: 6ed03c519ee7a4a5d24f6399c8a1a747d2de58d0a6370575f72bed528a18cd4d24c941c6e7f60902ced21883e4f664158a91881b3518577722323cb5cc5b904c
|
data/.standard.yml
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
ruby_version: 2.3
|
2
|
+
fix: false # default: false
|
3
|
+
parallel: true # default: false
|
4
|
+
format: progress # default: Standard::Formatter
|
5
|
+
default_ignores: false # default: true
|
6
|
+
|
7
|
+
ignore: # default: []
|
8
|
+
- "lib/**/*":
|
9
|
+
- Style/IdenticalConditionalBranches # these are just easier to read sometimes
|
10
|
+
- Style/IfInsideElse # these are just easier to read sometimes
|
11
|
+
- Standard/SemanticBlocks # not valid in older Ruby
|
12
|
+
- Style/Alias # This isn't always right and alias and alias_method can have different usage
|
13
|
+
- Style/RedundantRegexpEscape # fix later, enforcement changed
|
14
|
+
- Layout/ArrayAlignment # WTF all of master broken from a few changes in rubo
|
15
|
+
- Performance/RegexpMatch # Rubocop / standardrb have this WRONG for Ruby 2.3/2.4 not compatiable
|
16
|
+
- "vendor/**/*"
|
17
|
+
- "pkg/**/*"
|
18
|
+
- "test/**/*":
|
19
|
+
- Layout/AlignHash
|
20
|
+
- Style/GlobalVars
|
21
|
+
- Lint/InterpolationCheck # a test is verifying comments
|
22
|
+
- Standard/SemanticBlocks # not valid in older Ruby
|
23
|
+
- Layout/ArrayAlignment # ruby 2.3 / modern seem to dissagree on rubocop/standardrb
|
24
|
+
- "test/benchmarks/benchmark.rake":
|
25
|
+
- Lint/UselessAssignment # oddity of memory benchmarking
|
data/.travis.yml
CHANGED
@@ -15,6 +15,7 @@ env:
|
|
15
15
|
# --dev improves JRuby startup time
|
16
16
|
# See https://github.com/jruby/jruby/wiki/Improving-startup-time
|
17
17
|
- JRUBY_OPTS="--dev"
|
18
|
+
- JAVA_OPTS="--add-opens java.base/{java.security.cert=ALL-UNNAMED --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.util.zip=ALL-UNNAMED"
|
18
19
|
|
19
20
|
jobs:
|
20
21
|
exclude:
|
@@ -36,7 +37,7 @@ services:
|
|
36
37
|
script:
|
37
38
|
- sudo ./lua/install.sh
|
38
39
|
- $HOME/lua51/bin/busted lua/test/*
|
39
|
-
- bundle exec
|
40
|
+
- bundle exec standardrb
|
40
41
|
- COVERBAND_HASH_REDIS_STORE=t bundle exec rake
|
41
42
|
- COVERBAND_HASH_REDIS_STORE=t bundle exec rake forked_tests
|
42
43
|
- bundle exec rake
|
data/Gemfile
CHANGED
@@ -1,21 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
source
|
3
|
+
source "https://rubygems.org"
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in coverband.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
8
|
# add when debugging
|
9
9
|
# require 'byebug'; byebug
|
10
|
-
if ENV[
|
10
|
+
if ENV["CI"]
|
11
11
|
# skipping pry-byebug as it has issues on Ruby 2.3 on travis
|
12
12
|
# and we don't really need it on CI
|
13
13
|
else
|
14
|
-
gem
|
14
|
+
gem "pry-byebug", platforms: [:mri, :mingw, :x64_mingw]
|
15
15
|
end
|
16
16
|
|
17
|
-
gem
|
17
|
+
gem "rails", "~>5"
|
18
18
|
# these gems are used for testing gem tracking
|
19
|
-
gem
|
20
|
-
gem 'pundit'
|
21
|
-
gem 'rainbow', require: false
|
19
|
+
gem "irb", require: false
|
data/Gemfile.rails4
CHANGED
data/Gemfile.rails6
CHANGED
data/README.md
CHANGED
@@ -30,7 +30,6 @@ The primary goal of Coverband is giving deep insight into your production runtim
|
|
30
30
|
- Out of the box support for all standard code execution paths (web, cron, background jobs, rake tasks, etc)
|
31
31
|
- Splits load time (Rails eager load) and Run time metrics
|
32
32
|
- Easy to understand actionable insights from the report
|
33
|
-
- Tracks Gem usage (still in experimental stages and not recommended for production)
|
34
33
|
- Development mode, offers deep insight of code usage details (number of LOC execution during single request, etc) during development.
|
35
34
|
- Mountable web interface to easily share reports
|
36
35
|
|
@@ -54,8 +53,6 @@ Add this line to your application's `Gemfile`, remember to `bundle install` afte
|
|
54
53
|
gem 'coverband'
|
55
54
|
```
|
56
55
|
|
57
|
-
If [tracking gem usage](#collecting-gem--library-usage), be sure to include coverband before other gems you would like to track.
|
58
|
-
|
59
56
|
## Upgrading to Latest
|
60
57
|
|
61
58
|
### No custom code or middleware required
|
@@ -66,7 +63,7 @@ See [changelog](https://github.com/danmayer/coverband/blob/master/changes.md).
|
|
66
63
|
|
67
64
|
## Rails
|
68
65
|
|
69
|
-
The Railtie integration means you shouldn't need to do anything else other than ensure
|
66
|
+
The Railtie integration means you shouldn't need to do anything else other than ensure Coverband is required after Rails within your Gemfile.
|
70
67
|
|
71
68
|
## Sinatra
|
72
69
|
|
@@ -117,14 +114,14 @@ The web endpoint is a barebones endpoint that you can either expose direct (afte
|
|
117
114
|
|
118
115
|
### JRuby Support
|
119
116
|
|
120
|
-
Coverband is compatible with JRuby. If you want to run on JRuby note that I haven't benchmarked and I believe the perf impact on
|
117
|
+
Coverband is compatible with JRuby. If you want to run on JRuby note that I haven't benchmarked and I believe the perf impact on older versions of JRuby could be significant, improved Coverage support is in [JRuby master](https://github.com/jruby/jruby/pull/6180), and will be in the next release.
|
121
118
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
119
|
+
- older versions of JRuby need tracing enabled to work (and this could cause bad performance)
|
120
|
+
- run Jruby with the `--debug` option
|
121
|
+
- add into your `.jrubyrc` the `debug.fullTrace=true` setting
|
122
|
+
- For best performance the `oneshot_lines` is recommended, and in the latest releases should have very low overhead
|
123
|
+
- See JRuby support in a Rails app configured to run via JRuby, in [Coverband Demo](https://github.com/coverband-service/coverband_demo)
|
124
|
+
- JRuby is tested via CI against Rails 5 and 6
|
128
125
|
|
129
126
|
### Rake Tasks
|
130
127
|
|
@@ -168,11 +165,6 @@ Below is an example config file for a Rails 5 app:
|
|
168
165
|
Coverband.configure do |config|
|
169
166
|
config.store = Coverband::Adapters::RedisStore.new(Redis.new(url: ENV['MY_REDIS_URL']))
|
170
167
|
config.logger = Rails.logger
|
171
|
-
# configure S3 integration
|
172
|
-
config.s3_bucket = 'coverband-demo'
|
173
|
-
config.s3_region = 'us-east-1'
|
174
|
-
config.s3_access_key_id = ENV['AWS_ACCESS_KEY_ID']
|
175
|
-
config.s3_secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
|
176
168
|
|
177
169
|
# config options false, true. (defaults to false)
|
178
170
|
# true and debug can give helpful and interesting code usage information
|
@@ -228,27 +220,6 @@ To opt-in to this feature... enable the feature in your Coverband config.
|
|
228
220
|
|
229
221
|
![image](https://raw.github.com/danmayer/coverband/master/docs/coverband_view_tracker.png)
|
230
222
|
|
231
|
-
### Writing Coverband Results to S3
|
232
|
-
|
233
|
-
If you add some additional Coverband configuration your coverage html report will be written directly to S3, update `config/coverband.rb` like below.
|
234
|
-
|
235
|
-
```
|
236
|
-
# configure S3 integration
|
237
|
-
config.s3_bucket = 'coverband-demo'
|
238
|
-
config.s3_region = 'us-east-1'
|
239
|
-
config.s3_access_key_id = ENV['AWS_ACCESS_KEY_ID']
|
240
|
-
config.s3_secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
|
241
|
-
```
|
242
|
-
|
243
|
-
Alternatively, Coverband if you don't set via the `config.s3_*` accessor methods will look for the standard S3 environment variables.
|
244
|
-
|
245
|
-
```
|
246
|
-
ENV['AWS_BUCKET']
|
247
|
-
ENV['AWS_REGION']
|
248
|
-
ENV['AWS_ACCESS_KEY_ID']
|
249
|
-
ENV['AWS_SECRET_ACCESS_KEY']
|
250
|
-
```
|
251
|
-
|
252
223
|
### Fixing Coverage Only Shows Loading Hits
|
253
224
|
|
254
225
|
If all your coverage is being counted as loading or eager_loading coverage, and nothing is showing as runtime Coverage the initialization hook failed for some reason. The most likely reason for this issue is manually calling `eager_load!` on some Plugin/Gem. If you or a plugin is altering the Rails initialization process, you can manually flip Coverband to runtime coverage by calling these two lines, in an `after_initialize` block, in `application.rb`.
|
@@ -322,46 +293,6 @@ rake coverband:clear # reset coverband coverage data
|
|
322
293
|
rake coverband:coverage # report runtime coverband code coverage
|
323
294
|
```
|
324
295
|
|
325
|
-
### Collecting Gem / Library Usage
|
326
|
-
|
327
|
-
**WARNING:** Gem Tracking is still in experimental stages and not recommended for production. We have some performance issues when view reports on large applications. Gem tracing also during background thread data collection has HIGH memory requirements, during report merging (seemingly around 128mb of extra memory, which is crazy). We recommend deploying WITHOUT `track_gems` first and only enabling it after confirming that Coverband is working and performing well.
|
328
|
-
|
329
|
-
Gem usage can be tracked by enabling the `track_gems` config.
|
330
|
-
|
331
|
-
```
|
332
|
-
Coverband.configure do |config|
|
333
|
-
config.track_gems = true
|
334
|
-
end
|
335
|
-
```
|
336
|
-
|
337
|
-
The `track_gems` feature exposes a Gems tab in the report which prints out the percentage usage of each Gem. See demo [here](https://coverband-demo.herokuapp.com/coverage?#_Gems).
|
338
|
-
|
339
|
-
When tracking gems, it is important that `Coverband#start` is called before the gems to be tracked are required. The best way to do this is to require coverband before Bundle.require is called. Within rails, require coverband within the application.rb like so:
|
340
|
-
|
341
|
-
```ruby
|
342
|
-
require 'coverband'
|
343
|
-
Bundler.require(*Rails.groups)
|
344
|
-
```
|
345
|
-
|
346
|
-
If you are using the resque integration, resque needs to be required before coverband since the integration will not run unless resque is loaded. Within the application.rb just require resque before coverband.
|
347
|
-
|
348
|
-
```ruby
|
349
|
-
require 'resque'
|
350
|
-
require 'coverband'
|
351
|
-
Bundler.require(*Rails.groups)
|
352
|
-
```
|
353
|
-
|
354
|
-
The track_gems config only exposes the overall usage of a gem. In order to see the detail of each file, enable the `gem_details` flag.
|
355
|
-
|
356
|
-
```
|
357
|
-
Coverband.configure do |config|
|
358
|
-
config.track_gems = true
|
359
|
-
config.gem_details = true
|
360
|
-
end
|
361
|
-
```
|
362
|
-
|
363
|
-
This flag exposes line by line usage of gem files. Unfortunately due to the way the coverband report is currently rendered, enabling `gem_details` slows down viewing of the coverage report in the browser and is not yet recommended.
|
364
|
-
|
365
296
|
### Manually Starting Coverband
|
366
297
|
|
367
298
|
Coverband starts on require of the the library which is usually done within the Gemfile. This can be disabled by setting the `COVERBAND_DISABLE_AUTO_START` environment variable. This environment variable can be useful to toggle coverband on and off in certain environments.
|
@@ -381,6 +312,22 @@ Note: To debug issues getting Coverband working. I recommend running in developm
|
|
381
312
|
|
382
313
|
If you are trying to debug locally wondering what code is being run during a request. The verbose modes `config.verbose = true` && `Rails.logger.level = :debug`. With true set it will output the number of lines executed per file, to the passed in log.
|
383
314
|
|
315
|
+
### Solving: stack level too deep errors
|
316
|
+
|
317
|
+
If you start seeing SystemStackError: stack level too deep errors from background jobs after installing Coverband, this means there is another patch for ResqueWorker that conflicts with Coverband's patch in your application. To fix this, change coverband gem line in your Gemfile to the following:
|
318
|
+
|
319
|
+
```
|
320
|
+
gem 'coverband', require: ['alternative_coverband_patch', 'coverband']
|
321
|
+
```
|
322
|
+
|
323
|
+
If you currently have require: false, remove the 'coverband' string from the require array above so the gem line becomes like this:
|
324
|
+
|
325
|
+
```
|
326
|
+
gem 'coverband', require: ['alternative_coverband_patch']
|
327
|
+
```
|
328
|
+
|
329
|
+
This conflict happens when a ruby method is patched twice, once using module prepend, and once using method aliasing. See this ruby issue for details. The fix is to apply all patches the same way. Coverband by default will apply its patch using prepend, but you can change that to method aliasing by adding require: ['alternative_coverband_patch'] to the gem line as shown above.
|
330
|
+
|
384
331
|
# Prerequisites
|
385
332
|
|
386
333
|
- Coverband 3.0.X+ requires Ruby 2.3+
|
data/Rakefile
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
import
|
5
|
-
require
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
import "test/benchmarks/benchmark.rake"
|
5
|
+
require "rubocop/rake_task"
|
6
6
|
|
7
7
|
RuboCop::RakeTask.new
|
8
8
|
|
@@ -11,40 +11,40 @@ task default: %i[test]
|
|
11
11
|
task 'test:all': %i[rubocop test forked_tests benchmarks:memory benchmarks]
|
12
12
|
|
13
13
|
task :test
|
14
|
-
require
|
14
|
+
require "rake/testtask"
|
15
15
|
Rake::TestTask.new(:test) do |test|
|
16
|
-
test.libs <<
|
16
|
+
test.libs << "lib" << "test"
|
17
17
|
# exclude benchmark from the tests as the way it functions resets code coverage during executions
|
18
18
|
# test.pattern = 'test/unit/*_test.rb'
|
19
19
|
# using test files opposed to pattern as it outputs which files are run
|
20
|
-
test.test_files = FileList[
|
20
|
+
test.test_files = FileList["test/integration/**/*_test.rb", "test/coverband/**/*_test.rb"]
|
21
21
|
test.verbose = true
|
22
22
|
end
|
23
23
|
|
24
24
|
Rake::TestTask.new(:forked_tests) do |test|
|
25
|
-
if RUBY_PLATFORM ==
|
26
|
-
puts
|
25
|
+
if RUBY_PLATFORM == "java"
|
26
|
+
puts "forked tests not supported on JRuby"
|
27
27
|
else
|
28
|
-
test.libs <<
|
29
|
-
test.test_files = FileList[
|
28
|
+
test.libs << "lib" << "test"
|
29
|
+
test.test_files = FileList["test/forked/**/*_test.rb"]
|
30
30
|
test.verbose = true
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
desc
|
34
|
+
desc "load irb with this gem"
|
35
35
|
task :console do
|
36
|
-
puts
|
37
|
-
exec
|
36
|
+
puts "running console"
|
37
|
+
exec "bundle console"
|
38
38
|
end
|
39
39
|
|
40
40
|
# This is really just for testing and development because without configuration
|
41
41
|
# Coverband can't do much
|
42
|
-
desc
|
42
|
+
desc "start webserver"
|
43
43
|
task :server do
|
44
|
-
exec
|
44
|
+
exec "rackup -I lib"
|
45
45
|
end
|
46
46
|
|
47
|
-
desc
|
47
|
+
desc "publish gem with 2 factor auth, reminder how"
|
48
48
|
task :publish_gem do
|
49
|
-
exec
|
49
|
+
exec "gem push pkg/coverband-4.2.3.XXX.gem"
|
50
50
|
end
|
data/changes.md
CHANGED
@@ -51,37 +51,34 @@ Will be the fully modern release that drops maintenance legacy support in favor
|
|
51
51
|
- add gem_details_safe list to report on details on some gems
|
52
52
|
- - display gems that are in loaded with 0 coverage, thanks @kbaum
|
53
53
|
|
54
|
-
### Coverband_jam_session
|
55
|
-
|
56
|
-
This is a possible gem to host experimental or more complex features, which would require tuning, configuration, and performance trade offs. If something is really valuable it could be promoted into the main line.
|
57
|
-
|
58
|
-
Feature Ideas:
|
59
|
-
|
60
|
-
- per request coverage implemented via Ruby 2.6.0 coverage.clear https://bugs.ruby-lang.org/issues/15022
|
61
|
-
- statsd adapters (it would allow passing in date ranges on usage)
|
62
|
-
- Possibly add ability to record code run for a given route
|
63
|
-
- integrate recording with deploy tag or deploy timestamp
|
64
|
-
- diff code usage across deployed versions
|
65
|
-
- what methods increased usage or decreased
|
66
|
-
- ability to change the Coverband config at runtime by changing the config pushed to the Redis hash. In memory cache around the changes to only make that call periodically.
|
67
|
-
- Opposed to just showing code usage on a route allow 'tagging' events which would record line coverage for that tag (this would allow tagging all code that modified an ActiveRecord model for example
|
68
|
-
- additional adapters (tracepoint, ruby-profiler, etc)
|
69
|
-
- tagged coverage reports
|
70
|
-
- code route tracing (entry point to all code executed for example /some_path -> code coverage of that path)
|
71
|
-
- deploy git hash tagging of reported Coverage
|
72
|
-
- allow only to collect coverage based on route (limiting or scoped coverage)
|
73
|
-
- coverage over some other variable like a set of alpha users
|
74
|
-
- document how to use this on staging / selenium test suite runs
|
75
|
-
- possible add API to pull report at end of run
|
76
|
-
|
77
54
|
# Alpha / Beta / Release Candidates
|
78
55
|
|
79
|
-
### Coverband
|
56
|
+
### Coverband 5.0.0
|
80
57
|
|
58
|
+
- Full JRuby support
|
59
|
+
- Reduced footprint
|
60
|
+
- drops S3 support
|
61
|
+
- drops static report support
|
62
|
+
- drops gem support
|
81
63
|
- ?
|
82
64
|
|
83
65
|
# Released
|
84
66
|
|
67
|
+
###Coverband 4.2.7
|
68
|
+
|
69
|
+
- Ignore patterns too aggressive #382, thanks @thijsnado
|
70
|
+
- Stack level too deep error when running certain activejob jobs #367, thanks @kejordan and @hanslauwers
|
71
|
+
|
72
|
+
###Coverband 4.2.6
|
73
|
+
|
74
|
+
- Address Redis exists deprecation warning by baffers
|
75
|
+
|
76
|
+
### Coverband 4.2.5
|
77
|
+
|
78
|
+
- alpha support of jRuby
|
79
|
+
- fix for rails 4.0 by rswaminathan
|
80
|
+
- do not error on branch coverage / simplecov compatibility by desertcart
|
81
|
+
|
85
82
|
### Coverband 4.2.4
|
86
83
|
|
87
84
|
- fixes related to startup without Redis, skipping Coverband on common rake tasks (assets:precompile), etc
|
@@ -104,19 +101,18 @@ Feature Ideas:
|
|
104
101
|
- improved messaging around non-loaded files
|
105
102
|
- fix on last updated nil issue
|
106
103
|
- view tracker improvements
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
104
|
+
- clear all
|
105
|
+
- reset individual file
|
106
|
+
- timestamps on last seen activity
|
111
107
|
|
112
108
|
### Coverband 4.2.2
|
113
109
|
|
114
110
|
- new experimental hash redis store for high volume collection
|
115
|
-
(hundreds of clients), thanks @kbaum
|
111
|
+
(hundreds of clients), thanks @kbaum
|
116
112
|
- view_tracker supports tracking view layer files like `.html.erb`
|
117
113
|
- documentation improvements, thanks @brossetti1, @jjb, @kbaum
|
118
114
|
- we now have discordapp for discussions, thanks @kbaum,
|
119
|
-
https://discordapp.com/channels/609509533999562753/609509533999562756
|
115
|
+
https://discordapp.com/channels/609509533999562753/609509533999562756
|
120
116
|
- perf fix on Rails initialization, thanks @skangg
|
121
117
|
- simplified logging
|
122
118
|
|
data/config.ru
CHANGED
data/coverband.gemspec
CHANGED
@@ -1,49 +1,44 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
lib = File.expand_path(
|
3
|
+
lib = File.expand_path("lib", __dir__)
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
require
|
5
|
+
require "coverband/version"
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
|
-
spec.name
|
9
|
-
spec.version
|
10
|
-
spec.authors
|
11
|
-
spec.email
|
12
|
-
spec.description
|
13
|
-
spec.summary
|
14
|
-
spec.homepage
|
15
|
-
spec.license
|
8
|
+
spec.name = "coverband"
|
9
|
+
spec.version = Coverband::VERSION
|
10
|
+
spec.authors = ["Dan Mayer", "Karl Baum"]
|
11
|
+
spec.email = ["dan@mayerdan.com"]
|
12
|
+
spec.description = "Rack middleware to measure production code usage (LOC runtime usage)"
|
13
|
+
spec.summary = "Rack middleware to measure production code usage (LOC runtime usage)"
|
14
|
+
spec.homepage = "https://github.com/danmayer/coverband"
|
15
|
+
spec.license = "MIT"
|
16
16
|
|
17
|
-
spec.files
|
18
|
-
spec.executables
|
19
|
-
spec.test_files
|
20
|
-
spec.require_paths = [
|
17
|
+
spec.files = `git ls-files`.split("\n").reject { |f| f.start_with?("docs") }
|
18
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
|
+
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
spec.add_development_dependency
|
26
|
-
spec.add_development_dependency
|
27
|
-
spec.add_development_dependency
|
28
|
-
spec.add_development_dependency
|
29
|
-
spec.add_development_dependency
|
30
|
-
spec.add_development_dependency
|
31
|
-
spec.add_development_dependency
|
32
|
-
spec.add_development_dependency
|
33
|
-
spec.add_development_dependency
|
34
|
-
spec.add_development_dependency 'rack-test'
|
35
|
-
spec.add_development_dependency 'rake'
|
36
|
-
spec.add_development_dependency 'resque'
|
37
|
-
spec.add_development_dependency 'rubocop'
|
38
|
-
spec.add_development_dependency 'rubocop-performance'
|
22
|
+
spec.add_development_dependency "benchmark-ips"
|
23
|
+
spec.add_development_dependency "capybara"
|
24
|
+
spec.add_development_dependency "m"
|
25
|
+
spec.add_development_dependency "memory_profiler"
|
26
|
+
spec.add_development_dependency "minitest"
|
27
|
+
spec.add_development_dependency "minitest-fork_executor"
|
28
|
+
spec.add_development_dependency "mocha", "~> 1.7.0"
|
29
|
+
spec.add_development_dependency "rack"
|
30
|
+
spec.add_development_dependency "rack-test"
|
31
|
+
spec.add_development_dependency "rake"
|
32
|
+
spec.add_development_dependency "resque"
|
33
|
+
spec.add_development_dependency "standardrb"
|
39
34
|
|
40
|
-
spec.add_development_dependency
|
41
|
-
spec.add_development_dependency
|
35
|
+
spec.add_development_dependency "coveralls"
|
36
|
+
spec.add_development_dependency "minitest-profile"
|
42
37
|
|
43
38
|
# TODO: Remove when other production adapters exist
|
44
39
|
# because the default configuration of redis store, we really do require
|
45
40
|
# redis now. I was reluctant to add this, but until we offer another production
|
46
41
|
# quality adapter, I think this is more honest about requirements and reduces confusion
|
47
42
|
# without this there was a race condition on calling coverband configure before redis was loaded
|
48
|
-
spec.add_runtime_dependency
|
43
|
+
spec.add_runtime_dependency "redis"
|
49
44
|
end
|