parallel_tests 0.6.6 → 0.6.7

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.6
1
+ 0.6.7
@@ -8,7 +8,7 @@ class ParallelTests
8
8
  groups[group_number] << items.shift
9
9
  end
10
10
  end
11
- end
11
+ end.map(&:sort)
12
12
  end
13
13
 
14
14
  def self.in_even_groups_by_size(items_with_sizes, num_groups)
@@ -21,11 +21,11 @@ class ParallelTests
21
21
  smallest[:size] += size
22
22
  end
23
23
 
24
- groups.map{|g| g[:items] }
24
+ groups.map{|g| g[:items].sort }
25
25
  end
26
26
 
27
27
  def self.smallest_first(files)
28
28
  files.sort_by{|item, size| size }.reverse
29
29
  end
30
30
  end
31
- end
31
+ end
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = "parallel_tests"
8
- s.version = "0.6.6"
7
+ s.name = %q{parallel_tests}
8
+ s.version = "0.6.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Michael Grosser"]
12
- s.date = "2011-09-30"
13
- s.email = "grosser.michael@gmail.com"
14
- s.executables = ["parallel_cucumber", "parallel_spec", "parallel_test"]
12
+ s.date = %q{2011-10-05}
13
+ s.email = %q{grosser.michael@gmail.com}
14
+ s.executables = ["parallel_cucumber", "parallel_test", "parallel_spec"]
15
15
  s.files = [
16
16
  "Gemfile",
17
17
  "Gemfile.lock",
@@ -40,10 +40,10 @@ Gem::Specification.new do |s|
40
40
  "spec/parallel_tests_spec.rb",
41
41
  "spec/spec_helper.rb"
42
42
  ]
43
- s.homepage = "http://github.com/grosser/parallel_tests"
43
+ s.homepage = %q{http://github.com/grosser/parallel_tests}
44
44
  s.require_paths = ["lib"]
45
- s.rubygems_version = "1.8.10"
46
- s.summary = "Run tests / specs / features in parallel"
45
+ s.rubygems_version = %q{1.6.2}
46
+ s.summary = %q{Run tests / specs / features in parallel}
47
47
 
48
48
  if s.respond_to? :specification_version then
49
49
  s.specification_version = 3
data/spec/spec_helper.rb CHANGED
@@ -25,7 +25,7 @@ def use_temporary_directory_for
25
25
 
26
26
  begin
27
27
  # just in case the temporary dir already exists
28
- FileUtils.rm_rf(dir) if File.exists?(dir)
28
+ FileUtils.rm_rf(dir) if File.exists?(dir)
29
29
 
30
30
  # create the temporary directory
31
31
  FileUtils.mkdir_p(new_dir)
@@ -89,19 +89,34 @@ def test_tests_in_groups(klass, folder, suffix)
89
89
  groups.map{|g| size_of(g)}.should =~ [300, 300, 200]
90
90
  end
91
91
 
92
- it "partitions by runtime when runtime-data is available" do
93
- klass.stub!(:puts)
92
+ def setup_runtime_log
94
93
  File.open(@log,'w') do |f|
95
94
  @files[1..-1].each{|file| f.puts "#{file}:#{@files.index(file)}"}
96
95
  f.puts "#{@files[0]}:10"
97
96
  end
97
+ end
98
+
99
+ it "partitions by runtime when runtime-data is available" do
100
+ klass.stub!(:puts)
101
+ setup_runtime_log
102
+
103
+ groups = klass.tests_in_groups(test_root, 2)
104
+ groups.size.should == 2
105
+ # 10 + 1 + 3 + 5 = 19
106
+ groups[0].should == [@files[0],@files[1],@files[3],@files[5]]
107
+ # 2 + 4 + 6 + 7 = 19
108
+ groups[1].should == [@files[2],@files[4],@files[6],@files[7]]
109
+ end
110
+
111
+ it "alpha-sorts partitions when runtime-data is available" do
112
+ klass.stub!(:puts)
113
+ setup_runtime_log
98
114
 
99
115
  groups = klass.tests_in_groups(test_root, 2)
100
116
  groups.size.should == 2
101
- # 10 + 5 + 3 + 1 = 19
102
- groups[0].should == [@files[0],@files[5],@files[3],@files[1]]
103
- # 7 + 6 + 4 + 2 = 19
104
- groups[1].should == [@files[7],@files[6],@files[4],@files[2]]
117
+
118
+ groups[0].should == groups[0].sort
119
+ groups[1].should == groups[1].sort
105
120
  end
106
121
 
107
122
  it "partitions by round-robin when not sorting" do
@@ -111,5 +126,13 @@ def test_tests_in_groups(klass, folder, suffix)
111
126
  groups[0].should == ["file1.rb", "file3.rb"]
112
127
  groups[1].should == ["file2.rb", "file4.rb"]
113
128
  end
129
+
130
+ it "alpha-sorts partitions when not sorting by runtime" do
131
+ files = %w[q w e r t y u i o p a s d f g h j k l z x c v b n m]
132
+ klass.should_receive(:find_tests).and_return(files)
133
+ groups = klass.tests_in_groups(files, 2, :no_sort => true)
134
+ groups[0].should == groups[0].sort
135
+ groups[1].should == groups[1].sort
136
+ end
114
137
  end
115
138
  end
metadata CHANGED
@@ -1,36 +1,48 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: parallel_tests
3
- version: !ruby/object:Gem::Version
4
- version: 0.6.6
3
+ version: !ruby/object:Gem::Version
4
+ hash: 9
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 6
9
+ - 7
10
+ version: 0.6.7
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Michael Grosser
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2011-09-30 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: parallel
16
- requirement: &69112950 !ruby/object:Gem::Requirement
17
+
18
+ date: 2011-10-05 00:00:00 +02:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ requirement: &id001 !ruby/object:Gem::Requirement
17
23
  none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ hash: 3
28
+ segments:
29
+ - 0
30
+ version: "0"
22
31
  type: :runtime
32
+ name: parallel
33
+ version_requirements: *id001
23
34
  prerelease: false
24
- version_requirements: *69112950
25
35
  description:
26
36
  email: grosser.michael@gmail.com
27
- executables:
37
+ executables:
28
38
  - parallel_cucumber
29
- - parallel_spec
30
39
  - parallel_test
40
+ - parallel_spec
31
41
  extensions: []
42
+
32
43
  extra_rdoc_files: []
33
- files:
44
+
45
+ files:
34
46
  - Gemfile
35
47
  - Gemfile.lock
36
48
  - Rakefile
@@ -57,31 +69,39 @@ files:
57
69
  - spec/parallel_specs_spec.rb
58
70
  - spec/parallel_tests_spec.rb
59
71
  - spec/spec_helper.rb
72
+ has_rdoc: true
60
73
  homepage: http://github.com/grosser/parallel_tests
61
74
  licenses: []
75
+
62
76
  post_install_message:
63
77
  rdoc_options: []
64
- require_paths:
78
+
79
+ require_paths:
65
80
  - lib
66
- required_ruby_version: !ruby/object:Gem::Requirement
81
+ required_ruby_version: !ruby/object:Gem::Requirement
67
82
  none: false
68
- requirements:
69
- - - ! '>='
70
- - !ruby/object:Gem::Version
71
- version: '0'
72
- segments:
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ hash: 3
87
+ segments:
73
88
  - 0
74
- hash: -187444499
75
- required_rubygems_version: !ruby/object:Gem::Requirement
89
+ version: "0"
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
91
  none: false
77
- requirements:
78
- - - ! '>='
79
- - !ruby/object:Gem::Version
80
- version: '0'
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ hash: 3
96
+ segments:
97
+ - 0
98
+ version: "0"
81
99
  requirements: []
100
+
82
101
  rubyforge_project:
83
- rubygems_version: 1.8.10
102
+ rubygems_version: 1.6.2
84
103
  signing_key:
85
104
  specification_version: 3
86
105
  summary: Run tests / specs / features in parallel
87
106
  test_files: []
107
+