coverband 0.0.16 → 0.0.17

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -52,7 +52,17 @@ Details on a example Sinatra app
52
52
 
53
53
  ## Usage
54
54
 
55
- After installing the gem, you likely want to get the rake tasks configured as well as the rack middleware.
55
+ After installing the gem. There are a few steps to gather data, view reports, and cleaing up the data.
56
+
57
+ 1. First configure Rake, with helpful tasks. See the section below
58
+ * `rake coverband_baseline` helps you to record a baseline of your apps initialization process
59
+ * `rake coverband` after you have setup coverband on a server and started recording data this generates the report and opens it in your browser.
60
+ 2. Setup the rack middleware, the middleware is what makes coverband gather metrics when your app runs. See below for details
61
+ * I setup coverband in my rackup `config.ru` you can also set it up in rails middleware, but it may miss recording some code coverage early in the rails process. It does improve performance to have it later in the middleware stack. So there is a tradeoff there.
62
+ * To debug in development mode, I recommend turning verbose logging on `config.verbose = true` and passing in the Rails.logger `config.logger = Rails.logger` to the coverband config. This makes it easy to follow in development mode. Be careful to not leave these on in production as they will effect performance.
63
+ 3. Start your server with `rackup config.ru` If you use `rails s` make sure it is using your `config.ru` or coverband won't be recording any data.
64
+ 4. Hit your development server exercising the endpoints you want to verify Coverband is recording.
65
+ 5. Now to view changes in live coverage run `rake coverband` again, previously it should have only shown the baseline data of your app initializing. After using it in development it hsould show increased coverage from the actions you have exercised.
56
66
 
57
67
  #### Configuring Rake
58
68
 
@@ -101,7 +111,11 @@ Coverband.configure do |config|
101
111
  config.coverage_baseline = JSON.parse(File.read('./tmp/coverband_baseline.json'))
102
112
  config.root_paths = ['/app/']
103
113
  config.ignore = ['vendor']
104
- config.percentage = 100.0
114
+ # Since rails and other frameworks lazy load code. I have found it is bad to allow
115
+ # initial requests to record with coverband.
116
+ # This allows 10 requests prior to trying to record any activitly.
117
+ config.startup_delay = 10
118
+ config.percentage = 15.0
105
119
  end
106
120
 
107
121
  use Coverband::Middleware
@@ -183,7 +197,7 @@ Coverband::Reporter.clear_coverage(Redis.new(:host => 'target.com', :port => 678
183
197
  * Possibly add ability to record code run for a given route
184
198
  * Add default rake tasks so a project could just require the rake tasks
185
199
  * Improve client code api, particularly around configuration, but also around manual usage of sampling
186
-
200
+ * Provide a better lighter example app, to show how to use coverband.
187
201
 
188
202
  ## Resources
189
203
 
data/coverband.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.3"
22
22
  spec.add_development_dependency "rake"
23
- spec.add_development_dependency "mocha"
23
+ spec.add_development_dependency "mocha", "~> 0.14.0"
24
24
  spec.add_development_dependency "shoulda"
25
25
  spec.add_development_dependency "rack"
26
26
  spec.add_runtime_dependency "simplecov"
@@ -1,3 +1,3 @@
1
1
  module Coverband
2
- VERSION = "0.0.16"
2
+ VERSION = "0.0.17"
3
3
  end
data/test/test_helper.rb CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'simplecov'
3
3
  require 'test/unit'
4
4
  require 'shoulda'
5
- require 'mocha'
5
+ require 'mocha/setup'
6
6
  require 'ostruct'
7
7
  require 'json'
8
8
 
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: 0.0.16
4
+ version: 0.0.17
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-07 00:00:00.000000000 Z
12
+ date: 2014-03-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -48,17 +48,17 @@ dependencies:
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
51
- - - ! '>='
51
+ - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: '0'
53
+ version: 0.14.0
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
59
- - - ! '>='
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 0.14.0
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: shoulda
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -182,7 +182,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
182
182
  version: '0'
183
183
  segments:
184
184
  - 0
185
- hash: -615228549007876358
185
+ hash: -2201223091774651170
186
186
  required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  none: false
188
188
  requirements:
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  version: '0'
192
192
  segments:
193
193
  - 0
194
- hash: -615228549007876358
194
+ hash: -2201223091774651170
195
195
  requirements: []
196
196
  rubyforge_project:
197
197
  rubygems_version: 1.8.23