test_diff 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjM2ODkxNDEwZmVmNzYxNmE5ZTZhZTUzNzBjMjgzYWM5NTZjMjQ3Ng==
4
+ ZjZlMzhmNDgyMmI1NWYzYmQyOWE3YzRhMTJkNGZkODM0MzdmNDliMQ==
5
5
  data.tar.gz: !binary |-
6
- ZjY5Mjk3MWRkZDA5NThiNDM4OWIwMjdkODAzZmZkMDg1NTIyZTBjOQ==
6
+ NWZkODIxZjUzNTBlMDJkNmRlZDY1Y2U0MzQ2MDNlNjVhZDllNDgyMA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzI1NTBjYzc1NTI5YjNiYjZlN2VjZGZlYmQ3YzA5M2Q0ODczM2MzY2Y4Mzc5
10
- NWQzYzNlMTlmMWFkYTdiNWI3ZTMyOTFlYzRmZDY2ZDFkZThmYjFiZDJlMzA3
11
- ZTRhMDkxZGZjODg2MThmODczZjk5MTFjMmU5OWYzMTliNTIyYTM=
9
+ YmFjY2E1ZGFjNGVjYzc0YjNlMzhhMTMzODA5NDBkMDM4OWJmMDcxOGM4Y2Vj
10
+ ODk0Mzc2YTMxODMxNDBiMTE4MWQ5NTYxOTU0MTgwOTBiM2Y4YWViNzJmMmQw
11
+ NTdjMTg2MjhkNzEzNDAwZWNlZGIzNTkxZTFkNzM3ZDUxNTJjMTU=
12
12
  data.tar.gz: !binary |-
13
- ODAyOTMzMDY4ZjVlM2RkMDhlZDQyYjdkNGMwZjRiOGUzZmMwNjBiN2QxOGZh
14
- ODQ3ZTcyYzFlMDE0ZThmNTAwNWM2MzRhZTE3ZDIyMzJkNWZhNzM5MWUyNjMz
15
- ZmNiN2Q0YTExN2I2MmVkMDA3MDU2NmUzN2I1YmU1MzBkNThjZjU=
13
+ MDMyMmI3MDZiOGU2YTFjODk3NWJiZDE1YWVmNDIwY2E3MjZiM2Q0NmUzMDE4
14
+ MjlmZjBkNWNlNTVlMjE3ZTM5Y2RlZTdmMTViYTMyNTkxYTQwM2M3NTZlYjEz
15
+ OTVhYWQxNjUzMTUyZWIyZDhiZGVjYWVjZjNhYjI0NWJmOGRhZDc=
data/exe/test_diff CHANGED
@@ -16,12 +16,18 @@ class TestDiffBuilder < Thor
16
16
  TestDiff::TrackBuild.new(sha1).run
17
17
  end
18
18
 
19
- desc 'run_spec_diff spec master', 'runs the specs difference between the branches'
19
+ desc 'run_spec_diff spec', 'runs the specs difference between the branches'
20
20
  def run_spec_diff(spec_folder = 'spec', groups_of = nil, group = '0')
21
+ TestDiff::Config.test_runner = TestDiff::TestRunner::Spec.new
21
22
  TestDiff::RunDiff.new(spec_folder, groups_of, group).run
22
23
  end
23
24
 
24
- desc 'build_coverage_diff spec master', 'runs the specs difference between the branches'
25
+ desc 'run_rspec_diff spec', 'runs the specs difference between the branches'
26
+ def run_rspec_diff(spec_folder = 'spec', groups_of = nil, group = '0')
27
+ TestDiff::RunDiff.new(spec_folder, groups_of, group).run
28
+ end
29
+
30
+ desc 'build_coverage_diff spec', 'runs the specs difference between the branches'
25
31
  def build_coverage_diff(spec_folder = 'spec', pre_load = nil, continue = nil)
26
32
  TestDiff::BuildCoverageDiff.new(spec_folder, pre_load, continue).run
27
33
  end
@@ -10,7 +10,7 @@ module TestDiff
10
10
  @batch_queue = Queue.new
11
11
  @storage = Storage.new
12
12
  @continue = continue
13
- RunableTests.add_all(@batch_queue, continue)
13
+ RunableTests.add_all(spec_folder, @batch_queue, continue)
14
14
  end
15
15
 
16
16
  def run
@@ -33,28 +33,11 @@ module TestDiff
33
33
 
34
34
  def run_batch
35
35
  puts "Running #{@tests_to_run.size} tests"
36
- timing_thread = start_timing_thread(Time.now, @tests_to_run.size)
37
36
  start
38
- timing_thread.join
39
37
  puts 'Test done, compacting db'
40
38
  @storage.compact if @storage.respond_to?(:compact)
41
39
  end
42
40
 
43
- def start_timing_thread(start_time, original_size)
44
- Thread.new do
45
- until @tests_to_run.empty?
46
- last_size = @tests_to_run.size
47
- completed = original_size - last_size
48
- if completed > 0
49
- time_per_spec = (Time.now - start_time).to_f / completed.to_f
50
- est_time_left = time_per_spec * last_size
51
- puts "specs left #{last_size}, est time_left: #{est_time_left.to_i}"
52
- end
53
- sleep(60)
54
- end
55
- end
56
- end
57
-
58
41
  def start
59
42
  until @tests_to_run.empty?
60
43
  pid = start_process_fork(@tests_to_run.pop.filename)
@@ -2,7 +2,7 @@
2
2
  module TestDiff
3
3
  # class used to find tests that are runable
4
4
  class RunableTests
5
- def self.add_all(list, continue = false)
5
+ def self.add_all(spec_folder, list, continue = false)
6
6
  if File.file?(spec_folder)
7
7
  list << spec_folder
8
8
  else
@@ -1,4 +1,3 @@
1
- require 'git'
2
1
  # TestDiff module
3
2
  module TestDiff
4
3
  # module for test runners
@@ -1,4 +1,3 @@
1
- require 'git'
2
1
  # TestDiff module
3
2
  module TestDiff
4
3
  # module for test runners
@@ -1,4 +1,4 @@
1
1
  # version number
2
2
  module TestDiff
3
- VERSION = '0.3.2'
3
+ VERSION = '0.3.3'
4
4
  end
data/lib/test_diff.rb CHANGED
@@ -3,6 +3,7 @@ require 'test_diff/storage'
3
3
  require 'test_diff/test_info'
4
4
  require 'test_diff/version_control/git'
5
5
  require 'test_diff/test_runner/rspec'
6
+ require 'test_diff/test_runner/spec'
6
7
  require 'test_diff/config'
7
8
  require 'test_diff/runable_tests'
8
9
  require 'test_diff/build_coverage'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_diff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant Speelman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-04-01 00:00:00.000000000 Z
11
+ date: 2015-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor