coverband 4.2.5 → 5.0.0.rc.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/.standard.yml +25 -0
  3. data/.travis.yml +2 -1
  4. data/Gemfile +5 -7
  5. data/Gemfile.rails4 +0 -3
  6. data/Gemfile.rails6 +0 -3
  7. data/README.md +24 -77
  8. data/Rakefile +17 -17
  9. data/changes.md +31 -34
  10. data/config.ru +1 -1
  11. data/coverband.gemspec +30 -34
  12. data/lib/alternative_coverband_patch.rb +5 -0
  13. data/lib/coverband.rb +68 -44
  14. data/lib/coverband/adapters/base.rb +17 -18
  15. data/lib/coverband/adapters/file_store.rb +38 -6
  16. data/lib/coverband/adapters/hash_redis_store.rb +24 -21
  17. data/lib/coverband/adapters/redis_store.rb +12 -12
  18. data/lib/coverband/adapters/stdout_store.rb +41 -0
  19. data/lib/coverband/adapters/web_service_store.rb +157 -0
  20. data/lib/coverband/at_exit.rb +1 -1
  21. data/lib/coverband/collectors/coverage.rb +15 -27
  22. data/lib/coverband/collectors/delta.rb +29 -9
  23. data/lib/coverband/collectors/view_tracker.rb +19 -11
  24. data/lib/coverband/collectors/view_tracker_service.rb +59 -0
  25. data/lib/coverband/configuration.rb +121 -88
  26. data/lib/coverband/integrations/background.rb +6 -6
  27. data/lib/coverband/integrations/rack_server_check.rb +3 -3
  28. data/lib/coverband/integrations/resque.rb +13 -1
  29. data/lib/coverband/reporters/base.rb +10 -10
  30. data/lib/coverband/reporters/console_report.rb +1 -1
  31. data/lib/coverband/reporters/html_report.rb +10 -30
  32. data/lib/coverband/reporters/web.rb +55 -50
  33. data/lib/coverband/utils/absolute_file_converter.rb +6 -6
  34. data/lib/coverband/utils/html_formatter.rb +32 -61
  35. data/lib/coverband/utils/railtie.rb +23 -6
  36. data/lib/coverband/utils/relative_file_converter.rb +2 -2
  37. data/lib/coverband/utils/result.rb +6 -11
  38. data/lib/coverband/utils/results.rb +0 -10
  39. data/lib/coverband/utils/source_file.rb +21 -30
  40. data/lib/coverband/utils/tasks.rb +8 -11
  41. data/lib/coverband/version.rb +1 -1
  42. data/public/application.js +0 -30
  43. data/test/benchmarks/benchmark.rake +97 -92
  44. data/test/benchmarks/dog.rb +1 -1
  45. data/test/benchmarks/init_rails.rake +4 -4
  46. data/test/coverband/adapters/base_test.rb +29 -30
  47. data/test/coverband/adapters/file_store_test.rb +19 -20
  48. data/test/coverband/adapters/hash_redis_store_test.rb +57 -57
  49. data/test/coverband/adapters/redis_store_test.rb +26 -26
  50. data/test/coverband/adapters/web_service_store_test.rb +56 -0
  51. data/test/coverband/at_exit_test.rb +2 -2
  52. data/test/coverband/collectors/coverage_test.rb +33 -47
  53. data/test/coverband/collectors/delta_test.rb +52 -23
  54. data/test/coverband/collectors/view_tracker_test.rb +35 -35
  55. data/test/coverband/configuration_test.rb +27 -53
  56. data/test/coverband/coverband_test.rb +11 -11
  57. data/test/coverband/integrations/background_middleware_test.rb +10 -10
  58. data/test/coverband/integrations/background_test.rb +6 -5
  59. data/test/coverband/integrations/rack_server_check_test.rb +7 -7
  60. data/test/coverband/integrations/report_middleware_test.rb +9 -9
  61. data/test/coverband/integrations/resque_worker_test.rb +9 -9
  62. data/test/coverband/integrations/test_resque_job.rb +1 -1
  63. data/test/coverband/reporters/base_test.rb +9 -9
  64. data/test/coverband/reporters/console_test.rb +6 -6
  65. data/test/coverband/reporters/html_test.rb +36 -48
  66. data/test/coverband/reporters/web_test.rb +16 -18
  67. data/test/coverband/utils/absolute_file_converter_test.rb +22 -22
  68. data/test/coverband/utils/file_hasher_test.rb +6 -12
  69. data/test/coverband/utils/file_list_test.rb +13 -13
  70. data/test/coverband/utils/html_formatter_test.rb +9 -23
  71. data/test/coverband/utils/lines_classifier_test.rb +29 -29
  72. data/test/coverband/utils/relative_file_converter_test.rb +13 -13
  73. data/test/coverband/utils/result_test.rb +18 -18
  74. data/test/coverband/utils/results_test.rb +17 -17
  75. data/test/coverband/utils/source_file_line_test.rb +46 -46
  76. data/test/coverband/utils/source_file_test.rb +38 -88
  77. data/test/dog.rb +1 -1
  78. data/test/fake_app/basic_rack.rb +2 -2
  79. data/test/fixtures/app/controllers/sample_controller.rb +1 -1
  80. data/test/fixtures/app/models/user.rb +1 -1
  81. data/test/fixtures/sample.rb +1 -1
  82. data/test/fixtures/utf-8.rb +0 -2
  83. data/test/forked/rails_full_stack_test.rb +24 -27
  84. data/test/forked/rails_rake_full_stack_test.rb +7 -26
  85. data/test/integration/full_stack_test.rb +11 -22
  86. data/test/jruby_check.rb +2 -3
  87. data/test/rails4_dummy/Rakefile +1 -1
  88. data/test/rails4_dummy/config.ru +1 -1
  89. data/test/rails4_dummy/config/application.rb +4 -4
  90. data/test/rails4_dummy/config/boot.rb +2 -2
  91. data/test/rails4_dummy/config/coverband.rb +1 -1
  92. data/test/rails4_dummy/config/coverband_missing_redis.rb +1 -1
  93. data/test/rails4_dummy/config/environment.rb +1 -1
  94. data/test/rails4_dummy/config/routes.rb +2 -2
  95. data/test/rails5_dummy/Rakefile +1 -1
  96. data/test/rails5_dummy/config.ru +1 -1
  97. data/test/rails5_dummy/config/application.rb +3 -3
  98. data/test/rails5_dummy/config/coverband.rb +8 -8
  99. data/test/rails5_dummy/config/coverband_missing_redis.rb +8 -8
  100. data/test/rails5_dummy/config/environment.rb +1 -1
  101. data/test/rails5_dummy/config/routes.rb +2 -2
  102. data/test/rails6_dummy/Rakefile +1 -1
  103. data/test/rails6_dummy/config.ru +1 -1
  104. data/test/rails6_dummy/config/application.rb +4 -4
  105. data/test/rails6_dummy/config/boot.rb +2 -2
  106. data/test/rails6_dummy/config/coverband.rb +1 -1
  107. data/test/rails6_dummy/config/coverband_missing_redis.rb +1 -1
  108. data/test/rails6_dummy/config/environment.rb +1 -1
  109. data/test/rails6_dummy/config/routes.rb +2 -2
  110. data/test/rails_test_helper.rb +11 -11
  111. data/test/test_helper.rb +43 -34
  112. data/test/unique_files.rb +10 -10
  113. data/views/layout.erb +2 -12
  114. metadata +15 -34
  115. data/.rubocop.yml +0 -84
  116. data/lib/coverband/integrations/bundler.rb +0 -8
  117. data/lib/coverband/utils/file_groups.rb +0 -53
  118. data/lib/coverband/utils/gem_list.rb +0 -31
  119. data/lib/coverband/utils/s3_report.rb +0 -105
  120. data/test/coverband/utils/file_groups_test.rb +0 -61
  121. data/test/coverband/utils/gem_list_test.rb +0 -48
  122. data/test/coverband/utils/s3_report_test.rb +0 -44
  123. data/views/gem_list.erb +0 -63
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c2fdaf2248e86dd0c59b8d7926bd83a992069fe6e638711efd3a01077e2575b
4
- data.tar.gz: 0d8ffca83bae42e7fd765670c3b9ea7581565e3ff6239a9b4db3439676240050
3
+ metadata.gz: c83a78e28c79671ef144ffa38e40ee061a873ef6a207437f01923188c17d3cf0
4
+ data.tar.gz: 80a3c0a46cfb55a5972139e034733d9fb6541f0d547caff1f004203b9ddb0484
5
5
  SHA512:
6
- metadata.gz: 60f57e795d4bd9b4fca1dd40bf739b26f0efd8ff6779901763ce74a01d3f0c9672c2f0a72c5cac151a6b5906311b9a64fcadd69a39d00f82a6ec8bc7a2e2cded
7
- data.tar.gz: 0654e82634038d1a734c815780a1dac3bbc44add9e65f97ba5ed5f2024d328e96f9ca16e7467d3b5d58045370e8516a02480587b0ecb31a7f84960f9cd961eff
6
+ metadata.gz: 0b2f9965e62d911acc562c73df79f4ba13ca0df48bb18258a9069b71d3323f9167385b11fe25772d32d23575338e98e04f721dd57f6562ca40171e39f1cae591
7
+ data.tar.gz: 6ca2447bbddf8ac8bd6a92e4544a2e38b5a7bf84d49e9e02230ef3a2e0044436ce70d9907dad8a7d163cf909369ad4f089af49bb6a50da5b62982e3001aa48bd
@@ -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
@@ -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 rake rubocop
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 'https://rubygems.org'
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['CI']
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 'pry-byebug', platforms: [:mri, :mingw, :x64_mingw]
14
+ gem "pry-byebug", platforms: [:mri, :mingw, :x64_mingw]
15
15
  end
16
16
 
17
- gem 'rails', '~>5'
17
+ gem "rails", "~>5"
18
18
  # these gems are used for testing gem tracking
19
- gem 'irb', require: false
20
- gem 'pundit'
21
- gem 'rainbow', require: false
19
+ gem "irb", require: false
@@ -5,6 +5,3 @@ source 'https://rubygems.org'
5
5
  # Specify your gem's dependencies in coverband.gemspec
6
6
  gemspec
7
7
  gem 'rails', '~>4'
8
- # this is used for testing gem tracking
9
- gem 'rainbow', require: false
10
- gem 'pundit'
@@ -5,6 +5,3 @@ source 'https://rubygems.org'
5
5
  # Specify your gem's dependencies in coverband.gemspec
6
6
  gemspec
7
7
  gem 'rails', '~>6'
8
- # this is used for testing gem tracking
9
- gem 'rainbow', require: false
10
- gem 'pundit'
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 coverband is required after rails within your Gemfile. The only exception to this is gem tracking of `Bundle.require` which depends on requiring coverband within the application.rb. See [Collecting Gem / Library Usage](https://github.com/danmayer/coverband#collecting-gem--library-usage).
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 oldre 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.
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
- * older versions of JRuby need tracing enabled to work (and this could cause bad performance)
123
- * run Jruby with the `--debug` option
124
- * add into your `.jrubyrc` the `debug.fullTrace=true` setting
125
- * For best performance the `oneshot_lines` is recommended, and in the latest releases should have very low overhead
126
- * See JRuby support in a Rails app configured to run via JRuby, in [Coverband Demo](https://github.com/coverband-service/coverband_demo)
127
- * JRuby is tested via CI against Rails 5 and 6
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 'bundler/gem_tasks'
4
- import 'test/benchmarks/benchmark.rake'
5
- require 'rubocop/rake_task'
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 'rake/testtask'
14
+ require "rake/testtask"
15
15
  Rake::TestTask.new(:test) do |test|
16
- test.libs << 'lib' << 'test'
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['test/integration/**/*_test.rb', 'test/coverband/**/*_test.rb']
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 == 'java'
26
- puts 'forked tests not supported on JRuby'
25
+ if RUBY_PLATFORM == "java"
26
+ puts "forked tests not supported on JRuby"
27
27
  else
28
- test.libs << 'lib' << 'test'
29
- test.test_files = FileList['test/forked/**/*_test.rb']
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 'load irb with this gem'
34
+ desc "load irb with this gem"
35
35
  task :console do
36
- puts 'running console'
37
- exec 'bundle console'
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 'start webserver'
42
+ desc "start webserver"
43
43
  task :server do
44
- exec 'rackup -I lib'
44
+ exec "rackup -I lib"
45
45
  end
46
46
 
47
- desc 'publish gem with 2 factor auth, reminder how'
47
+ desc "publish gem with 2 factor auth, reminder how"
48
48
  task :publish_gem do
49
- exec 'gem push pkg/coverband-4.2.3.XXX.gem'
49
+ exec "gem push pkg/coverband-4.2.3.XXX.gem"
50
50
  end
data/changes.md CHANGED
@@ -7,7 +7,7 @@
7
7
  - [redis bitfield](https://stackoverflow.com/questions/47100606/optimal-way-to-store-array-of-integers-in-redis-database)
8
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
9
 
10
- ### Coverband 4.X
10
+ ### Coverband Future...
11
11
 
12
12
  Will be the fully modern release that drops maintenance legacy support in favor of increased performance, ease of use, and maintainability.
13
13
 
@@ -51,42 +51,40 @@ 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
56
  ### Coverband 5.0.0
80
57
 
81
- - ?
58
+ - Full JRuby support
59
+ - Reduced footprint
60
+ - drops S3 support
61
+ - drops static report support
62
+ - drops gem support
63
+ - only loaded web reporter files when required
64
+ - improved load order allowing more time for ENV vars (better dotenv, figaro, rails secrets support)
65
+ - improved resque patching pattern
66
+ - improved default ignores
67
+ - additional adapters
68
+ - supports web-service adapter for http coverage collection
69
+ - support log/file adapter
70
+ - reduce logs / errors / alerts on bad startup configurations
82
71
 
83
72
  # Released
84
73
 
74
+ ###Coverband 4.2.7
75
+
76
+ - Ignore patterns too aggressive #382, thanks @thijsnado
77
+ - Stack level too deep error when running certain activejob jobs #367, thanks @kejordan and @hanslauwers
78
+
79
+ ###Coverband 4.2.6
80
+
81
+ - Address Redis exists deprecation warning by baffers
82
+
85
83
  ### Coverband 4.2.5
86
84
 
87
- * alpha support of jRuby
88
- * fix for rails 4.0 by rswaminathan
89
- * do not error on branch coverage / simplecov compatibility by desertcart
85
+ - alpha support of jRuby
86
+ - fix for rails 4.0 by rswaminathan
87
+ - do not error on branch coverage / simplecov compatibility by desertcart
90
88
 
91
89
  ### Coverband 4.2.4
92
90
 
@@ -110,19 +108,18 @@ Feature Ideas:
110
108
  - improved messaging around non-loaded files
111
109
  - fix on last updated nil issue
112
110
  - view tracker improvements
113
- - clear all
114
- - reset individual file
115
- - timestamps on last seen activity
116
-
111
+ - clear all
112
+ - reset individual file
113
+ - timestamps on last seen activity
117
114
 
118
115
  ### Coverband 4.2.2
119
116
 
120
117
  - new experimental hash redis store for high volume collection
121
- (hundreds of clients), thanks @kbaum
118
+ (hundreds of clients), thanks @kbaum
122
119
  - view_tracker supports tracking view layer files like `.html.erb`
123
120
  - documentation improvements, thanks @brossetti1, @jjb, @kbaum
124
121
  - we now have discordapp for discussions, thanks @kbaum,
125
- https://discordapp.com/channels/609509533999562753/609509533999562756
122
+ https://discordapp.com/channels/609509533999562753/609509533999562756
126
123
  - perf fix on Rails initialization, thanks @skangg
127
124
  - simplified logging
128
125
 
data/config.ru CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path('../lib/coverband', __FILE__)
3
+ require ::File.expand_path("../lib/coverband", __FILE__)
4
4
  run Coverband::Reporters::Web.new
@@ -1,49 +1,45 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('lib', __dir__)
3
+ lib = File.expand_path("lib", __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'coverband/version'
5
+ require "coverband/version"
6
6
 
7
7
  Gem::Specification.new do |spec|
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'
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 = `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']
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
- # to test support for sdk 1, uncomment this line
23
- # spec.add_development_dependency 'aws-sdk', '~> 1'
24
- # to test sdk 2 use this one
25
- spec.add_development_dependency 'aws-sdk-s3', '~> 1'
26
- spec.add_development_dependency 'benchmark-ips'
27
- spec.add_development_dependency 'capybara'
28
- spec.add_development_dependency 'm'
29
- spec.add_development_dependency 'memory_profiler'
30
- spec.add_development_dependency 'minitest'
31
- spec.add_development_dependency 'minitest-fork_executor'
32
- spec.add_development_dependency 'mocha', '~> 1.7.0'
33
- spec.add_development_dependency 'rack'
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 'coveralls'
41
- spec.add_development_dependency 'minitest-profile'
35
+ spec.add_development_dependency "coveralls"
36
+ spec.add_development_dependency "minitest-profile"
37
+ spec.add_development_dependency "webmock"
42
38
 
43
39
  # TODO: Remove when other production adapters exist
44
40
  # because the default configuration of redis store, we really do require
45
41
  # redis now. I was reluctant to add this, but until we offer another production
46
42
  # quality adapter, I think this is more honest about requirements and reduces confusion
47
43
  # without this there was a race condition on calling coverband configure before redis was loaded
48
- spec.add_runtime_dependency 'redis'
44
+ spec.add_runtime_dependency "redis"
49
45
  end