coverband 4.2.7 → 5.0.0.rc.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) 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 +8 -77
  8. data/Rakefile +17 -17
  9. data/changes.md +18 -27
  10. data/config.ru +1 -1
  11. data/coverband.gemspec +29 -34
  12. data/lib/coverband.rb +55 -43
  13. data/lib/coverband/adapters/base.rb +17 -17
  14. data/lib/coverband/adapters/file_store.rb +2 -2
  15. data/lib/coverband/adapters/hash_redis_store.rb +24 -21
  16. data/lib/coverband/adapters/redis_store.rb +12 -12
  17. data/lib/coverband/at_exit.rb +1 -1
  18. data/lib/coverband/collectors/coverage.rb +15 -27
  19. data/lib/coverband/collectors/delta.rb +19 -9
  20. data/lib/coverband/collectors/view_tracker.rb +10 -10
  21. data/lib/coverband/configuration.rb +47 -83
  22. data/lib/coverband/integrations/background.rb +3 -3
  23. data/lib/coverband/integrations/rack_server_check.rb +3 -3
  24. data/lib/coverband/reporters/base.rb +10 -10
  25. data/lib/coverband/reporters/console_report.rb +1 -1
  26. data/lib/coverband/reporters/html_report.rb +10 -30
  27. data/lib/coverband/reporters/web.rb +56 -49
  28. data/lib/coverband/utils/absolute_file_converter.rb +6 -6
  29. data/lib/coverband/utils/html_formatter.rb +32 -61
  30. data/lib/coverband/utils/railtie.rb +16 -4
  31. data/lib/coverband/utils/relative_file_converter.rb +2 -2
  32. data/lib/coverband/utils/result.rb +6 -11
  33. data/lib/coverband/utils/results.rb +0 -10
  34. data/lib/coverband/utils/source_file.rb +21 -30
  35. data/lib/coverband/utils/tasks.rb +7 -11
  36. data/lib/coverband/version.rb +1 -1
  37. data/public/application.js +0 -30
  38. data/test/benchmarks/benchmark.rake +97 -92
  39. data/test/benchmarks/dog.rb +1 -1
  40. data/test/benchmarks/init_rails.rake +4 -4
  41. data/test/coverband/adapters/base_test.rb +29 -30
  42. data/test/coverband/adapters/file_store_test.rb +15 -16
  43. data/test/coverband/adapters/hash_redis_store_test.rb +57 -57
  44. data/test/coverband/adapters/redis_store_test.rb +26 -26
  45. data/test/coverband/at_exit_test.rb +2 -2
  46. data/test/coverband/collectors/coverage_test.rb +33 -47
  47. data/test/coverband/collectors/delta_test.rb +51 -23
  48. data/test/coverband/collectors/view_tracker_test.rb +35 -35
  49. data/test/coverband/configuration_test.rb +15 -41
  50. data/test/coverband/coverband_test.rb +11 -11
  51. data/test/coverband/integrations/background_middleware_test.rb +10 -10
  52. data/test/coverband/integrations/background_test.rb +3 -2
  53. data/test/coverband/integrations/rack_server_check_test.rb +7 -7
  54. data/test/coverband/integrations/report_middleware_test.rb +9 -9
  55. data/test/coverband/integrations/resque_worker_test.rb +9 -9
  56. data/test/coverband/integrations/test_resque_job.rb +1 -1
  57. data/test/coverband/reporters/base_test.rb +9 -9
  58. data/test/coverband/reporters/console_test.rb +6 -6
  59. data/test/coverband/reporters/html_test.rb +36 -48
  60. data/test/coverband/reporters/web_test.rb +16 -18
  61. data/test/coverband/utils/absolute_file_converter_test.rb +22 -22
  62. data/test/coverband/utils/file_hasher_test.rb +6 -12
  63. data/test/coverband/utils/file_list_test.rb +13 -13
  64. data/test/coverband/utils/html_formatter_test.rb +9 -23
  65. data/test/coverband/utils/lines_classifier_test.rb +29 -29
  66. data/test/coverband/utils/relative_file_converter_test.rb +13 -13
  67. data/test/coverband/utils/result_test.rb +18 -18
  68. data/test/coverband/utils/results_test.rb +17 -17
  69. data/test/coverband/utils/source_file_line_test.rb +46 -46
  70. data/test/coverband/utils/source_file_test.rb +38 -88
  71. data/test/dog.rb +1 -1
  72. data/test/fake_app/basic_rack.rb +2 -2
  73. data/test/fixtures/app/controllers/sample_controller.rb +1 -1
  74. data/test/fixtures/app/models/user.rb +1 -1
  75. data/test/fixtures/sample.rb +1 -1
  76. data/test/fixtures/utf-8.rb +0 -2
  77. data/test/forked/rails_full_stack_test.rb +24 -27
  78. data/test/forked/rails_rake_full_stack_test.rb +7 -26
  79. data/test/integration/full_stack_test.rb +11 -22
  80. data/test/jruby_check.rb +2 -3
  81. data/test/rails4_dummy/Rakefile +1 -1
  82. data/test/rails4_dummy/config.ru +1 -1
  83. data/test/rails4_dummy/config/application.rb +4 -4
  84. data/test/rails4_dummy/config/boot.rb +2 -2
  85. data/test/rails4_dummy/config/coverband.rb +1 -1
  86. data/test/rails4_dummy/config/coverband_missing_redis.rb +1 -1
  87. data/test/rails4_dummy/config/environment.rb +1 -1
  88. data/test/rails4_dummy/config/routes.rb +2 -2
  89. data/test/rails5_dummy/Rakefile +1 -1
  90. data/test/rails5_dummy/config.ru +1 -1
  91. data/test/rails5_dummy/config/application.rb +3 -3
  92. data/test/rails5_dummy/config/coverband.rb +8 -8
  93. data/test/rails5_dummy/config/coverband_missing_redis.rb +8 -8
  94. data/test/rails5_dummy/config/environment.rb +1 -1
  95. data/test/rails5_dummy/config/routes.rb +2 -2
  96. data/test/rails6_dummy/Rakefile +1 -1
  97. data/test/rails6_dummy/config.ru +1 -1
  98. data/test/rails6_dummy/config/application.rb +4 -4
  99. data/test/rails6_dummy/config/boot.rb +2 -2
  100. data/test/rails6_dummy/config/coverband.rb +1 -1
  101. data/test/rails6_dummy/config/coverband_missing_redis.rb +1 -1
  102. data/test/rails6_dummy/config/environment.rb +1 -1
  103. data/test/rails6_dummy/config/routes.rb +2 -2
  104. data/test/rails_test_helper.rb +11 -11
  105. data/test/test_helper.rb +41 -34
  106. data/test/unique_files.rb +10 -10
  107. data/views/layout.erb +2 -12
  108. metadata +6 -45
  109. data/.rubocop.yml +0 -86
  110. data/lib/coverband/integrations/bundler.rb +0 -8
  111. data/lib/coverband/utils/file_groups.rb +0 -53
  112. data/lib/coverband/utils/gem_list.rb +0 -31
  113. data/lib/coverband/utils/s3_report.rb +0 -105
  114. data/test/coverband/utils/file_groups_test.rb +0 -61
  115. data/test/coverband/utils/gem_list_test.rb +0 -48
  116. data/test/coverband/utils/s3_report_test.rb +0 -44
  117. data/views/gem_list.erb +0 -63
@@ -4,25 +4,21 @@ namespace :coverband do
4
4
  # handles configuring in require => false and COVERBAND_DISABLE_AUTO_START cases
5
5
  Coverband.configure unless Coverband.configured?
6
6
 
7
- desc 'report runtime Coverband code coverage'
7
+ desc "report runtime Coverband code coverage"
8
8
  task :coverage do
9
- if Coverband.configuration.reporter == 'scov'
10
- Coverband::Reporters::HTMLReport.new(Coverband.configuration.store).report
11
- else
12
- Coverband::Reporters::ConsoleReport.report(Coverband.configuration.store)
13
- end
9
+ Coverband::Reporters::ConsoleReport.report(Coverband.configuration.store)
14
10
  end
15
11
 
16
- desc 'report runtime Coverband code coverage'
12
+ desc "report runtime Coverband code coverage"
17
13
  task :coverage_server do
18
- Rake.application['environment'].invoke if Rake::Task.task_defined?('environment')
19
- Rack::Server.start app: Coverband::Reporters::Web.new, Port: ENV.fetch('COVERBAND_COVERAGE_PORT', 1022).to_i
14
+ Rake.application["environment"].invoke if Rake::Task.task_defined?("environment")
15
+ Rack::Server.start app: Coverband::Reporters::Web.new, Port: ENV.fetch("COVERBAND_COVERAGE_PORT", 1022).to_i
20
16
  end
21
17
 
22
18
  ###
23
19
  # clear data helpful for development or after configuration issues
24
20
  ###
25
- desc 'reset Coverband coverage data, helpful for development, debugging, etc'
21
+ desc "reset Coverband coverage data, helpful for development, debugging, etc"
26
22
  task :clear do
27
23
  Coverband.configuration.store.clear!
28
24
  end
@@ -30,7 +26,7 @@ namespace :coverband do
30
26
  ###
31
27
  # Updates the data in the coverband store from one format to another
32
28
  ###
33
- desc 'upgrade previous Coverband datastore to latest format'
29
+ desc "upgrade previous Coverband datastore to latest format"
34
30
  task :migrate do
35
31
  Coverband.configuration.store.migrate!
36
32
  end
@@ -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.7'
8
+ VERSION = "5.0.0.rc.3"
9
9
  end
@@ -33,23 +33,6 @@ $(document).ready(function() {
33
33
  ]
34
34
  });
35
35
 
36
- // Configuration for fancy sortable tables for source file groups
37
- $(".gem_list").dataTable({
38
- aaSorting: [[1, "asc"]],
39
- bPaginate: false,
40
- bJQueryUI: true,
41
- aoColumns: [
42
- null,
43
- { sType: "percent" },
44
- { sType: "percent" },
45
- null,
46
- null,
47
- null,
48
- null,
49
- null
50
- ]
51
- });
52
-
53
36
  // Syntax highlight all files up front - deactivated
54
37
  // $('.source_table pre code').each(function(i, e) {hljs.highlightBlock(e, ' ')});
55
38
 
@@ -184,17 +167,6 @@ $(document).ready(function() {
184
167
  return false;
185
168
  });
186
169
 
187
- $("a.gem-link").live("click", function() {
188
- $(".file_list_container").hide();
189
- $(".file_list_container" + $(this).attr("href")).show();
190
- window.location.href =
191
- window.location.href.split("#")[0] +
192
- $(this)
193
- .attr("href")
194
- .replace("#", "#_");
195
- return false;
196
- });
197
-
198
170
  if (jQuery.url.attr("anchor")) {
199
171
  var anchor = jQuery.url.attr("anchor");
200
172
  // source file hash
@@ -203,8 +175,6 @@ $(document).ready(function() {
203
175
  } else {
204
176
  if ($(".group_tabs a." + anchor.replace("_", "")).length > 0) {
205
177
  $(".group_tabs a." + anchor.replace("_", "")).click();
206
- } else {
207
- $("a.gem-link[href=#" + anchor.replace("_", "") + "]").click();
208
178
  }
209
179
  }
210
180
  } else {
@@ -14,9 +14,11 @@ namespace :benchmarks do
14
14
  run_gc
15
15
  end
16
16
 
17
- def warmup_stats(*); end
17
+ def warmup_stats(*)
18
+ end
18
19
 
19
- def add_report(*); end
20
+ def add_report(*)
21
+ end
20
22
 
21
23
  private
22
24
 
@@ -29,46 +31,47 @@ namespace :benchmarks do
29
31
 
30
32
  # desc 'setup standard benchmark'
31
33
  task :setup do
32
- require 'benchmark'
33
- require 'benchmark/ips'
34
+ require "benchmark"
35
+ require "benchmark/ips"
36
+ require "redis"
34
37
 
35
- if ENV['COVERAGE'] || ENV['ONESHOT']
36
- require 'coverage'
37
- ::Coverage.start(oneshot_lines: !!ENV['ONESHOT'])
38
+ if ENV["COVERAGE"] || ENV["ONESHOT"]
39
+ require "coverage"
40
+ ::Coverage.start(oneshot_lines: !!ENV["ONESHOT"])
38
41
  end
39
- require 'redis'
40
- require 'coverband'
41
- require File.join(File.dirname(__FILE__), 'dog')
42
+ require "coverband"
43
+
44
+ require File.join(File.dirname(__FILE__), "dog")
42
45
  end
43
46
 
44
47
  def benchmark_redis_store
45
- redis = if ENV['REDIS_TEST_URL']
46
- Redis.new(url: ENV['REDIS_TEST_URL'])
47
- else
48
- Redis.new
49
- end
48
+ redis = if ENV["REDIS_TEST_URL"]
49
+ Redis.new(url: ENV["REDIS_TEST_URL"])
50
+ else
51
+ Redis.new
52
+ end
50
53
  Coverband::Adapters::RedisStore.new(redis,
51
- redis_namespace: 'coverband_bench')
54
+ redis_namespace: "coverband_bench")
52
55
  end
53
56
 
54
57
  # desc 'set up coverband with Redis'
55
58
  task :setup_redis do
56
59
  Coverband.configure do |config|
57
- config.root = Dir.pwd
58
- config.logger = $stdout
59
- config.store = benchmark_redis_store
60
- config.use_oneshot_lines_coverage = true if ENV['ONESHOT']
61
- config.simulate_oneshot_lines_coverage = true if ENV['SIMULATE_ONESHOT']
60
+ config.root = Dir.pwd
61
+ config.logger = $stdout
62
+ config.store = benchmark_redis_store
63
+ config.use_oneshot_lines_coverage = true if ENV["ONESHOT"]
64
+ config.simulate_oneshot_lines_coverage = true if ENV["SIMULATE_ONESHOT"]
62
65
  end
63
66
  end
64
67
 
65
68
  # desc 'set up coverband with filestore'
66
69
  task :setup_file do
67
70
  Coverband.configure do |config|
68
- config.root = Dir.pwd
69
- config.logger = $stdout
70
- file_path = '/tmp/benchmark_store.json'
71
- config.store = Coverband::Adapters::FileStore.new(file_path)
71
+ config.root = Dir.pwd
72
+ config.logger = $stdout
73
+ file_path = "/tmp/benchmark_store.json"
74
+ config.store = Coverband::Adapters::FileStore.new(file_path)
72
75
  end
73
76
  end
74
77
 
@@ -83,14 +86,14 @@ namespace :benchmarks do
83
86
  suite = GCSuite.new
84
87
  Benchmark.ips do |x|
85
88
  x.config(time: 12, warmup: 5, suite: suite)
86
- x.report 'coverband' do
89
+ x.report "coverband" do
87
90
  work
88
91
  Coverband.report_coverage
89
92
  end
90
- x.report 'no coverband' do
93
+ x.report "no coverband" do
91
94
  work
92
95
  end
93
- x.hold! 'temp_results' if hold_work
96
+ x.hold! "temp_results" if hold_work
94
97
  x.compare!
95
98
  end
96
99
  Coverband::Collectors::Coverage.instance.reset_instance
@@ -100,7 +103,7 @@ namespace :benchmarks do
100
103
  NON_NIL_LINES = 18
101
104
  def fake_line_numbers
102
105
  LINES.times.map do |line|
103
- coverage = (line < NON_NIL_LINES) ? rand(5) : nil
106
+ coverage = line < NON_NIL_LINES ? rand(5) : nil
104
107
  end
105
108
  end
106
109
 
@@ -141,18 +144,18 @@ namespace :benchmarks do
141
144
  5.times { store.save_report(report) }
142
145
  Benchmark.ips do |x|
143
146
  x.config(time: 15, warmup: 5)
144
- x.report('store_reports_all') { store.save_report(report) }
147
+ x.report("store_reports_all") { store.save_report(report) }
145
148
  end
146
149
  keys_subset = report.keys.first(100)
147
150
  report_subset = report.select { |key, _value| keys_subset.include?(key) }
148
151
  Benchmark.ips do |x|
149
152
  x.config(time: 20, warmup: 5)
150
- x.report('store_reports_subset') { store.save_report(report_subset) }
153
+ x.report("store_reports_subset") { store.save_report(report_subset) }
151
154
  end
152
155
  end
153
156
 
154
157
  def measure_memory
155
- require 'memory_profiler'
158
+ require "memory_profiler"
156
159
  report = fake_report
157
160
  store = benchmark_redis_store
158
161
  store.clear!
@@ -165,21 +168,21 @@ namespace :benchmarks do
165
168
  capture = StringIO.new
166
169
  $stdout = capture
167
170
 
168
- MemoryProfiler.report do
171
+ MemoryProfiler.report {
169
172
  10.times { store.save_report(report) }
170
- end.pretty_print
173
+ }.pretty_print
171
174
  data = $stdout.string
172
175
  $stdout = previous_out
173
- unless data.match('Total retained: 0 bytes')
176
+ unless data.match?("Total retained: 0 bytes")
174
177
  puts data
175
- raise 'leaking memory!!!'
178
+ raise "leaking memory!!!"
176
179
  end
177
180
  ensure
178
181
  $stdout = previous_out
179
182
  end
180
183
 
181
184
  def measure_memory_report_coverage
182
- require 'memory_profiler'
185
+ require "memory_profiler"
183
186
  report = fake_report
184
187
  store = benchmark_redis_store
185
188
  store.clear!
@@ -192,7 +195,7 @@ namespace :benchmarks do
192
195
  capture = StringIO.new
193
196
  $stdout = capture
194
197
 
195
- MemoryProfiler.report do
198
+ MemoryProfiler.report {
196
199
  10.times do
197
200
  Coverband.report_coverage
198
201
  ###
@@ -202,12 +205,12 @@ namespace :benchmarks do
202
205
  ###
203
206
  Coverband::Collectors::Delta.class_variable_set(:@@previous_coverage, nil)
204
207
  end
205
- end.pretty_print
208
+ }.pretty_print
206
209
  data = $stdout.string
207
210
  $stdout = previous_out
208
- unless data.match('Total retained: 0 bytes')
211
+ unless data.match?("Total retained: 0 bytes")
209
212
  puts data
210
- raise 'leaking memory!!!'
213
+ raise "leaking memory!!!"
211
214
  end
212
215
  ensure
213
216
  $stdout = previous_out
@@ -219,7 +222,7 @@ namespace :benchmarks do
219
222
  # not including in test suite but we can try to figure it out and fix.
220
223
  ###
221
224
  def measure_configure_memory
222
- require 'memory_profiler'
225
+ require "memory_profiler"
223
226
  # warmup
224
227
  3.times { Coverband.configure }
225
228
 
@@ -227,31 +230,31 @@ namespace :benchmarks do
227
230
  capture = StringIO.new
228
231
  $stdout = capture
229
232
 
230
- MemoryProfiler.report do
233
+ MemoryProfiler.report {
231
234
  10.times do
232
235
  Coverband.configure do |config|
233
- redis_url = ENV['CACHE_REDIS_URL'] || ENV['REDIS_URL']
234
- config.store = Coverband::Adapters::RedisStore.new(Redis.new(url: redis_url), redis_namespace: 'coverband_bench_data')
236
+ redis_url = ENV["CACHE_REDIS_URL"] || ENV["REDIS_URL"]
237
+ config.store = Coverband::Adapters::RedisStore.new(Redis.new(url: redis_url), redis_namespace: "coverband_bench_data")
235
238
  end
236
239
  end
237
- end.pretty_print
240
+ }.pretty_print
238
241
  data = $stdout.string
239
242
  $stdout = previous_out
240
- unless data.match('Total retained: 0 bytes')
243
+ unless data.match?("Total retained: 0 bytes")
241
244
  puts data
242
- raise 'leaking memory!!!'
245
+ raise "leaking memory!!!"
243
246
  end
244
247
  ensure
245
248
  $stdout = previous_out
246
249
  end
247
250
 
248
- desc 'checks memory of collector'
251
+ desc "checks memory of collector"
249
252
  task memory_check: [:setup] do
250
253
  # require 'pry-byebug'
251
- require 'objspace'
252
- puts 'memory load check'
254
+ require "objspace"
255
+ puts "memory load check"
253
256
  puts(ObjectSpace.memsize_of_all / 2**20)
254
- data = File.read('./tmp/debug_data.json')
257
+ data = File.read("./tmp/debug_data.json")
255
258
  # about 2mb
256
259
  puts(ObjectSpace.memsize_of(data) / 2**20)
257
260
 
@@ -288,65 +291,67 @@ namespace :benchmarks do
288
291
  json_data = nil
289
292
  GC.start
290
293
  puts(ObjectSpace.memsize_of_all / 2**20)
291
- debugger
292
- puts 'done'
294
+
295
+ # dig in some more...
296
+ # debugger
297
+ puts "done"
293
298
  end
294
299
 
295
- desc 'runs memory reporting on Redis store'
300
+ desc "runs memory reporting on Redis store"
296
301
  task memory_reporting: [:setup] do
297
- puts 'runs memory benchmarking to ensure we dont leak'
302
+ puts "runs memory benchmarking to ensure we dont leak"
298
303
  measure_memory
299
304
  end
300
305
 
301
- desc 'runs memory reporting on report_coverage'
306
+ desc "runs memory reporting on report_coverage"
302
307
  task memory_reporting_report_coverage: [:setup] do
303
- puts 'runs memory benchmarking on report_coverage to ensure we dont leak'
308
+ puts "runs memory benchmarking on report_coverage to ensure we dont leak"
304
309
  measure_memory_report_coverage
305
310
  end
306
311
 
307
- desc 'runs memory reporting on configure'
312
+ desc "runs memory reporting on configure"
308
313
  task memory_configure_reporting: [:setup] do
309
- puts 'runs memory benchmarking on configure to ensure we dont leak'
314
+ puts "runs memory benchmarking on configure to ensure we dont leak"
310
315
  measure_configure_memory
311
316
  end
312
317
 
313
- desc 'runs memory leak check via Rails tests'
318
+ desc "runs memory leak check via Rails tests"
314
319
  task memory_rails: [:setup] do
315
- puts 'runs memory rails test to ensure we dont leak'
320
+ puts "runs memory rails test to ensure we dont leak"
316
321
  puts `COVERBAND_MEMORY_TEST=true bundle exec test/forked/rails_full_stack_test.rb`
317
322
  end
318
323
 
319
- desc 'runs memory leak checks'
324
+ desc "runs memory leak checks"
320
325
  task memory: %i[memory_reporting memory_reporting_report_coverage memory_rails] do
321
- puts 'done'
326
+ puts "done"
322
327
  end
323
328
 
324
- desc 'runs benchmarks on reporting large sets of files to redis'
329
+ desc "runs benchmarks on reporting large sets of files to redis"
325
330
  task redis_reporting: [:setup] do
326
- puts 'runs benchmarks on reporting large sets of files to redis'
331
+ puts "runs benchmarks on reporting large sets of files to redis"
327
332
  reporting_speed
328
333
  end
329
334
 
330
335
  # desc 'runs benchmarks on default redis setup'
331
336
  task run_redis: %i[setup setup_redis] do
332
- puts 'Coverband configured with default Redis store'
337
+ puts "Coverband configured with default Redis store"
333
338
  run_work(true)
334
339
  end
335
340
 
336
341
  def run_big
337
- require 'memory_profiler'
338
- require './test/unique_files'
342
+ require "memory_profiler"
343
+ require "./test/unique_files"
339
344
 
340
- 4000.times { |index| require_unique_file('big_dog.rb.erb', dog_number: index) }
345
+ 4000.times { |index| require_unique_file("big_dog.rb.erb", dog_number: index) }
341
346
  # warmup
342
347
  3.times { Coverband.report_coverage }
343
348
  dogs = 400.times.map { |index| Object.const_get("Dog#{index}") }
344
- MemoryProfiler.report do
349
+ MemoryProfiler.report {
345
350
  10.times do
346
351
  dogs.each(&:bark)
347
352
  Coverband.report_coverage
348
353
  end
349
- end.pretty_print
354
+ }.pretty_print
350
355
  end
351
356
 
352
357
  task run_big: %i[setup setup_redis] do
@@ -358,18 +363,18 @@ namespace :benchmarks do
358
363
 
359
364
  # desc 'runs benchmarks file store'
360
365
  task run_file: %i[setup setup_file] do
361
- puts 'Coverband configured with file store'
366
+ puts "Coverband configured with file store"
362
367
  run_work(true)
363
368
  end
364
369
 
365
- desc 'benchmarks external requests to coverband_demo site'
370
+ desc "benchmarks external requests to coverband_demo site"
366
371
  task :coverband_demo do
367
372
  # for local testing
368
373
  # puts `ab -n 500 -c 5 "http://127.0.0.1:3000/posts"`
369
374
  puts `ab -n 2000 -c 10 "https://coverband-demo.herokuapp.com/posts"`
370
375
  end
371
376
 
372
- desc 'benchmarks external requests to coverband_demo site'
377
+ desc "benchmarks external requests to coverband_demo site"
373
378
  task :coverband_demo_graph do
374
379
  # for local testing
375
380
  # puts `ab -n 200 -c 5 "http://127.0.0.1:3000/posts"`
@@ -379,38 +384,38 @@ namespace :benchmarks do
379
384
  `open tmp/timeseries.jpg`
380
385
  end
381
386
 
382
- desc 'benchmark initialization of rails'
387
+ desc "benchmark initialization of rails"
383
388
  task :init_rails do
384
- require 'benchmark'
385
- require 'benchmark/ips'
389
+ require "benchmark"
390
+ require "benchmark/ips"
386
391
  Benchmark.ips do |x|
387
392
  x.config(time: 60, warmup: 0)
388
- x.report('init_rails') do
389
- system('bundle exec rake init_rails -f ./test/benchmarks/init_rails.rake')
393
+ x.report("init_rails") do
394
+ system("bundle exec rake init_rails -f ./test/benchmarks/init_rails.rake")
390
395
  end
391
396
  end
392
397
  end
393
398
 
394
- desc 'compare Coverband Ruby Coverage with Filestore with normal Ruby'
399
+ desc "compare Coverband Ruby Coverage with Filestore with normal Ruby"
395
400
  task :compare_file do
396
- puts 'comparing Coverage loaded/not, this takes some time for output...'
397
- puts 'coverage loaded'
401
+ puts "comparing Coverage loaded/not, this takes some time for output..."
402
+ puts "coverage loaded"
398
403
  puts `COVERAGE=true rake benchmarks:run_file`
399
- puts 'just the work'
404
+ puts "without coverage"
400
405
  puts `rake benchmarks:run_file`
401
406
  end
402
407
 
403
- desc 'compare Coverband Ruby Coverage with Redis and normal Ruby'
408
+ desc "compare Coverband Ruby Coverage with Redis and normal Ruby"
404
409
  task :compare_redis do
405
- puts 'comparing Coverage loaded/not, this takes some time for output...'
406
- puts 'coverage loaded'
410
+ puts "comparing Coverage loaded/not, this takes some time for output..."
411
+ puts "coverage loaded"
407
412
  puts `COVERAGE=true rake benchmarks:run_redis`
408
- puts 'just the work'
413
+ puts "without coverage"
409
414
  puts `rake benchmarks:run_redis`
410
415
  end
411
416
  end
412
417
 
413
- desc 'runs benchmarks'
414
- task benchmarks: ['benchmarks:redis_reporting',
415
- 'benchmarks:compare_file',
416
- 'benchmarks:compare_redis']
418
+ desc "runs benchmarks"
419
+ task benchmarks: ["benchmarks:redis_reporting",
420
+ "benchmarks:compare_file",
421
+ "benchmarks:compare_redis"]