test_diff 0.4.1 → 0.4.2

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: 9fb2c71bdebb9c9f0e15b930acfef216c69f3528cbd8cb4a1eb7e2fee9a9a6c3
4
- data.tar.gz: 3429b4d48db85f1be92c11141d8aa3d33c0e31cea7cc994d03d8d44945d662bf
3
+ metadata.gz: 7be473c3e92a840440cda6b28dc949df0537fa0609ceac286ede4ea8ed6e0b1a
4
+ data.tar.gz: 7dcb1ddb32ecdd1ce6be3290c7cb69c18b700efc2ace0eb521a6f70beac916e8
5
5
  SHA512:
6
- metadata.gz: f0a07db661aaf054fcfe3c70170d4e852a33ad4b2a65e6b0f027aeb1070298b0cb455ab4eb8a5fdccc4e142f4a11c6b0ff8aad7254d958dea7541ef45107e037
7
- data.tar.gz: ed2f603c354400f4c2c4c46dc7ad9db200d0247f0a86cd4276eccf516c7df0be856c72f55066e50f4bf83729138abf102d3978655c960f239b11090ba4036d8f
6
+ metadata.gz: 975ed0a4f7883ea2699fb21658b129c6e6181ccdb4d404c8e9296dc43048675720121b8e5b4758dbbd8bb2aa3ff0c267ac113f02ffa3e34a5ee8fdd28b6bcaa6
7
+ data.tar.gz: 809699defd831c5f7aca2d2ff01846033b2225f6f02d6ec0475d6302aa224c72deec2cd04bbec4f1872f7e90e646e2a2816957698827c66c4448e3a7b0f3ca57
@@ -19,6 +19,7 @@ module TestDiff
19
19
  require_boot
20
20
  require_rspec
21
21
  require_pre_load
22
+ pre_run_checks
22
23
  run_batch
23
24
  end
24
25
 
@@ -42,6 +43,10 @@ module TestDiff
42
43
  require 'rspec'
43
44
  end
44
45
 
46
+ def pre_run_checks
47
+ raise 'please disable simplecov while using test_diff. Check README.md for examples' if defined?(SimpleCov)
48
+ end
49
+
45
50
  def run_batch
46
51
  TimingTracker.run(@batch_queue) { start }
47
52
  puts 'Test done, compacting db'
@@ -24,10 +24,6 @@ module TestDiff
24
24
  @queue.size
25
25
  end
26
26
 
27
- def queue_completed
28
- @original_size - queue_size
29
- end
30
-
31
27
  def seconds_elapsed
32
28
  (Time.now - @start_time).to_f
33
29
  end
@@ -44,17 +40,18 @@ module TestDiff
44
40
 
45
41
  def do_timing
46
42
  puts "Timing #{@original_size} specs"
43
+ sleep_time = 30.0
47
44
  until queue_empty?
45
+ last_current_size = queue_size
46
+ sleep(sleep_time)
48
47
  current_size = queue_size
49
- current_completed = queue_completed
50
- if current_completed > 5
51
- time_per_spec = seconds_elapsed / current_completed.to_f
52
- est_time_left = time_per_spec * current_size
48
+ current_completed = last_current_size - current_size
49
+ if current_completed > 0
50
+ est_time_left = (sleep_time / current_completed.to_f) * current_size
53
51
  puts "specs left #{current_size}, est time_left: #{est_time_left.to_i}"
54
52
  else
55
53
  puts "specs left #{current_size}, est time_left: N/A"
56
54
  end
57
- sleep(30)
58
55
  end
59
56
  end
60
57
 
@@ -1,4 +1,4 @@
1
1
  # version number
2
2
  module TestDiff
3
- VERSION = '0.4.1'.freeze
3
+ VERSION = '0.4.2'.freeze
4
4
  end
@@ -7,7 +7,7 @@ module TestDiff
7
7
  class Git
8
8
  include Logging
9
9
 
10
- def initialize(wd, last_tracked, current = 'HEAD', git_lib = ::GIT)
10
+ def initialize(wd, last_tracked, current = 'HEAD', git_lib = ::Git)
11
11
  @git = git_lib.open(wd)
12
12
  @last_tracked = last_tracked
13
13
  @current = current
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_diff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant Speelman