parallel_tests 0.6.17 → 0.6.18

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -5,6 +5,7 @@ gem 'parallel'
5
5
  group :dev do
6
6
  gem 'test-unit', :platform => :ruby_19
7
7
  gem 'rspec', '>=2.4'
8
+ gem 'cucumber'
8
9
  gem 'rake'
9
10
  gem 'jeweler'
10
11
  end
data/Gemfile.lock CHANGED
@@ -1,12 +1,22 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
+ builder (3.0.0)
5
+ cucumber (1.1.4)
6
+ builder (>= 2.1.2)
7
+ diff-lcs (>= 1.1.2)
8
+ gherkin (~> 2.7.1)
9
+ json (>= 1.4.6)
10
+ term-ansicolor (>= 1.0.6)
4
11
  diff-lcs (1.1.2)
12
+ gherkin (2.7.6)
13
+ json (>= 1.4.6)
5
14
  git (1.2.5)
6
15
  jeweler (1.6.3)
7
16
  bundler (~> 1.0)
8
17
  git (>= 1.2.5)
9
18
  rake
19
+ json (1.6.4)
10
20
  parallel (0.5.1)
11
21
  rake (0.8.7)
12
22
  rspec (2.6.0)
@@ -17,12 +27,14 @@ GEM
17
27
  rspec-expectations (2.6.0)
18
28
  diff-lcs (~> 1.1.2)
19
29
  rspec-mocks (2.6.0)
30
+ term-ansicolor (1.0.7)
20
31
  test-unit (2.4.4)
21
32
 
22
33
  PLATFORMS
23
34
  ruby
24
35
 
25
36
  DEPENDENCIES
37
+ cucumber
26
38
  jeweler
27
39
  parallel
28
40
  rake
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.17
1
+ 0.6.18
data/bin/parallel_test CHANGED
@@ -79,7 +79,11 @@ else
79
79
  puts "#{num_processes} processes for #{num_tests} #{name}s, ~ #{num_tests / groups.size} #{name}s per process"
80
80
 
81
81
  test_results = Parallel.map(groups, :in_processes => num_processes) do |group|
82
- klass.run_tests(group, groups.index(group), options)
82
+ if group.empty?
83
+ {:stdout => '', :exit_status => 0}
84
+ else
85
+ klass.run_tests(group, groups.index(group), options)
86
+ end
83
87
  end
84
88
 
85
89
  #parse and print results
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "parallel_tests"
8
- s.version = "0.6.17"
8
+ s.version = "0.6.18"
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 = "2012-01-28"
12
+ s.date = "2012-02-08"
13
13
  s.email = "grosser.michael@gmail.com"
14
14
  s.executables = ["parallel_cucumber", "parallel_spec", "parallel_test"]
15
15
  s.files = [
@@ -50,7 +50,7 @@ describe 'CLI' do
50
50
  end
51
51
 
52
52
  it "does not run any tests if there are none" do
53
- write 'spec/xxx.rb', 'xxx'
53
+ write 'spec/xxx_spec.rb', '1'
54
54
  result = run_tests
55
55
  result.should include('No examples found')
56
56
  result.should include('Took')
@@ -112,22 +112,50 @@ describe 'CLI' do
112
112
  end
113
113
 
114
114
  it "can run with test-options" do
115
- write "spec/x1_spec.rb", ""
116
- write "spec/x2_spec.rb", ""
115
+ write "spec/x1_spec.rb", "111"
116
+ write "spec/x2_spec.rb", "111"
117
117
  result = run_tests(:add => "--test-options ' --version'", :processes => 2)
118
118
  result.should =~ /\d+\.\d+\.\d+.*\d+\.\d+\.\d+/m # prints version twice
119
119
  end
120
120
 
121
- it "runs with test::unit" do
122
- write "test/x1_test.rb", "require 'test/unit'; class XTest < Test::Unit::TestCase; def test_xxx; end; end"
123
- result = run_tests(:type => :test)
124
- result.should include('1 test')
125
- $?.success?.should == true
126
- end
127
-
128
- it "passes test options to test::unit" do
129
- write "test/x1_test.rb", "require 'test/unit'; class XTest < Test::Unit::TestCase; def test_xxx; end; end"
130
- result = run_tests(:type => :test, :add => '--test-options "-v"')
131
- result.should include('test_xxx') # verbose output of every test
121
+ context "Test::Unit" do
122
+ it "runs" do
123
+ write "test/x1_test.rb", "require 'test/unit'; class XTest < Test::Unit::TestCase; def test_xxx; end; end"
124
+ result = run_tests(:type => :test)
125
+ result.should include('1 test')
126
+ $?.success?.should == true
127
+ end
128
+
129
+ it "passes test options" do
130
+ write "test/x1_test.rb", "require 'test/unit'; class XTest < Test::Unit::TestCase; def test_xxx; end; end"
131
+ result = run_tests(:type => :test, :add => '--test-options "-v"')
132
+ result.should include('test_xxx') # verbose output of every test
133
+ end
134
+ end
135
+
136
+ context "Cucumber" do
137
+ it "passes TEST_ENV_NUMBER when running with pattern (issue #86)" do
138
+ write "features/good1.feature", "Feature: xxx\n Scenario: xxx\n Given I print TEST_ENV_NUMBER"
139
+ write "features/good2.feature", "Feature: xxx\n Scenario: xxx\n Given I print TEST_ENV_NUMBER"
140
+ write "features/b.feature", "Feature: xxx\n Scenario: xxx\n Given I FAIL"
141
+ write "features/steps/a.rb", "Given('I print TEST_ENV_NUMBER'){ puts \"YOUR TEST ENV IS \#{ENV['TEST_ENV_NUMBER']}!\" }"
142
+
143
+ result = run_tests :type => 'features', :add => '--pattern good'
144
+ $?.success?.should == true
145
+
146
+ result.should include('YOUR TEST ENV IS 2!')
147
+ result.should include('YOUR TEST ENV IS !')
148
+ result.should_not include('I FAIL')
149
+ end
150
+
151
+ it "runs each feature once when there are more processes then features (issue #89)" do
152
+ write "features/steps/a.rb", "Given('I print TEST_ENV_NUMBER'){ puts \"YOUR TEST ENV IS \#{ENV['TEST_ENV_NUMBER']}!\" }"
153
+ 2.times{|i|
154
+ write "features/good#{i}.feature", "Feature: xxx\n Scenario: xxx\n Given I print TEST_ENV_NUMBER"
155
+ }
156
+ result = run_tests :type => 'features', :add => '-n 3'
157
+ $?.success?.should == true
158
+ result.scan(/YOUR TEST ENV IS \d?!/).sort.should == ["YOUR TEST ENV IS !", "YOUR TEST ENV IS 2!"]
159
+ end
132
160
  end
133
161
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parallel_tests
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.17
4
+ version: 0.6.18
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-28 00:00:00.000000000 Z
12
+ date: 2012-02-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: parallel
16
- requirement: &70927450 !ruby/object:Gem::Requirement
16
+ requirement: &67891880 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70927450
24
+ version_requirements: *67891880
25
25
  description:
26
26
  email: grosser.michael@gmail.com
27
27
  executables:
@@ -76,7 +76,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
76
76
  version: '0'
77
77
  segments:
78
78
  - 0
79
- hash: -681564493
79
+ hash: 85961917
80
80
  required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  none: false
82
82
  requirements: