coverband 4.2.4 → 4.2.5.rc.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c094b4a6ef2b76f771cb96aa1fbdc246dc8beea74033ffca4cb466ef96c0a08
4
- data.tar.gz: 1162d9244c0e1a1b28c0fa051d7cd53d29b6a4fdfc50c1fadb7d6793229aaf8b
3
+ metadata.gz: 57a58a71386b69f1d6ccea984e9950649a95a8618e6716149f3a890725cc23ff
4
+ data.tar.gz: 1b027835c1bf84f630626c32305ac57b7589c79bb785f7486f1a5446aab103fd
5
5
  SHA512:
6
- metadata.gz: d9eba70b91d87992d1e450490f7fd4545cccb5092bf093c424c51b964cb4b31ad5c8a1d49d1cc774ce6470c6466b7d3b7a7a1df92ecbc4e574a203467f621b55
7
- data.tar.gz: 815c462d38f7a27b26f5d209044c53b2e0058c4ea2534db3f6663a267ad0cc435bd6c895128c5ea8f85c0aec61e4e31d9f61c426526b71423e24c941852f74be
6
+ metadata.gz: 359c975e792a4b640dd35881ff6c413eb1252e9842cf662a458ce8d0e135e1b29e4a1d41166628a4bab5826ea360e3005557be6c6539b521b322127d441a54f3
7
+ data.tar.gz: e3b6acc540519877792d1779a3ade69e08f3ef7957a4bd9077984ccd89cbfcbb6dfec5076ce2273997992129f34006907b02e48f44dc5cdb9f94d0df88a2dd82
data/.travis.yml CHANGED
@@ -4,17 +4,18 @@ rvm:
4
4
  - "2.4"
5
5
  - "2.5"
6
6
  - "2.6.1"
7
+ # - "2.7" #disable until I can detect and exclude rails for on Ruby 2.7
7
8
  cache:
8
9
  bundler: true
9
10
  directories:
10
- - $HOME/lua51
11
+ - $HOME/lua51
11
12
  gemfile:
12
13
  - Gemfile
13
14
  - Gemfile.rails4
14
15
  services:
15
16
  - redis-server
16
17
  script:
17
- - sudo ./lua/install.sh
18
+ - sudo ./lua/install.sh
18
19
  - $HOME/lua51/bin/busted lua/test/*
19
20
  - bundle exec rake rubocop
20
21
  - COVERBAND_HASH_REDIS_STORE=t bundle exec rake
data/README.md CHANGED
@@ -206,6 +206,8 @@ config.ignore += ['config/application.rb',
206
206
  'lib/tasks/*']
207
207
  ```
208
208
 
209
+ __Ignoring Custom Gem Locations:__ Note, if you have your gems in a custom location under your app folder you likely want to add them to `config.ignore`. For example, if you have your gems not in a default ignored location of `app/vendor` but have them in `app/gems` you would need to add `gems/*` to your ignore list.
210
+
209
211
  ### View Tracking
210
212
 
211
213
  Coverband allows an optional feature to track all view files that are used by an application.
@@ -237,6 +239,29 @@ ENV['AWS_ACCESS_KEY_ID']
237
239
  ENV['AWS_SECRET_ACCESS_KEY']
238
240
  ```
239
241
 
242
+ ### Fixing Coverage Only Shows Loading Hits
243
+
244
+ 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`.
245
+
246
+ ```ruby
247
+ config.after_initialize do
248
+ unless Coverband.tasks_to_ignore?
249
+ Coverband.report_coverage # record the last of the loading coverage
250
+ Coverband.runtime_coverage! # set all future coverage to runtime
251
+ end
252
+ end
253
+ ```
254
+
255
+ or if you know you are manually calling eager load anywhere in your initialization process immediately adfter call those two lines. A user reported an issue after calling `ResqueWeb::Engine.eager_load!` for example.
256
+
257
+ ```ruby
258
+ Rails.application.routes.draw do
259
+ ResqueWeb::Engine.eager_load!
260
+ Coverband.report_coverage
261
+ Coverband.runtime_coverage!
262
+ end
263
+ ```
264
+
240
265
  ### Avoiding Cache Stampede
241
266
 
242
267
  If you have many servers and they all hit Redis at the same time you can see spikes in your Redis CPU, and memory. This is do to a concept called [cache stampede](https://en.wikipedia.org/wiki/Cache_stampede). It is better to spread out the reporting across your servers. A simple way to do this is to add a random wiggle on your background reporting. This configuration option allows a wiggle. The right amount of wiggle depends on the numbers of servers you have and how willing you are to have delays in your coverage reporting. I would recommend at least 1 second per server.
@@ -54,7 +54,7 @@ module Coverband
54
54
  @root = Dir.pwd
55
55
  @root_paths = []
56
56
  @ignore = IGNORE_DEFAULTS.dup
57
- @seach_paths = TRACKED_DEFAULT_PATHS.dup
57
+ @search_paths = TRACKED_DEFAULT_PATHS.dup
58
58
  @additional_files = []
59
59
  @verbose = false
60
60
  @reporter = 'scov'
@@ -134,14 +134,14 @@ module Coverband
134
134
  # Search Paths
135
135
  ###
136
136
  def tracked_search_paths
137
- "#{Coverband.configuration.current_root}/{#{@seach_paths.join(',')}}/**/*.{rb}"
137
+ "#{Coverband.configuration.current_root}/{#{@search_paths.join(',')}}/**/*.{rb}"
138
138
  end
139
139
 
140
140
  ###
141
141
  # Don't allow the to override defaults
142
142
  ###
143
143
  def search_paths=(path_array)
144
- @seach_paths = (@seach_paths + path_array).uniq
144
+ @search_paths = (@search_paths + path_array).uniq
145
145
  end
146
146
 
147
147
  ###
@@ -32,8 +32,9 @@ module Coverband
32
32
 
33
33
  return [401, { 'www-authenticate' => 'Basic realm=""' }, ['']] unless check_auth
34
34
 
35
+ request_path_info = (request.path_info == '') ? '/' : request.path_info
35
36
  if request.post?
36
- case request.path_info
37
+ case request_path_info
37
38
  when %r{\/clear_view_tracking_file}
38
39
  clear_view_tracking_file
39
40
  when %r{\/clear_view_tracking}
@@ -46,7 +47,7 @@ module Coverband
46
47
  [404, { 'Content-Type' => 'text/html' }, ['404 error!']]
47
48
  end
48
49
  else
49
- case request.path_info
50
+ case request_path_info
50
51
  when /.*\.(css|js|gif|png)/
51
52
  @static.call(env)
52
53
  when %r{\/settings}
@@ -5,5 +5,5 @@
5
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 = '4.2.4'
8
+ VERSION = '4.2.5.rc.1'
9
9
  end
@@ -27,6 +27,12 @@ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.2.0')
27
27
  assert_match 'Coverband Admin', last_response.body
28
28
  end
29
29
 
30
+ test 'renders index content for empty path' do
31
+ get ''
32
+ assert last_response.ok?
33
+ assert_match 'Coverband Admin', last_response.body
34
+ end
35
+
30
36
  test 'renders 404' do
31
37
  get '/show'
32
38
  assert last_response.not_found?
data/test/test_helper.rb CHANGED
@@ -15,7 +15,7 @@ require 'ostruct'
15
15
  require 'json'
16
16
  require 'redis'
17
17
  require 'resque'
18
- require 'pry-byebug'
18
+ require 'pry-byebug' unless ENV['CI'] # Ruby 2.3 on CI crashes on pry
19
19
  require_relative 'unique_files'
20
20
  $VERBOSE = original_verbosity
21
21
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coverband
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.4
4
+ version: 4.2.5.rc.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Mayer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-12-29 00:00:00.000000000 Z
12
+ date: 2020-03-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk-s3
@@ -449,9 +449,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
449
449
  version: '0'
450
450
  required_rubygems_version: !ruby/object:Gem::Requirement
451
451
  requirements:
452
- - - ">="
452
+ - - ">"
453
453
  - !ruby/object:Gem::Version
454
- version: '0'
454
+ version: 1.3.1
455
455
  requirements: []
456
456
  rubygems_version: 3.0.3
457
457
  signing_key: