parallel_tests 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +1 -1
- data/Readme.md +2 -2
- data/lib/parallel_tests/cucumber/runner.rb +1 -1
- data/lib/parallel_tests/version.rb +1 -1
- data/spec/integration_spec.rb +25 -1
- metadata +6 -6
data/Gemfile.lock
CHANGED
data/Readme.md
CHANGED
@@ -170,8 +170,7 @@ TIPS
|
|
170
170
|
|
171
171
|
TODO
|
172
172
|
====
|
173
|
-
-
|
174
|
-
- add tests for cucumber runtime formatter
|
173
|
+
- add unit tests for cucumber runtime formatter
|
175
174
|
- make jRuby compatible [basics](http://yehudakatz.com/2009/07/01/new-rails-isolation-testing/)
|
176
175
|
- make windows compatible
|
177
176
|
|
@@ -207,6 +206,7 @@ inspired by [pivotal labs](http://pivotallabs.com/users/miked/blog/articles/849-
|
|
207
206
|
- [Sean Walbran](https://github.com/seanwalbran)
|
208
207
|
- [Lawrence Wang](https://github.com/levity)
|
209
208
|
- [Potapov Sergey](https://github.com/greyblake)
|
209
|
+
- [Łukasz Tackowiak](https://github.com/lukasztackowiak)
|
210
210
|
|
211
211
|
[Michael Grosser](http://grosser.it)<br/>
|
212
212
|
michael@grosser.it<br/>
|
@@ -5,7 +5,7 @@ module ParallelTests
|
|
5
5
|
class Runner < ParallelTests::Test::Runner
|
6
6
|
def self.run_tests(test_files, process_number, options)
|
7
7
|
color = ($stdout.tty? ? 'AUTOTEST=1 ; export AUTOTEST ;' : '')#display color when we are in a terminal
|
8
|
-
runtime_logging = " --format
|
8
|
+
runtime_logging = " --format ParallelTests::Cucumber::RuntimeLogger --out #{runtime_log}"
|
9
9
|
cmd = "#{color} #{executable}"
|
10
10
|
cmd << runtime_logging if File.directory?(File.dirname(runtime_log))
|
11
11
|
cmd << " #{options[:test_options]} #{test_files*' '}"
|
data/spec/integration_spec.rb
CHANGED
@@ -20,6 +20,10 @@ describe 'CLI' do
|
|
20
20
|
path
|
21
21
|
end
|
22
22
|
|
23
|
+
def read(file)
|
24
|
+
File.read "#{folder}/#{file}"
|
25
|
+
end
|
26
|
+
|
23
27
|
def bin_folder
|
24
28
|
"#{File.expand_path(File.dirname(__FILE__))}/../bin"
|
25
29
|
end
|
@@ -183,6 +187,13 @@ describe 'CLI' do
|
|
183
187
|
end
|
184
188
|
|
185
189
|
context "Cucumber" do
|
190
|
+
before do
|
191
|
+
write "features/steps/a.rb", "
|
192
|
+
Given('I print TEST_ENV_NUMBER'){ puts \"YOUR TEST ENV IS \#{ENV['TEST_ENV_NUMBER']}!\" }
|
193
|
+
And('I sleep a bit'){ sleep 0.2 }
|
194
|
+
"
|
195
|
+
end
|
196
|
+
|
186
197
|
it "passes TEST_ENV_NUMBER when running with pattern (issue #86)" do
|
187
198
|
write "features/good1.feature", "Feature: xxx\n Scenario: xxx\n Given I print TEST_ENV_NUMBER"
|
188
199
|
write "features/good2.feature", "Feature: xxx\n Scenario: xxx\n Given I print TEST_ENV_NUMBER"
|
@@ -196,8 +207,21 @@ describe 'CLI' do
|
|
196
207
|
result.should_not include('I FAIL')
|
197
208
|
end
|
198
209
|
|
210
|
+
it "writes a runtime log" do
|
211
|
+
log = "tmp/parallel_runtime_cucumber.log"
|
212
|
+
write(log, "x")
|
213
|
+
2.times{|i|
|
214
|
+
# needs sleep so that runtime loggers dont overwrite each other initially
|
215
|
+
write "features/good#{i}.feature", "Feature: xxx\n Scenario: xxx\n Given I print TEST_ENV_NUMBER\n And I sleep a bit"
|
216
|
+
}
|
217
|
+
run_tests "features", :type => "cucumber"
|
218
|
+
read(log).gsub(/\.\d+/,'').split("\n").should =~ [
|
219
|
+
"features/good0.feature:0",
|
220
|
+
"features/good1.feature:0"
|
221
|
+
]
|
222
|
+
end
|
223
|
+
|
199
224
|
it "runs each feature once when there are more processes then features (issue #89)" do
|
200
|
-
write "features/steps/a.rb", "Given('I print TEST_ENV_NUMBER'){ puts \"YOUR TEST ENV IS \#{ENV['TEST_ENV_NUMBER']}!\" }"
|
201
225
|
2.times{|i|
|
202
226
|
write "features/good#{i}.feature", "Feature: xxx\n Scenario: xxx\n Given I print TEST_ENV_NUMBER"
|
203
227
|
}
|
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.7.
|
4
|
+
version: 0.7.2
|
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-03-
|
12
|
+
date: 2012-03-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: parallel
|
16
|
-
requirement: &
|
16
|
+
requirement: &20782100 !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: *
|
24
|
+
version_requirements: *20782100
|
25
25
|
description:
|
26
26
|
email: michael@grosser.it
|
27
27
|
executables:
|
@@ -81,7 +81,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
81
81
|
version: '0'
|
82
82
|
segments:
|
83
83
|
- 0
|
84
|
-
hash:
|
84
|
+
hash: -3546788160221548975
|
85
85
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
86
|
none: false
|
87
87
|
requirements:
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
version: '0'
|
91
91
|
segments:
|
92
92
|
- 0
|
93
|
-
hash:
|
93
|
+
hash: -3546788160221548975
|
94
94
|
requirements: []
|
95
95
|
rubyforge_project:
|
96
96
|
rubygems_version: 1.8.15
|