parallel_tests 1.0.1 → 1.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2252b172b8d651430e068691a993c60b1188ef0a
4
- data.tar.gz: ff9bd5e5af97914fb962db515fd3c6642daa41f9
3
+ metadata.gz: 79b00978a9d728c8b75e47969d656cc687a85492
4
+ data.tar.gz: 8270d1a0397d555dadf9790cb87ed51e8bc3a463
5
5
  SHA512:
6
- metadata.gz: 4d075271ae5adb025703922d85991a8f197c8eab126a4836143b30752c5138d6b967841d53500258a699742aef2c7896cdf39d03c1014307c447016147afb186
7
- data.tar.gz: ce7fe0057aac13ce7a785521ac0a8f1695cb7ed5edaf11d04521a7399ff487ce90b40ddf7edf3e1bc2c8203d0b6b7aa73d17d4bd55845ce62a3566af13b09e06
6
+ metadata.gz: 03c370bd9d0531d63731ed9c0457f4c39ae29c412d2ed8c39354363302ede71b3ebda0aaf6a23e6cbaf5d52f126c0e7a04b4e404bc8b795cc60779bf0617a001
7
+ data.tar.gz: d3bdea08a73420a04e34e0842561ef5f5433cd303df50894e4fe609a17b0e210d6a1d216851ddec1568894a9d0aeadf79536dca49643af7888fa02a7316b91da
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- parallel_tests (1.0.1)
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.0.0)
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
- sanitized_test_files = test_files.map { |val| WINDOWS ? "\"#{val}\"" : Shellwords.escape(val) }
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({"AUTOTEST" => "1"}) if $stdout.tty? # display color when we are in a terminal
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 || "feature"
32
+ @test_file_name || 'feature'
26
33
  end
27
34
 
28
35
  def test_suffix
@@ -1,3 +1,3 @@
1
1
  module ParallelTests
2
- VERSION = Version = '1.0.1'
2
+ VERSION = Version = '1.0.2'
3
3
  end
@@ -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.1
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-13 00:00:00.000000000 Z
11
+ date: 2014-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel