parallel_tests 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/Readme.md +1 -0
- data/lib/parallel_tests/gherkin/runner.rb +11 -4
- data/lib/parallel_tests/version.rb +1 -1
- data/spec/parallel_tests/gherkin/runner_behaviour.rb +17 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79b00978a9d728c8b75e47969d656cc687a85492
|
4
|
+
data.tar.gz: 8270d1a0397d555dadf9790cb87ed51e8bc3a463
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03c370bd9d0531d63731ed9c0457f4c39ae29c412d2ed8c39354363302ede71b3ebda0aaf6a23e6cbaf5d52f126c0e7a04b4e404bc8b795cc60779bf0617a001
|
7
|
+
data.tar.gz: d3bdea08a73420a04e34e0842561ef5f5433cd303df50894e4fe609a17b0e210d6a1d216851ddec1568894a9d0aeadf79536dca49643af7888fa02a7316b91da
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
parallel_tests (1.0.
|
4
|
+
parallel_tests (1.0.2)
|
5
5
|
parallel
|
6
6
|
|
7
7
|
GEM
|
@@ -24,7 +24,7 @@ GEM
|
|
24
24
|
gherkin-ruby (0.3.0)
|
25
25
|
multi_json (1.8.2)
|
26
26
|
multi_test (0.0.2)
|
27
|
-
parallel (1.
|
27
|
+
parallel (1.1.1)
|
28
28
|
rake (10.0.3)
|
29
29
|
rspec (2.13.0)
|
30
30
|
rspec-core (~> 2.13.0)
|
data/Readme.md
CHANGED
@@ -296,6 +296,7 @@ inspired by [pivotal labs](http://pivotallabs.com/users/miked/blog/articles/849-
|
|
296
296
|
- [bicarbon8](https://github.com/bicarbon8)
|
297
297
|
- [seichner](https://github.com/seichner)
|
298
298
|
- [Matt Southerden](https://github.com/mattsoutherden)
|
299
|
+
- [Stanislaw Wozniak](https://github.com/sponte)
|
299
300
|
|
300
301
|
[Michael Grosser](http://grosser.it)<br/>
|
301
302
|
michael@grosser.it<br/>
|
@@ -7,22 +7,29 @@ module ParallelTests
|
|
7
7
|
|
8
8
|
class << self
|
9
9
|
def run_tests(test_files, process_number, num_processes, options)
|
10
|
-
|
10
|
+
combined_scenarios = test_files
|
11
|
+
|
12
|
+
if options[:group_by] == :scenarios
|
13
|
+
grouped = test_files.map { |t| t.split(':') }.group_by(&:first)
|
14
|
+
combined_scenarios = grouped.map {|file,files_and_lines| "#{file}:#{files_and_lines.map(&:last).join(':')}" }
|
15
|
+
end
|
16
|
+
|
17
|
+
sanitized_test_files = combined_scenarios.map { |val| WINDOWS ? "\"#{val}\"" : Shellwords.escape(val) }
|
11
18
|
|
12
19
|
options[:env] ||= {}
|
13
|
-
options[:env] = options[:env].merge({
|
20
|
+
options[:env] = options[:env].merge({'AUTOTEST' => '1'}) if $stdout.tty? # display color when we are in a terminal
|
14
21
|
|
15
22
|
cmd = [
|
16
23
|
executable,
|
17
24
|
(runtime_logging if File.directory?(File.dirname(runtime_log))),
|
18
25
|
cucumber_opts(options[:test_options]),
|
19
26
|
*sanitized_test_files
|
20
|
-
].compact.join(
|
27
|
+
].compact.join(' ')
|
21
28
|
execute_command(cmd, process_number, num_processes, options)
|
22
29
|
end
|
23
30
|
|
24
31
|
def test_file_name
|
25
|
-
@test_file_name ||
|
32
|
+
@test_file_name || 'feature'
|
26
33
|
end
|
27
34
|
|
28
35
|
def test_suffix
|
@@ -182,6 +182,23 @@ EOF
|
|
182
182
|
end
|
183
183
|
end
|
184
184
|
|
185
|
+
describe 'grouping by scenarios for cucumber' do
|
186
|
+
def call(*args)
|
187
|
+
ParallelTests::Gherkin::Runner.send(:run_tests, *args)
|
188
|
+
end
|
189
|
+
|
190
|
+
it 'groups cucumber invocation by feature files to achieve correct cucumber hook behaviour' do
|
191
|
+
|
192
|
+
test_files = %w(features/a.rb:23 features/a.rb:44 features/b.rb:12)
|
193
|
+
|
194
|
+
ParallelTests::Test::Runner.should_receive(:execute_command).with do |a,b,c,d|
|
195
|
+
a =~ Regexp.new('features/a.rb:23:44 features/b.rb:12')
|
196
|
+
end
|
197
|
+
|
198
|
+
call(test_files, 1, 2, { :group_by => :scenarios })
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
185
202
|
describe ".find_tests" do
|
186
203
|
def call(*args)
|
187
204
|
ParallelTests::Gherkin::Runner.send(:find_tests, *args)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parallel_tests
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|