coverband 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.gitignore +6 -1
- data/.travis.yml +4 -2
- data/README.md +74 -51
- data/Rakefile +1 -1
- data/changes.md +45 -25
- data/coverband.gemspec +4 -0
- data/lib/coverband/adapters/base.rb +24 -1
- data/lib/coverband/adapters/redis_store.rb +29 -8
- data/lib/coverband/at_exit.rb +19 -2
- data/lib/coverband/collectors/coverage.rb +35 -73
- data/lib/coverband/collectors/delta.rb +67 -0
- data/lib/coverband/integrations/background.rb +4 -3
- data/lib/coverband/integrations/rack_server_check.rb +4 -1
- data/lib/coverband/integrations/resque.rb +4 -1
- data/lib/coverband/reporters/base.rb +21 -14
- data/lib/coverband/reporters/html_report.rb +40 -15
- data/lib/coverband/reporters/web.rb +29 -6
- data/lib/coverband/utils/html_formatter.rb +20 -4
- data/lib/coverband/utils/railtie.rb +8 -0
- data/lib/coverband/utils/result.rb +3 -2
- data/lib/coverband/utils/results.rb +63 -0
- data/lib/coverband/utils/source_file.rb +5 -0
- data/lib/coverband/version.rb +1 -1
- data/lib/coverband.rb +23 -3
- data/public/application.css +5 -0
- data/public/application.js +108 -1644
- data/public/dependencies.js +1581 -0
- data/public/favicon.png +0 -0
- data/test/benchmarks/benchmark.rake +31 -0
- data/test/benchmarks/coverage_fork.sh +37 -0
- data/test/{unit/adapters_base_test.rb → coverband/adapters/base_test.rb} +1 -1
- data/test/{unit/adapters_file_store_test.rb → coverband/adapters/file_store_test.rb} +1 -1
- data/test/{unit/adapters_redis_store_test.rb → coverband/adapters/redis_store_test.rb} +27 -10
- data/test/coverband/collectors/coverage_test.rb +73 -0
- data/test/coverband/collectors/delta_test.rb +52 -0
- data/test/{unit → coverband}/coverband_test.rb +7 -0
- data/test/coverband/integrations/background_test.rb +31 -0
- data/test/{unit → coverband/integrations}/middleware_test.rb +2 -1
- data/test/{unit/rack_server_checkout_test.rb → coverband/integrations/rack_server_check_test.rb} +1 -1
- data/test/{unit → coverband/integrations}/resque_worker_test.rb +9 -3
- data/test/{unit/reports_base_test.rb → coverband/reporters/base_test.rb} +5 -5
- data/test/{unit/reports_console_test.rb → coverband/reporters/console_test.rb} +2 -2
- data/test/{unit/reports_html_test.rb → coverband/reporters/html_test.rb} +7 -8
- data/test/{unit/reports_web_test.rb → coverband/reporters/web_test.rb} +2 -2
- data/test/{unit → integration}/full_stack_test.rb +10 -8
- data/test/{unit → integration}/rails_full_stack_test.rb +23 -4
- data/test/rails4_dummy/config/application.rb +1 -1
- data/test/rails4_dummy/config/coverband.rb +4 -1
- data/test/rails4_dummy/tmp/.keep +0 -0
- data/test/rails5_dummy/config/application.rb +1 -1
- data/test/rails5_dummy/config/coverband.rb +3 -1
- data/test/rails5_dummy/tmp/.keep +0 -0
- data/test/rails_test_helper.rb +13 -8
- data/test/test_helper.rb +9 -13
- data/test/unique_files.rb +23 -0
- data/views/file_list.erb +9 -0
- data/views/gem_list.erb +1 -1
- data/views/layout.erb +4 -3
- data/views/source_file.erb +16 -4
- data/views/source_file_loader.erb +7 -0
- metadata +100 -59
- data/test/unit/background_test.rb +0 -28
- data/test/unit/collectors_coverage_test.rb +0 -53
- data/test/unit/rails_gems_full_stack_test.rb +0 -36
- /data/test/{unit → coverband}/at_exit_test.rb +0 -0
- /data/test/{unit → coverband}/configuration_test.rb +0 -0
- /data/test/{unit → coverband/integrations}/test_resque_job.rb +0 -0
- /data/test/{unit → coverband}/utils/file_groups_test.rb +0 -0
- /data/test/{unit → coverband}/utils/file_list_test.rb +0 -0
- /data/test/{unit → coverband}/utils/gem_list_test.rb +0 -0
- /data/test/{unit → coverband}/utils/lines_classifier_test.rb +0 -0
- /data/test/{unit → coverband}/utils/result_test.rb +0 -0
- /data/test/{unit → coverband}/utils/s3_report_test.rb +0 -0
- /data/test/{unit → coverband}/utils/source_file_line_test.rb +0 -0
- /data/test/{unit → coverband}/utils/source_file_test.rb +0 -0
- /data/test/{unit/dog.rb → dog.rb} +0 -0
data/test/rails_test_helper.rb
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
# Configure Rails Environment
|
|
2
|
-
ENV["RAILS_ENV"] = "test"
|
|
3
|
-
require 'rails'
|
|
4
1
|
require File.expand_path('./test_helper', File.dirname(__FILE__))
|
|
5
|
-
|
|
6
|
-
require 'capybara/rails'
|
|
2
|
+
require 'capybara'
|
|
7
3
|
require 'capybara/minitest'
|
|
4
|
+
def rails_setup
|
|
5
|
+
ENV["RAILS_ENV"] = "test"
|
|
6
|
+
require 'rails'
|
|
7
|
+
#coverband must be required after rails
|
|
8
|
+
load 'coverband/utils/railtie.rb'
|
|
9
|
+
Coverband.configure("./test/rails#{Rails::VERSION::MAJOR}_dummy/config/coverband.rb")
|
|
10
|
+
require_relative "../test/rails#{Rails::VERSION::MAJOR}_dummy/config/environment"
|
|
11
|
+
require 'capybara/rails'
|
|
12
|
+
#Our coverage report is wrapped in display:none as of now
|
|
13
|
+
Capybara.ignore_hidden_elements = false
|
|
14
|
+
require 'mocha/minitest'
|
|
15
|
+
end
|
|
8
16
|
|
|
9
|
-
#Our coverage report is wrapped in display:none as of now
|
|
10
|
-
Capybara.ignore_hidden_elements = false
|
|
11
|
-
require 'mocha/minitest'
|
data/test/test_helper.rb
CHANGED
|
@@ -16,6 +16,7 @@ require 'json'
|
|
|
16
16
|
require 'redis'
|
|
17
17
|
require 'resque'
|
|
18
18
|
require 'pry-byebug'
|
|
19
|
+
require_relative 'unique_files'
|
|
19
20
|
$VERBOSE = original_verbosity
|
|
20
21
|
|
|
21
22
|
Coveralls.wear!
|
|
@@ -23,7 +24,10 @@ Coveralls.wear!
|
|
|
23
24
|
module Coverband
|
|
24
25
|
module Test
|
|
25
26
|
def self.reset
|
|
26
|
-
|
|
27
|
+
[:eager_loading, nil].each do |type|
|
|
28
|
+
Coverband.configuration.store.type = type
|
|
29
|
+
Coverband.configuration.store.clear!
|
|
30
|
+
end
|
|
27
31
|
Coverband.configuration.reset
|
|
28
32
|
Coverband::Collectors::Coverage.instance.reset_instance
|
|
29
33
|
Coverband::Background.stop
|
|
@@ -79,18 +83,6 @@ def basic_coverage
|
|
|
79
83
|
{ 'app_path/dog.rb' => example_line }
|
|
80
84
|
end
|
|
81
85
|
|
|
82
|
-
def fake_redis
|
|
83
|
-
@redis ||= begin
|
|
84
|
-
redis = OpenStruct.new
|
|
85
|
-
redis
|
|
86
|
-
end
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
def fake_coverage_report
|
|
90
|
-
file_name = '/Users/danmayer/projects/hearno/script/tester.rb'
|
|
91
|
-
{ file_name => [1, nil, 1, 1, nil, nil, nil] }
|
|
92
|
-
end
|
|
93
|
-
|
|
94
86
|
def source_fixture(filename)
|
|
95
87
|
File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', filename))
|
|
96
88
|
end
|
|
@@ -99,6 +91,10 @@ def test_root
|
|
|
99
91
|
File.expand_path(File.join(File.dirname(__FILE__)))
|
|
100
92
|
end
|
|
101
93
|
|
|
94
|
+
def store
|
|
95
|
+
Coverband.configuration.store
|
|
96
|
+
end
|
|
97
|
+
|
|
102
98
|
# Taken from http://stackoverflow.com/questions/4459330/how-do-i-temporarily-redirect-stderr-in-ruby
|
|
103
99
|
def capture_stderr
|
|
104
100
|
# The output stream must be an IO-like object. In this case we capture it in
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'securerandom'
|
|
4
|
+
require 'fileutils'
|
|
5
|
+
|
|
6
|
+
UNIQUE_FILES_DIR = "./test/unique_files"
|
|
7
|
+
|
|
8
|
+
def require_unique_file(file = 'dog.rb')
|
|
9
|
+
dir = "#{UNIQUE_FILES_DIR}/#{SecureRandom.uuid}"
|
|
10
|
+
FileUtils.mkdir_p(dir)
|
|
11
|
+
temp_file = "#{dir}/#{file}"
|
|
12
|
+
File.open(temp_file, 'w'){ |w| w.write(File.read("./test/#{file}")) }
|
|
13
|
+
require temp_file
|
|
14
|
+
temp_file
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def remove_unique_files
|
|
18
|
+
FileUtils.rm_r(UNIQUE_FILES_DIR) if File.exist?(UNIQUE_FILES_DIR)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
Minitest.after_run do
|
|
22
|
+
remove_unique_files
|
|
23
|
+
end
|
data/views/file_list.erb
CHANGED
|
@@ -23,9 +23,11 @@
|
|
|
23
23
|
<tr>
|
|
24
24
|
<th>File</th>
|
|
25
25
|
<th>% covered</th>
|
|
26
|
+
<th>% runtime</th>
|
|
26
27
|
<th>Lines</th>
|
|
27
28
|
<th>Relevant Lines</th>
|
|
28
29
|
<th>Lines covered</th>
|
|
30
|
+
<th>Lines runtime</th>
|
|
29
31
|
<th>Lines missed</th>
|
|
30
32
|
<th>Avg. Hits / Line</th>
|
|
31
33
|
</tr>
|
|
@@ -37,9 +39,16 @@
|
|
|
37
39
|
<%= link_to_source_file(source_file) %>
|
|
38
40
|
</td>
|
|
39
41
|
<td class="<%= coverage_css_class(source_file.covered_percent) %> strong"><%= source_file.covered_percent.round(2).to_s %> %</td>
|
|
42
|
+
<% runtime_percentage = result.file_with_type(source_file, Coverband::RUNTIME_TYPE).try(:covered_percent).try(:round, 2) %>
|
|
43
|
+
<td class="<%= "#{coverage_css_class(runtime_percentage)}" %> strong">
|
|
44
|
+
<%= "#{runtime_percentage || '0'} %" %>
|
|
45
|
+
</td>
|
|
40
46
|
<td><%= source_file.lines.count %></td>
|
|
41
47
|
<td><%= source_file.covered_lines.count + source_file.missed_lines.count %></td>
|
|
42
48
|
<td><%= source_file.covered_lines.count %></td>
|
|
49
|
+
<td>
|
|
50
|
+
<%= result.file_with_type(source_file, Coverband::RUNTIME_TYPE).try(:covered_lines).try(:count) || 0 %>
|
|
51
|
+
</td>
|
|
43
52
|
<td><%= source_file.missed_lines.count %></td>
|
|
44
53
|
<td><%= source_file.covered_strength %></td>
|
|
45
54
|
</tr>
|
data/views/gem_list.erb
CHANGED
|
@@ -49,6 +49,6 @@
|
|
|
49
49
|
|
|
50
50
|
<% if gem_details? %>
|
|
51
51
|
<% source_files.each do |gem_files| %>
|
|
52
|
-
<%= formatted_file_list(gem_files.first.gem_name, gem_files, skip_nav: true) %>
|
|
52
|
+
<%= formatted_file_list(gem_files.first.gem_name, result, gem_files, skip_nav: true) %>
|
|
53
53
|
<% end %>
|
|
54
54
|
<% end %>
|
data/views/layout.erb
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<title>Coverband: <%= Coverband::VERSION %></title>
|
|
5
5
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
|
6
|
+
<script src='<%= assets_path('dependencies.js') %>' type='text/javascript'></script>
|
|
6
7
|
<script src='<%= assets_path('application.js') %>' type='text/javascript'></script>
|
|
7
8
|
<link href='<%= assets_path('application.css') %>' media='screen, projection, print' rel='stylesheet' type='text/css'>
|
|
8
9
|
<link rel="shortcut icon" type="image/png" href="<%= assets_path("favicon_#{coverage_css_class(result.source_files.covered_percent)}.png") %>" />
|
|
@@ -33,10 +34,10 @@
|
|
|
33
34
|
<ul class="group_tabs"></ul>
|
|
34
35
|
|
|
35
36
|
<div id="content">
|
|
36
|
-
<%= formatted_file_list("All Files", result.source_files) unless view_gems? %>
|
|
37
|
+
<%= formatted_file_list("All Files", result, result.source_files) unless view_gems? %>
|
|
37
38
|
|
|
38
39
|
<% result.groups.each do |name, files| %>
|
|
39
|
-
<%= formatted_file_list(name, files) %>
|
|
40
|
+
<%= formatted_file_list(name, result, files) %>
|
|
40
41
|
<% end %>
|
|
41
42
|
</div>
|
|
42
43
|
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
<div class="source_files">
|
|
48
49
|
<% result.source_files.each do |source_file| %>
|
|
49
50
|
<% if (!source_file.gem? || (view_gems? && gem_details? && source_file.gem? )) %>
|
|
50
|
-
<%=
|
|
51
|
+
<%= formatted_source_file_loader(result, source_file) %>
|
|
51
52
|
<% end %>
|
|
52
53
|
<% end %>
|
|
53
54
|
</div>
|
data/views/source_file.erb
CHANGED
|
@@ -1,23 +1,35 @@
|
|
|
1
1
|
<div class="source_table" id="<%= id source_file %>">
|
|
2
2
|
<div class="header">
|
|
3
3
|
<h3><%= shortened_filename source_file %></h3>
|
|
4
|
-
<h4
|
|
4
|
+
<h4>
|
|
5
|
+
<span class="<%= coverage_css_class(source_file.covered_percent) %>"><%= source_file.covered_percent.round(2).to_s %> %</span>
|
|
6
|
+
covered
|
|
7
|
+
<% if Coverband.configuration.web_enable_clear %>
|
|
8
|
+
<%= button("#{base_path}clear_file?filename=#{source_file.relative_path}", 'clear file coverage') %>
|
|
9
|
+
<% end %>
|
|
10
|
+
</h4>
|
|
5
11
|
<div>
|
|
6
12
|
<b><%= source_file.lines_of_code %></b> relevant lines.
|
|
7
13
|
<span class="green"><b><%= source_file.covered_lines.count %></b> lines covered</span> and
|
|
8
14
|
<span class="red"><b><%= source_file.missed_lines.count %></b> lines missed.</span>
|
|
9
15
|
</div>
|
|
10
16
|
<div>
|
|
11
|
-
Coverage first seen: <%= source_file.first_updated_at %>, last activity recorded:
|
|
17
|
+
Coverage first seen: <%= source_file.first_updated_at %>, last activity recorded:
|
|
12
18
|
<%= source_file.last_updated_at %>
|
|
13
19
|
</div>
|
|
14
20
|
</div>
|
|
15
21
|
|
|
16
22
|
<pre>
|
|
17
23
|
<ol>
|
|
18
|
-
<% source_file.lines.
|
|
24
|
+
<% source_file.lines.each_with_index do |line, index| %>
|
|
19
25
|
<li class="<%= line.status %>" data-hits="<%= line.coverage ? line.coverage : '' %>" data-linenumber="<%= line.number %>">
|
|
20
|
-
<% if line.covered? %><span class="hits"
|
|
26
|
+
<% if line.covered? %><span class="hits">
|
|
27
|
+
load:
|
|
28
|
+
<%= result.file_with_type(source_file, Coverband::EAGER_TYPE).try(:lines).try(:[], index).try(:coverage) || 0 %>,
|
|
29
|
+
runtime:
|
|
30
|
+
<%= result.file_with_type(source_file, Coverband::RUNTIME_TYPE).try(:lines).try(:[], index).try(:coverage) || 0 %>
|
|
31
|
+
all: <%= line.coverage %>
|
|
32
|
+
</span><% end %>
|
|
21
33
|
<% if line.skipped? %><span class="hits">skipped</span><% end %>
|
|
22
34
|
<code class="ruby"><%= CGI.escapeHTML(line.src.chomp) %></code>
|
|
23
35
|
</li>
|
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.
|
|
4
|
+
version: 4.2.0
|
|
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
|
+
date: 2019-04-24 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: aws-sdk-s3
|
|
@@ -165,6 +165,20 @@ dependencies:
|
|
|
165
165
|
- - ">="
|
|
166
166
|
- !ruby/object:Gem::Version
|
|
167
167
|
version: '0'
|
|
168
|
+
- !ruby/object:Gem::Dependency
|
|
169
|
+
name: minitest-reporters
|
|
170
|
+
requirement: !ruby/object:Gem::Requirement
|
|
171
|
+
requirements:
|
|
172
|
+
- - ">="
|
|
173
|
+
- !ruby/object:Gem::Version
|
|
174
|
+
version: '0'
|
|
175
|
+
type: :development
|
|
176
|
+
prerelease: false
|
|
177
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
178
|
+
requirements:
|
|
179
|
+
- - ">="
|
|
180
|
+
- !ruby/object:Gem::Version
|
|
181
|
+
version: '0'
|
|
168
182
|
- !ruby/object:Gem::Dependency
|
|
169
183
|
name: classifier-reborn
|
|
170
184
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -207,6 +221,20 @@ dependencies:
|
|
|
207
221
|
- - ">="
|
|
208
222
|
- !ruby/object:Gem::Version
|
|
209
223
|
version: '0'
|
|
224
|
+
- !ruby/object:Gem::Dependency
|
|
225
|
+
name: minitest-profile
|
|
226
|
+
requirement: !ruby/object:Gem::Requirement
|
|
227
|
+
requirements:
|
|
228
|
+
- - ">="
|
|
229
|
+
- !ruby/object:Gem::Version
|
|
230
|
+
version: '0'
|
|
231
|
+
type: :development
|
|
232
|
+
prerelease: false
|
|
233
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
234
|
+
requirements:
|
|
235
|
+
- - ">="
|
|
236
|
+
- !ruby/object:Gem::Version
|
|
237
|
+
version: '0'
|
|
210
238
|
- !ruby/object:Gem::Dependency
|
|
211
239
|
name: redis
|
|
212
240
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -246,6 +274,7 @@ files:
|
|
|
246
274
|
- lib/coverband/adapters/redis_store.rb
|
|
247
275
|
- lib/coverband/at_exit.rb
|
|
248
276
|
- lib/coverband/collectors/coverage.rb
|
|
277
|
+
- lib/coverband/collectors/delta.rb
|
|
249
278
|
- lib/coverband/configuration.rb
|
|
250
279
|
- lib/coverband/integrations/background.rb
|
|
251
280
|
- lib/coverband/integrations/middleware.rb
|
|
@@ -263,6 +292,7 @@ files:
|
|
|
263
292
|
- lib/coverband/utils/lines_classifier.rb
|
|
264
293
|
- lib/coverband/utils/railtie.rb
|
|
265
294
|
- lib/coverband/utils/result.rb
|
|
295
|
+
- lib/coverband/utils/results.rb
|
|
266
296
|
- lib/coverband/utils/s3_report.rb
|
|
267
297
|
- lib/coverband/utils/source_file.rb
|
|
268
298
|
- lib/coverband/utils/tasks.rb
|
|
@@ -273,6 +303,8 @@ files:
|
|
|
273
303
|
- public/colorbox/controls.png
|
|
274
304
|
- public/colorbox/loading.gif
|
|
275
305
|
- public/colorbox/loading_background.png
|
|
306
|
+
- public/dependencies.js
|
|
307
|
+
- public/favicon.png
|
|
276
308
|
- public/favicon_green.png
|
|
277
309
|
- public/favicon_red.png
|
|
278
310
|
- public/favicon_yellow.png
|
|
@@ -293,8 +325,35 @@ files:
|
|
|
293
325
|
- public/magnify.png
|
|
294
326
|
- test/benchmarks/.gitignore
|
|
295
327
|
- test/benchmarks/benchmark.rake
|
|
328
|
+
- test/benchmarks/coverage_fork.sh
|
|
296
329
|
- test/benchmarks/dog.rb
|
|
297
330
|
- test/benchmarks/graph_bench.sh
|
|
331
|
+
- test/coverband/adapters/base_test.rb
|
|
332
|
+
- test/coverband/adapters/file_store_test.rb
|
|
333
|
+
- test/coverband/adapters/redis_store_test.rb
|
|
334
|
+
- test/coverband/at_exit_test.rb
|
|
335
|
+
- test/coverband/collectors/coverage_test.rb
|
|
336
|
+
- test/coverband/collectors/delta_test.rb
|
|
337
|
+
- test/coverband/configuration_test.rb
|
|
338
|
+
- test/coverband/coverband_test.rb
|
|
339
|
+
- test/coverband/integrations/background_test.rb
|
|
340
|
+
- test/coverband/integrations/middleware_test.rb
|
|
341
|
+
- test/coverband/integrations/rack_server_check_test.rb
|
|
342
|
+
- test/coverband/integrations/resque_worker_test.rb
|
|
343
|
+
- test/coverband/integrations/test_resque_job.rb
|
|
344
|
+
- test/coverband/reporters/base_test.rb
|
|
345
|
+
- test/coverband/reporters/console_test.rb
|
|
346
|
+
- test/coverband/reporters/html_test.rb
|
|
347
|
+
- test/coverband/reporters/web_test.rb
|
|
348
|
+
- test/coverband/utils/file_groups_test.rb
|
|
349
|
+
- test/coverband/utils/file_list_test.rb
|
|
350
|
+
- test/coverband/utils/gem_list_test.rb
|
|
351
|
+
- test/coverband/utils/lines_classifier_test.rb
|
|
352
|
+
- test/coverband/utils/result_test.rb
|
|
353
|
+
- test/coverband/utils/s3_report_test.rb
|
|
354
|
+
- test/coverband/utils/source_file_line_test.rb
|
|
355
|
+
- test/coverband/utils/source_file_test.rb
|
|
356
|
+
- test/dog.rb
|
|
298
357
|
- test/fake_app/basic_rack.rb
|
|
299
358
|
- test/fixtures/app/controllers/sample_controller.rb
|
|
300
359
|
- test/fixtures/app/models/user.rb
|
|
@@ -303,6 +362,8 @@ files:
|
|
|
303
362
|
- test/fixtures/skipped.rb
|
|
304
363
|
- test/fixtures/skipped_and_executed.rb
|
|
305
364
|
- test/fixtures/utf-8.rb
|
|
365
|
+
- test/integration/full_stack_test.rb
|
|
366
|
+
- test/integration/rails_full_stack_test.rb
|
|
306
367
|
- test/rails4_dummy/app/controllers/dummy_controller.rb
|
|
307
368
|
- test/rails4_dummy/config.ru
|
|
308
369
|
- test/rails4_dummy/config/application.rb
|
|
@@ -311,47 +372,23 @@ files:
|
|
|
311
372
|
- test/rails4_dummy/config/environment.rb
|
|
312
373
|
- test/rails4_dummy/config/routes.rb
|
|
313
374
|
- test/rails4_dummy/config/secrets.yml
|
|
375
|
+
- test/rails4_dummy/tmp/.keep
|
|
314
376
|
- test/rails5_dummy/app/controllers/dummy_controller.rb
|
|
315
377
|
- test/rails5_dummy/config.ru
|
|
316
378
|
- test/rails5_dummy/config/application.rb
|
|
317
379
|
- test/rails5_dummy/config/coverband.rb
|
|
318
380
|
- test/rails5_dummy/config/environment.rb
|
|
319
381
|
- test/rails5_dummy/config/routes.rb
|
|
382
|
+
- test/rails5_dummy/tmp/.keep
|
|
320
383
|
- test/rails_test_helper.rb
|
|
321
384
|
- test/test_helper.rb
|
|
322
|
-
- test/
|
|
323
|
-
- test/unit/adapters_file_store_test.rb
|
|
324
|
-
- test/unit/adapters_redis_store_test.rb
|
|
325
|
-
- test/unit/at_exit_test.rb
|
|
326
|
-
- test/unit/background_test.rb
|
|
327
|
-
- test/unit/collectors_coverage_test.rb
|
|
328
|
-
- test/unit/configuration_test.rb
|
|
329
|
-
- test/unit/coverband_test.rb
|
|
330
|
-
- test/unit/dog.rb
|
|
331
|
-
- test/unit/full_stack_test.rb
|
|
332
|
-
- test/unit/middleware_test.rb
|
|
333
|
-
- test/unit/rack_server_checkout_test.rb
|
|
334
|
-
- test/unit/rails_full_stack_test.rb
|
|
335
|
-
- test/unit/rails_gems_full_stack_test.rb
|
|
336
|
-
- test/unit/reports_base_test.rb
|
|
337
|
-
- test/unit/reports_console_test.rb
|
|
338
|
-
- test/unit/reports_html_test.rb
|
|
339
|
-
- test/unit/reports_web_test.rb
|
|
340
|
-
- test/unit/resque_worker_test.rb
|
|
341
|
-
- test/unit/test_resque_job.rb
|
|
342
|
-
- test/unit/utils/file_groups_test.rb
|
|
343
|
-
- test/unit/utils/file_list_test.rb
|
|
344
|
-
- test/unit/utils/gem_list_test.rb
|
|
345
|
-
- test/unit/utils/lines_classifier_test.rb
|
|
346
|
-
- test/unit/utils/result_test.rb
|
|
347
|
-
- test/unit/utils/s3_report_test.rb
|
|
348
|
-
- test/unit/utils/source_file_line_test.rb
|
|
349
|
-
- test/unit/utils/source_file_test.rb
|
|
385
|
+
- test/unique_files.rb
|
|
350
386
|
- views/file_list.erb
|
|
351
387
|
- views/gem_list.erb
|
|
352
388
|
- views/layout.erb
|
|
353
389
|
- views/settings.erb
|
|
354
390
|
- views/source_file.erb
|
|
391
|
+
- views/source_file_loader.erb
|
|
355
392
|
homepage: https://github.com/danmayer/coverband
|
|
356
393
|
licenses:
|
|
357
394
|
- MIT
|
|
@@ -372,15 +409,42 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
372
409
|
version: '0'
|
|
373
410
|
requirements: []
|
|
374
411
|
rubyforge_project:
|
|
375
|
-
rubygems_version: 2.
|
|
412
|
+
rubygems_version: 2.7.8
|
|
376
413
|
signing_key:
|
|
377
414
|
specification_version: 4
|
|
378
415
|
summary: Rack middleware to help measure production code usage (LOC runtime usage)
|
|
379
416
|
test_files:
|
|
380
417
|
- test/benchmarks/.gitignore
|
|
381
418
|
- test/benchmarks/benchmark.rake
|
|
419
|
+
- test/benchmarks/coverage_fork.sh
|
|
382
420
|
- test/benchmarks/dog.rb
|
|
383
421
|
- test/benchmarks/graph_bench.sh
|
|
422
|
+
- test/coverband/adapters/base_test.rb
|
|
423
|
+
- test/coverband/adapters/file_store_test.rb
|
|
424
|
+
- test/coverband/adapters/redis_store_test.rb
|
|
425
|
+
- test/coverband/at_exit_test.rb
|
|
426
|
+
- test/coverband/collectors/coverage_test.rb
|
|
427
|
+
- test/coverband/collectors/delta_test.rb
|
|
428
|
+
- test/coverband/configuration_test.rb
|
|
429
|
+
- test/coverband/coverband_test.rb
|
|
430
|
+
- test/coverband/integrations/background_test.rb
|
|
431
|
+
- test/coverband/integrations/middleware_test.rb
|
|
432
|
+
- test/coverband/integrations/rack_server_check_test.rb
|
|
433
|
+
- test/coverband/integrations/resque_worker_test.rb
|
|
434
|
+
- test/coverband/integrations/test_resque_job.rb
|
|
435
|
+
- test/coverband/reporters/base_test.rb
|
|
436
|
+
- test/coverband/reporters/console_test.rb
|
|
437
|
+
- test/coverband/reporters/html_test.rb
|
|
438
|
+
- test/coverband/reporters/web_test.rb
|
|
439
|
+
- test/coverband/utils/file_groups_test.rb
|
|
440
|
+
- test/coverband/utils/file_list_test.rb
|
|
441
|
+
- test/coverband/utils/gem_list_test.rb
|
|
442
|
+
- test/coverband/utils/lines_classifier_test.rb
|
|
443
|
+
- test/coverband/utils/result_test.rb
|
|
444
|
+
- test/coverband/utils/s3_report_test.rb
|
|
445
|
+
- test/coverband/utils/source_file_line_test.rb
|
|
446
|
+
- test/coverband/utils/source_file_test.rb
|
|
447
|
+
- test/dog.rb
|
|
384
448
|
- test/fake_app/basic_rack.rb
|
|
385
449
|
- test/fixtures/app/controllers/sample_controller.rb
|
|
386
450
|
- test/fixtures/app/models/user.rb
|
|
@@ -389,6 +453,8 @@ test_files:
|
|
|
389
453
|
- test/fixtures/skipped.rb
|
|
390
454
|
- test/fixtures/skipped_and_executed.rb
|
|
391
455
|
- test/fixtures/utf-8.rb
|
|
456
|
+
- test/integration/full_stack_test.rb
|
|
457
|
+
- test/integration/rails_full_stack_test.rb
|
|
392
458
|
- test/rails4_dummy/app/controllers/dummy_controller.rb
|
|
393
459
|
- test/rails4_dummy/config.ru
|
|
394
460
|
- test/rails4_dummy/config/application.rb
|
|
@@ -397,39 +463,14 @@ test_files:
|
|
|
397
463
|
- test/rails4_dummy/config/environment.rb
|
|
398
464
|
- test/rails4_dummy/config/routes.rb
|
|
399
465
|
- test/rails4_dummy/config/secrets.yml
|
|
466
|
+
- test/rails4_dummy/tmp/.keep
|
|
400
467
|
- test/rails5_dummy/app/controllers/dummy_controller.rb
|
|
401
468
|
- test/rails5_dummy/config.ru
|
|
402
469
|
- test/rails5_dummy/config/application.rb
|
|
403
470
|
- test/rails5_dummy/config/coverband.rb
|
|
404
471
|
- test/rails5_dummy/config/environment.rb
|
|
405
472
|
- test/rails5_dummy/config/routes.rb
|
|
473
|
+
- test/rails5_dummy/tmp/.keep
|
|
406
474
|
- test/rails_test_helper.rb
|
|
407
475
|
- test/test_helper.rb
|
|
408
|
-
- test/
|
|
409
|
-
- test/unit/adapters_file_store_test.rb
|
|
410
|
-
- test/unit/adapters_redis_store_test.rb
|
|
411
|
-
- test/unit/at_exit_test.rb
|
|
412
|
-
- test/unit/background_test.rb
|
|
413
|
-
- test/unit/collectors_coverage_test.rb
|
|
414
|
-
- test/unit/configuration_test.rb
|
|
415
|
-
- test/unit/coverband_test.rb
|
|
416
|
-
- test/unit/dog.rb
|
|
417
|
-
- test/unit/full_stack_test.rb
|
|
418
|
-
- test/unit/middleware_test.rb
|
|
419
|
-
- test/unit/rack_server_checkout_test.rb
|
|
420
|
-
- test/unit/rails_full_stack_test.rb
|
|
421
|
-
- test/unit/rails_gems_full_stack_test.rb
|
|
422
|
-
- test/unit/reports_base_test.rb
|
|
423
|
-
- test/unit/reports_console_test.rb
|
|
424
|
-
- test/unit/reports_html_test.rb
|
|
425
|
-
- test/unit/reports_web_test.rb
|
|
426
|
-
- test/unit/resque_worker_test.rb
|
|
427
|
-
- test/unit/test_resque_job.rb
|
|
428
|
-
- test/unit/utils/file_groups_test.rb
|
|
429
|
-
- test/unit/utils/file_list_test.rb
|
|
430
|
-
- test/unit/utils/gem_list_test.rb
|
|
431
|
-
- test/unit/utils/lines_classifier_test.rb
|
|
432
|
-
- test/unit/utils/result_test.rb
|
|
433
|
-
- test/unit/utils/s3_report_test.rb
|
|
434
|
-
- test/unit/utils/source_file_line_test.rb
|
|
435
|
-
- test/unit/utils/source_file_test.rb
|
|
476
|
+
- test/unique_files.rb
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require File.expand_path('../test_helper', File.dirname(__FILE__))
|
|
4
|
-
|
|
5
|
-
class BackgroundTest < Minitest::Test
|
|
6
|
-
def setup
|
|
7
|
-
super
|
|
8
|
-
Coverband.configure do |config|
|
|
9
|
-
config.store = Coverband::Adapters::RedisStore.new(Redis.new)
|
|
10
|
-
config.background_reporting_enabled = true
|
|
11
|
-
config.background_reporting_sleep_seconds = 30
|
|
12
|
-
end
|
|
13
|
-
Coverband::Background.stop
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
class ThreadDouble
|
|
17
|
-
def exit
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def test_start
|
|
22
|
-
Thread.expects(:new).yields.returns(ThreadDouble.new)
|
|
23
|
-
Coverband::Background.expects(:loop).yields
|
|
24
|
-
Coverband::Background.expects(:sleep).with(30)
|
|
25
|
-
Coverband::Collectors::Coverage.instance.expects(:report_coverage).once
|
|
26
|
-
2.times { Coverband::Background.start }
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require File.expand_path('../test_helper', File.dirname(__FILE__))
|
|
4
|
-
require File.expand_path('./dog', File.dirname(__FILE__))
|
|
5
|
-
|
|
6
|
-
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.3.0')
|
|
7
|
-
class CollectorsCoverageTest < Minitest::Test
|
|
8
|
-
attr_accessor :coverband
|
|
9
|
-
|
|
10
|
-
def setup
|
|
11
|
-
super
|
|
12
|
-
Coverband.configure do |config|
|
|
13
|
-
config.store = Coverband::Adapters::RedisStore.new(Redis.new)
|
|
14
|
-
end
|
|
15
|
-
@coverband = Coverband::Collectors::Coverage.instance.reset_instance
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def teardown
|
|
19
|
-
Thread.current[:coverband_instance] = nil
|
|
20
|
-
Coverband.configure do |config|
|
|
21
|
-
end
|
|
22
|
-
@coverband = Coverband::Collectors::Coverage.instance.reset_instance
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
test 'gets coverage instance' do
|
|
26
|
-
assert_equal Coverband::Collectors::Coverage, coverband.class
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
test 'defaults to a redis store' do
|
|
30
|
-
assert_equal Coverband::Adapters::RedisStore, coverband.instance_variable_get('@store').class
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
test 'report_coverage raises errors in tests' do
|
|
34
|
-
@coverband.reset_instance
|
|
35
|
-
@coverband.expects(:ready_to_report?).raises('Oh no')
|
|
36
|
-
assert_raises RuntimeError do
|
|
37
|
-
@coverband.report_coverage
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
test 'report_coverage does not raise errors in non-test mode' do
|
|
42
|
-
Coverband.configuration.stubs(:test_env).returns(false)
|
|
43
|
-
@coverband.expects(:ready_to_report?).raises('Oh no')
|
|
44
|
-
@coverband.reset_instance
|
|
45
|
-
@coverband.report_coverage
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
test 'default tmp ignores' do
|
|
49
|
-
heroku_build_file = '/tmp/build_81feca8c72366e4edf020dc6f1937485/config/initializers/assets.rb'
|
|
50
|
-
assert_equal false, @coverband.send(:track_file?, heroku_build_file)
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
end
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require File.expand_path('../rails_test_helper', File.dirname(__FILE__))
|
|
4
|
-
|
|
5
|
-
class RailsGemsFullStackTest < Minitest::Test
|
|
6
|
-
include Capybara::DSL
|
|
7
|
-
include Capybara::Minitest::Assertions
|
|
8
|
-
|
|
9
|
-
def setup
|
|
10
|
-
super
|
|
11
|
-
# The normal relative directory lookup of coverband won't work for our dummy rails project
|
|
12
|
-
Coverband.configure("./test/rails#{Rails::VERSION::MAJOR}_dummy/config/coverband.rb")
|
|
13
|
-
Coverband.configuration.track_gems = true
|
|
14
|
-
Coverband.configuration.gem_details = true
|
|
15
|
-
Coverband.configuration.background_reporting_enabled = false
|
|
16
|
-
Coverband.start
|
|
17
|
-
require 'rainbow'
|
|
18
|
-
Rainbow('this text is red').red
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def teardown
|
|
22
|
-
super
|
|
23
|
-
Capybara.reset_sessions!
|
|
24
|
-
Capybara.use_default_driver
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
test 'this is how gem it' do
|
|
28
|
-
visit '/dummy/show'
|
|
29
|
-
assert_content('I am no dummy')
|
|
30
|
-
Coverband.report_coverage(true)
|
|
31
|
-
visit '/coverage'
|
|
32
|
-
assert_content('Coverband Admin')
|
|
33
|
-
assert_content('Gems')
|
|
34
|
-
assert page.html.match('rainbow/wrapper.rb')
|
|
35
|
-
end
|
|
36
|
-
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|