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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7be473c3e92a840440cda6b28dc949df0537fa0609ceac286ede4ea8ed6e0b1a
|
4
|
+
data.tar.gz: 7dcb1ddb32ecdd1ce6be3290c7cb69c18b700efc2ace0eb521a6f70beac916e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 =
|
50
|
-
if current_completed >
|
51
|
-
|
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
|
|
data/lib/test_diff/version.rb
CHANGED
@@ -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 = ::
|
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
|