parallel_tests 0.7.0.rc1 → 0.7.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +2 -2
- data/Readme.md +3 -3
- data/ReadmeRails2.md +6 -6
- data/lib/parallel_tests/cli.rb +2 -2
- data/lib/parallel_tests/{spec → rspec}/failures_logger.rb +4 -4
- data/lib/parallel_tests/{spec → rspec}/logger_base.rb +3 -3
- data/lib/parallel_tests/{spec → rspec}/runner.rb +2 -2
- data/lib/parallel_tests/{spec → rspec}/runtime_logger.rb +2 -2
- data/lib/parallel_tests/{spec → rspec}/summary_logger.rb +2 -2
- data/lib/parallel_tests/tasks.rb +6 -2
- data/lib/parallel_tests/version.rb +1 -1
- data/spec/integration_spec.rb +1 -1
- data/spec/parallel_tests/{spec → rspec}/failure_logger_spec.rb +6 -6
- data/spec/parallel_tests/{spec → rspec}/runner_spec.rb +26 -26
- data/spec/parallel_tests/{spec → rspec}/runtime_logger_spec.rb +4 -4
- data/spec/parallel_tests/{spec → rspec}/summary_logger_spec.rb +2 -2
- data/spec/spec_helper.rb +3 -3
- metadata +39 -60
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
parallel_tests (0.7.0.
|
4
|
+
parallel_tests (0.7.0.rc2)
|
5
5
|
parallel
|
6
6
|
|
7
7
|
GEM
|
@@ -18,7 +18,7 @@ GEM
|
|
18
18
|
gherkin (2.7.6)
|
19
19
|
json (>= 1.4.6)
|
20
20
|
json (1.6.4)
|
21
|
-
parallel (0.5.
|
21
|
+
parallel (0.5.15)
|
22
22
|
rake (0.8.7)
|
23
23
|
rspec (2.6.0)
|
24
24
|
rspec-core (~> 2.6.0)
|
data/Readme.md
CHANGED
@@ -75,7 +75,7 @@ Rspec: Add to your `.rspec_parallel` (or `.rspec`) :
|
|
75
75
|
RSpec
|
76
76
|
If installed as plugin: -I vendor/plugins/parallel_tests/lib
|
77
77
|
--format progress
|
78
|
-
--format ParallelTests::
|
78
|
+
--format ParallelTests::RSpec::RuntimeLogger --out tmp/parallel_runtime_rspec.log
|
79
79
|
|
80
80
|
Test::Unit: Add to your `test_helper.rb`:
|
81
81
|
|
@@ -92,7 +92,7 @@ Add the following to your `.rspec_parallel` (or `.rspec`) :
|
|
92
92
|
RSpec:
|
93
93
|
If installed as plugin: -I vendor/plugins/parallel_tests/lib
|
94
94
|
--format progress
|
95
|
-
--format ParallelTests::
|
95
|
+
--format ParallelTests::RSpec::SummaryLogger --out tmp/spec_summary.log
|
96
96
|
|
97
97
|
SpecFailuresLogger
|
98
98
|
-----------------------
|
@@ -108,7 +108,7 @@ Add the following to your `.rspec_parallel` (or `.rspec`) :
|
|
108
108
|
RSpec:
|
109
109
|
If installed as plugin: -I vendor/plugins/parallel_tests/lib
|
110
110
|
--format progress
|
111
|
-
--format ParallelTests::
|
111
|
+
--format ParallelTests::RSpec::FailuresLogger --out tmp/failing_specs.log
|
112
112
|
|
113
113
|
Setup for non-rails
|
114
114
|
===================
|
data/ReadmeRails2.md
CHANGED
@@ -28,21 +28,21 @@ Even process runtimes
|
|
28
28
|
|
29
29
|
RSpec 1.x:
|
30
30
|
--format progress
|
31
|
-
--require parallel_tests/
|
32
|
-
--format ParallelTests::
|
31
|
+
--require parallel_tests/rspec/runtime_logger
|
32
|
+
--format ParallelTests::RSpec::RuntimeLogger:tmp/parallel_runtime_rspec.log
|
33
33
|
|
34
34
|
SpecSummaryLogger
|
35
35
|
--------------------
|
36
36
|
|
37
37
|
RSpec 1.x:
|
38
38
|
--format progress
|
39
|
-
--require parallel_tests/
|
40
|
-
--format ParallelTests::
|
39
|
+
--require parallel_tests/rspec/summary_logger
|
40
|
+
--format ParallelTests::RSpec::SummaryLogger:tmp/spec_summary.log
|
41
41
|
|
42
42
|
SpecFailuresLogger
|
43
43
|
-----------------------
|
44
44
|
|
45
45
|
RSpec 1.x:
|
46
46
|
--format progress
|
47
|
-
--require parallel_tests/
|
48
|
-
--format ParallelTests::
|
47
|
+
--require parallel_tests/rspec/failures_logger
|
48
|
+
--format ParallelTests::RSpec::FailuresLogger:tmp/failing_specs.log
|
data/lib/parallel_tests/cli.rb
CHANGED
@@ -65,7 +65,7 @@ module ParallelTest
|
|
65
65
|
|
66
66
|
def self.load_runner_for(lib)
|
67
67
|
require "parallel_tests/#{lib}/runner"
|
68
|
-
eval("ParallelTests::#{lib.capitalize}::Runner")
|
68
|
+
eval("ParallelTests::#{lib.capitalize.sub('Rspec','RSpec')}::Runner")
|
69
69
|
end
|
70
70
|
|
71
71
|
def self.parse_options!(argv)
|
@@ -89,7 +89,7 @@ BANNER
|
|
89
89
|
end
|
90
90
|
opts.on("-e", '--exec [COMMAND]', "execute this code parallel and with ENV['TEST_ENV_NUM']") { |path| options[:execute] = path }
|
91
91
|
opts.on("-o", "--test-options '[OPTIONS]'", "execute test commands with those options") { |arg| options[:test_options] = arg }
|
92
|
-
opts.on("-t", "--type [TYPE]", "test(default) /
|
92
|
+
opts.on("-t", "--type [TYPE]", "test(default) / rspec / cucumber") { |type| options[:type] = type }
|
93
93
|
opts.on("--non-parallel", "execute same commands but do not in parallel, needs --exec") { options[:non_parallel] = true }
|
94
94
|
opts.on("--chunk-timeout [TIMEOUT]", "timeout before re-printing the output of a child-process") { |timeout| options[:chunk_timeout] = timeout.to_f }
|
95
95
|
opts.on('-v', '--version', 'Show Version') { puts ParallelTests::VERSION; exit }
|
@@ -1,7 +1,7 @@
|
|
1
|
-
require 'parallel_tests/
|
2
|
-
require 'parallel_tests/
|
1
|
+
require 'parallel_tests/rspec/logger_base'
|
2
|
+
require 'parallel_tests/rspec/runner'
|
3
3
|
|
4
|
-
class ParallelTests::
|
4
|
+
class ParallelTests::RSpec::FailuresLogger < ParallelTests::RSpec::LoggerBase
|
5
5
|
# RSpec 1: does not keep track of failures, so we do
|
6
6
|
def example_failed(example, *args)
|
7
7
|
if RSPEC_1
|
@@ -38,7 +38,7 @@ class ParallelTests::Spec::FailuresLogger < ParallelTests::Spec::LoggerBase
|
|
38
38
|
file, line = example.location.to_s.split(':')
|
39
39
|
next unless file and line
|
40
40
|
file.gsub!(%r(^.*?/spec/), './spec/')
|
41
|
-
@output.puts "#{ParallelTests::
|
41
|
+
@output.puts "#{ParallelTests::RSpec::Runner.executable} #{file}:#{line} # #{example.description}"
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module ParallelTests
|
2
|
-
module
|
2
|
+
module RSpec
|
3
3
|
end
|
4
4
|
end
|
5
5
|
|
@@ -11,9 +11,9 @@ rescue LoadError
|
|
11
11
|
base = Spec::Runner::Formatter::BaseTextFormatter
|
12
12
|
end
|
13
13
|
|
14
|
-
ParallelTests::
|
14
|
+
ParallelTests::RSpec::LoggerBaseBase = base
|
15
15
|
|
16
|
-
class ParallelTests::
|
16
|
+
class ParallelTests::RSpec::LoggerBase < ParallelTests::RSpec::LoggerBaseBase
|
17
17
|
RSPEC_1 = !defined?(RSpec::Core::Formatters::BaseTextFormatter) # do not test for Spec, this will trigger deprecation warning in rspec 2
|
18
18
|
|
19
19
|
def initialize(*args)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'parallel_tests/test/runner'
|
2
2
|
|
3
3
|
module ParallelTests
|
4
|
-
module
|
4
|
+
module RSpec
|
5
5
|
class Runner < ParallelTests::Test::Runner
|
6
6
|
def self.run_tests(test_files, process_number, options)
|
7
7
|
exe = executable # expensive, so we cache
|
@@ -23,7 +23,7 @@ module ParallelTests
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def self.runtime_log
|
26
|
-
'tmp/
|
26
|
+
'tmp/parallel_runtime_rspec.log'
|
27
27
|
end
|
28
28
|
|
29
29
|
def self.test_file_name
|
@@ -1,6 +1,6 @@
|
|
1
|
-
require 'parallel_tests/
|
1
|
+
require 'parallel_tests/rspec/logger_base'
|
2
2
|
|
3
|
-
class ParallelTests::
|
3
|
+
class ParallelTests::RSpec::RuntimeLogger < ParallelTests::RSpec::LoggerBase
|
4
4
|
def initialize(*args)
|
5
5
|
super
|
6
6
|
@example_times = Hash.new(0)
|
@@ -1,6 +1,6 @@
|
|
1
|
-
require 'parallel_tests/
|
1
|
+
require 'parallel_tests/rspec/failures_logger'
|
2
2
|
|
3
|
-
class ParallelTests::
|
3
|
+
class ParallelTests::RSpec::SummaryLogger < ParallelTests::RSpec::LoggerBase
|
4
4
|
# RSpec 1: dumps 1 failed spec
|
5
5
|
def dump_failure(*args)
|
6
6
|
lock_output do
|
data/lib/parallel_tests/tasks.rb
CHANGED
@@ -47,9 +47,13 @@ namespace :parallel do
|
|
47
47
|
$LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
48
48
|
require "parallel_tests"
|
49
49
|
count, pattern, options = ParallelTests.parse_rake_args(args)
|
50
|
-
|
50
|
+
test_framework = {
|
51
|
+
'spec' => 'rspec',
|
52
|
+
'test' => 'test',
|
53
|
+
'features' => 'cucumber'
|
54
|
+
}[type]
|
51
55
|
executable = File.join(File.dirname(__FILE__), '..', '..', 'bin', 'parallel_test')
|
52
|
-
command = "#{executable} #{type} --type #{
|
56
|
+
command = "#{executable} #{type} --type #{test_framework} -n #{count} -p '#{pattern}' -o '#{options}'"
|
53
57
|
abort unless system(command) # allow to chain tasks e.g. rake parallel:spec parallel:features
|
54
58
|
end
|
55
59
|
end
|
data/spec/integration_spec.rb
CHANGED
@@ -35,7 +35,7 @@ describe 'CLI' do
|
|
35
35
|
def run_tests(test_folder, options={})
|
36
36
|
ensure_folder folder
|
37
37
|
processes = "-n #{options[:processes]||2}" unless options[:processes] == false
|
38
|
-
result = `cd #{folder} && #{options[:export]} #{executable} #{test_folder} --chunk-timeout 999 -t #{options[:type] || '
|
38
|
+
result = `cd #{folder} && #{options[:export]} #{executable} #{test_folder} --chunk-timeout 999 -t #{options[:type] || 'rspec'} #{processes} #{options[:add]} 2>&1`
|
39
39
|
raise "FAILED #{result}" if $?.success? == !!options[:fail]
|
40
40
|
result
|
41
41
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe ParallelTests::
|
3
|
+
describe ParallelTests::RSpec::FailuresLogger do
|
4
4
|
def silence_warnings
|
5
5
|
old_verbose, $VERBOSE = $VERBOSE, nil
|
6
6
|
yield
|
@@ -14,11 +14,11 @@ describe ParallelTests::Spec::FailuresLogger do
|
|
14
14
|
@example2 = mock( 'example', :location => "#{Dir.pwd}/spec/path/to/example2:456", :full_description => 'should do other stuff', :description => 'd')
|
15
15
|
@exception1 = mock( :to_s => 'exception', :backtrace => [ '/path/to/error/line:33' ] )
|
16
16
|
@failure1 = mock( 'example', :location => "#{Dir.pwd}/example:123", :header => 'header', :exception => @exception1 )
|
17
|
-
@logger = ParallelTests::
|
17
|
+
@logger = ParallelTests::RSpec::FailuresLogger.new(@output)
|
18
18
|
end
|
19
19
|
|
20
20
|
after do
|
21
|
-
silence_warnings{ ParallelTests::
|
21
|
+
silence_warnings{ ParallelTests::RSpec::LoggerBase::RSPEC_1 = false }
|
22
22
|
end
|
23
23
|
|
24
24
|
def clean_output
|
@@ -37,9 +37,9 @@ describe ParallelTests::Spec::FailuresLogger do
|
|
37
37
|
end
|
38
38
|
|
39
39
|
it "should invoke spec for rspec 1" do
|
40
|
-
silence_warnings{ ParallelTests::
|
40
|
+
silence_warnings{ ParallelTests::RSpec::LoggerBase::RSPEC_1 = true }
|
41
41
|
ParallelTests.stub!(:bundler_enabled?).and_return true
|
42
|
-
ParallelTests::
|
42
|
+
ParallelTests::RSpec::Runner.stub!(:run).with("bundle show rspec").and_return "/foo/bar/rspec-1.0.2"
|
43
43
|
@logger.example_failed @example1
|
44
44
|
|
45
45
|
@logger.dump_failures
|
@@ -50,7 +50,7 @@ describe ParallelTests::Spec::FailuresLogger do
|
|
50
50
|
|
51
51
|
it "should invoke rspec for rspec 2" do
|
52
52
|
ParallelTests.stub!(:bundler_enabled?).and_return true
|
53
|
-
ParallelTests::
|
53
|
+
ParallelTests::RSpec::Runner.stub!(:run).with("bundle show rspec").and_return "/foo/bar/rspec-2.0.2"
|
54
54
|
@logger.example_failed @example1
|
55
55
|
|
56
56
|
@logger.dump_failures
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe ParallelTests::
|
4
|
-
test_tests_in_groups(ParallelTests::
|
3
|
+
describe ParallelTests::RSpec::Runner do
|
4
|
+
test_tests_in_groups(ParallelTests::RSpec::Runner, 'spec', '_spec.rb')
|
5
5
|
|
6
6
|
describe :run_tests do
|
7
7
|
before do
|
@@ -13,41 +13,41 @@ describe ParallelTests::Spec::Runner do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def call(*args)
|
16
|
-
ParallelTests::
|
16
|
+
ParallelTests::RSpec::Runner.run_tests(*args)
|
17
17
|
end
|
18
18
|
|
19
19
|
it "uses TEST_ENV_NUMBER=blank when called for process 0" do
|
20
|
-
ParallelTests::
|
20
|
+
ParallelTests::RSpec::Runner.should_receive(:open).with{|x,y|x=~/TEST_ENV_NUMBER= /}.and_return mocked_process
|
21
21
|
call(['xxx'], 0, {})
|
22
22
|
end
|
23
23
|
|
24
24
|
it "uses TEST_ENV_NUMBER=2 when called for process 1" do
|
25
|
-
ParallelTests::
|
25
|
+
ParallelTests::RSpec::Runner.should_receive(:open).with{|x,y| x=~/TEST_ENV_NUMBER=2/}.and_return mocked_process
|
26
26
|
call(['xxx'],1,{})
|
27
27
|
end
|
28
28
|
|
29
29
|
it "runs with color when called from cmdline" do
|
30
|
-
ParallelTests::
|
30
|
+
ParallelTests::RSpec::Runner.should_receive(:open).with{|x,y| x=~/ --tty /}.and_return mocked_process
|
31
31
|
$stdout.should_receive(:tty?).and_return true
|
32
32
|
call(['xxx'],1,{})
|
33
33
|
end
|
34
34
|
|
35
35
|
it "runs without color when not called from cmdline" do
|
36
|
-
ParallelTests::
|
36
|
+
ParallelTests::RSpec::Runner.should_receive(:open).with{|x,y| x !~ / --tty /}.and_return mocked_process
|
37
37
|
$stdout.should_receive(:tty?).and_return false
|
38
38
|
call(['xxx'],1,{})
|
39
39
|
end
|
40
40
|
|
41
41
|
it "runs with color for rspec 1 when called for the cmdline" do
|
42
42
|
File.should_receive(:file?).with('script/spec').and_return true
|
43
|
-
ParallelTests::
|
43
|
+
ParallelTests::RSpec::Runner.should_receive(:open).with{|x,y| x=~/ RSPEC_COLOR=1 /}.and_return mocked_process
|
44
44
|
$stdout.should_receive(:tty?).and_return true
|
45
45
|
call(['xxx'],1,{})
|
46
46
|
end
|
47
47
|
|
48
48
|
it "runs without color for rspec 1 when not called for the cmdline" do
|
49
49
|
File.should_receive(:file?).with('script/spec').and_return true
|
50
|
-
ParallelTests::
|
50
|
+
ParallelTests::RSpec::Runner.should_receive(:open).with{|x,y| x !~ / RSPEC_COLOR=1 /}.and_return mocked_process
|
51
51
|
$stdout.should_receive(:tty?).and_return false
|
52
52
|
call(['xxx'],1,{})
|
53
53
|
end
|
@@ -55,55 +55,55 @@ describe ParallelTests::Spec::Runner do
|
|
55
55
|
it "run bundle exec spec when on bundler rspec 1" do
|
56
56
|
File.stub!(:file?).with('script/spec').and_return false
|
57
57
|
ParallelTests.stub!(:bundler_enabled?).and_return true
|
58
|
-
ParallelTests::
|
59
|
-
ParallelTests::
|
58
|
+
ParallelTests::RSpec::Runner.stub!(:run).with("bundle show rspec").and_return "/foo/bar/rspec-1.0.2"
|
59
|
+
ParallelTests::RSpec::Runner.should_receive(:open).with{|x,y| x =~ %r{bundle exec spec}}.and_return mocked_process
|
60
60
|
call(['xxx'],1,{})
|
61
61
|
end
|
62
62
|
|
63
63
|
it "run bundle exec rspec when on bundler rspec 2" do
|
64
64
|
File.stub!(:file?).with('script/spec').and_return false
|
65
65
|
ParallelTests.stub!(:bundler_enabled?).and_return true
|
66
|
-
ParallelTests::
|
67
|
-
ParallelTests::
|
66
|
+
ParallelTests::RSpec::Runner.stub!(:run).with("bundle show rspec").and_return "/foo/bar/rspec-2.0.2"
|
67
|
+
ParallelTests::RSpec::Runner.should_receive(:open).with{|x,y| x =~ %r{bundle exec rspec}}.and_return mocked_process
|
68
68
|
call(['xxx'],1,{})
|
69
69
|
end
|
70
70
|
|
71
71
|
it "runs script/spec when script/spec can be found" do
|
72
72
|
File.should_receive(:file?).with('script/spec').and_return true
|
73
|
-
ParallelTests::
|
73
|
+
ParallelTests::RSpec::Runner.should_receive(:open).with{|x,y| x =~ %r{script/spec}}.and_return mocked_process
|
74
74
|
call(['xxx'],1,{})
|
75
75
|
end
|
76
76
|
|
77
77
|
it "runs spec when script/spec cannot be found" do
|
78
78
|
File.stub!(:file?).with('script/spec').and_return false
|
79
|
-
ParallelTests::
|
79
|
+
ParallelTests::RSpec::Runner.should_receive(:open).with{|x,y| x !~ %r{script/spec}}.and_return mocked_process
|
80
80
|
call(['xxx'],1,{})
|
81
81
|
end
|
82
82
|
|
83
83
|
it "uses no -O when no opts where found" do
|
84
84
|
File.stub!(:file?).with('spec/spec.opts').and_return false
|
85
|
-
ParallelTests::
|
85
|
+
ParallelTests::RSpec::Runner.should_receive(:open).with{|x,y| x !~ %r{spec/spec.opts}}.and_return mocked_process
|
86
86
|
call(['xxx'],1,{})
|
87
87
|
end
|
88
88
|
|
89
89
|
it "uses -O spec/spec.opts when found (with script/spec)" do
|
90
90
|
File.stub!(:file?).with('script/spec').and_return true
|
91
91
|
File.stub!(:file?).with('spec/spec.opts').and_return true
|
92
|
-
ParallelTests::
|
92
|
+
ParallelTests::RSpec::Runner.should_receive(:open).with{|x,y| x =~ %r{script/spec\s+ -O spec/spec.opts}}.and_return mocked_process
|
93
93
|
call(['xxx'],1,{})
|
94
94
|
end
|
95
95
|
|
96
96
|
it "uses -O spec/parallel_spec.opts when found (with script/spec)" do
|
97
97
|
File.stub!(:file?).with('script/spec').and_return true
|
98
98
|
File.should_receive(:file?).with('spec/parallel_spec.opts').and_return true
|
99
|
-
ParallelTests::
|
99
|
+
ParallelTests::RSpec::Runner.should_receive(:open).with{|x,y| x =~ %r{script/spec\s+ -O spec/parallel_spec.opts}}.and_return mocked_process
|
100
100
|
call(['xxx'],1,{})
|
101
101
|
end
|
102
102
|
|
103
103
|
it "uses -O .rspec_parallel when found (with script/spec)" do
|
104
104
|
File.stub!(:file?).with('script/spec').and_return true
|
105
105
|
File.should_receive(:file?).with('.rspec_parallel').and_return true
|
106
|
-
ParallelTests::
|
106
|
+
ParallelTests::RSpec::Runner.should_receive(:open).with{|x,y| x =~ %r{script/spec\s+ -O .rspec_parallel}}.and_return mocked_process
|
107
107
|
call(['xxx'],1,{})
|
108
108
|
end
|
109
109
|
|
@@ -111,9 +111,9 @@ describe ParallelTests::Spec::Runner do
|
|
111
111
|
File.should_receive(:file?).with('spec/parallel_spec.opts').and_return true
|
112
112
|
|
113
113
|
ParallelTests.stub!(:bundler_enabled?).and_return true
|
114
|
-
ParallelTests::
|
114
|
+
ParallelTests::RSpec::Runner.stub!(:run).with("bundle show rspec").and_return "/foo/bar/rspec-1.0.2"
|
115
115
|
|
116
|
-
ParallelTests::
|
116
|
+
ParallelTests::RSpec::Runner.should_receive(:open).with{|x,y| x =~ %r{spec\s+ -O spec/parallel_spec.opts}}.and_return mocked_process
|
117
117
|
call(['xxx'],1,{})
|
118
118
|
end
|
119
119
|
|
@@ -121,28 +121,28 @@ describe ParallelTests::Spec::Runner do
|
|
121
121
|
File.should_receive(:file?).with('spec/parallel_spec.opts').and_return true
|
122
122
|
|
123
123
|
ParallelTests.stub!(:bundler_enabled?).and_return true
|
124
|
-
ParallelTests::
|
124
|
+
ParallelTests::RSpec::Runner.stub!(:run).with("bundle show rspec").and_return "/foo/bar/rspec-2.4.2"
|
125
125
|
|
126
|
-
ParallelTests::
|
126
|
+
ParallelTests::RSpec::Runner.should_receive(:open).with{|x,y| x =~ %r{rspec\s+ --color --tty -O spec/parallel_spec.opts}}.and_return mocked_process
|
127
127
|
call(['xxx'],1,{})
|
128
128
|
end
|
129
129
|
|
130
130
|
it "uses options passed in" do
|
131
|
-
ParallelTests::
|
131
|
+
ParallelTests::RSpec::Runner.should_receive(:open).with{|x,y| x =~ %r{rspec -f n}}.and_return mocked_process
|
132
132
|
call(['xxx'],1, :test_options => '-f n')
|
133
133
|
end
|
134
134
|
|
135
135
|
it "returns the output" do
|
136
136
|
io = open('spec/spec_helper.rb')
|
137
137
|
$stdout.stub!(:print)
|
138
|
-
ParallelTests::
|
138
|
+
ParallelTests::RSpec::Runner.should_receive(:open).and_return io
|
139
139
|
call(['xxx'],1,{})[:stdout].should =~ /\$LOAD_PATH << File/
|
140
140
|
end
|
141
141
|
end
|
142
142
|
|
143
143
|
describe :find_results do
|
144
144
|
def call(*args)
|
145
|
-
ParallelTests::
|
145
|
+
ParallelTests::RSpec::Runner.find_results(*args)
|
146
146
|
end
|
147
147
|
|
148
148
|
it "finds multiple results in spec output" do
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe ParallelTests::
|
3
|
+
describe ParallelTests::RSpec::RuntimeLogger do
|
4
4
|
before do
|
5
5
|
# pretend we run in parallel or the logger will log nothing
|
6
6
|
ENV['TEST_ENV_NUMBER'] = ''
|
@@ -18,7 +18,7 @@ describe ParallelTests::Spec::RuntimeLogger do
|
|
18
18
|
logger = if block_given?
|
19
19
|
yield(f)
|
20
20
|
else
|
21
|
-
ParallelTests::
|
21
|
+
ParallelTests::RSpec::RuntimeLogger.new(f)
|
22
22
|
end
|
23
23
|
|
24
24
|
example = (mock(:location => "#{Dir.pwd}/spec/foo.rb:123"))
|
@@ -59,7 +59,7 @@ describe ParallelTests::Spec::RuntimeLogger do
|
|
59
59
|
it "appends to a given file" do
|
60
60
|
result = log_for_a_file do |f|
|
61
61
|
f.write 'FooBar'
|
62
|
-
ParallelTests::
|
62
|
+
ParallelTests::RSpec::RuntimeLogger.new(f)
|
63
63
|
end
|
64
64
|
result.should include('FooBar')
|
65
65
|
result.should include('foo.rb')
|
@@ -68,7 +68,7 @@ describe ParallelTests::Spec::RuntimeLogger do
|
|
68
68
|
it "overwrites a given path" do
|
69
69
|
result = log_for_a_file do |f|
|
70
70
|
f.write 'FooBar'
|
71
|
-
ParallelTests::
|
71
|
+
ParallelTests::RSpec::RuntimeLogger.new(f.path)
|
72
72
|
end
|
73
73
|
result.should_not include('FooBar')
|
74
74
|
result.should include('foo.rb')
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe ParallelTests::
|
3
|
+
describe ParallelTests::RSpec::SummaryLogger do
|
4
4
|
let(:output){ OutputLogger.new([]) }
|
5
|
-
let(:logger){ ParallelTests::
|
5
|
+
let(:logger){ ParallelTests::RSpec::SummaryLogger.new(output) }
|
6
6
|
|
7
7
|
# TODO somehow generate a real example with an exception to test this
|
8
8
|
xit "prints failing examples" do
|
data/spec/spec_helper.rb
CHANGED
@@ -7,9 +7,9 @@ require 'parallel_tests'
|
|
7
7
|
require 'parallel_tests/test/runner'
|
8
8
|
require 'parallel_tests/test/runtime_logger'
|
9
9
|
|
10
|
-
require 'parallel_tests/
|
11
|
-
require 'parallel_tests/
|
12
|
-
require 'parallel_tests/
|
10
|
+
require 'parallel_tests/rspec/runner'
|
11
|
+
require 'parallel_tests/rspec/runtime_logger'
|
12
|
+
require 'parallel_tests/rspec/summary_logger'
|
13
13
|
|
14
14
|
require 'parallel_tests/cucumber/runner'
|
15
15
|
|
metadata
CHANGED
@@ -1,49 +1,36 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: parallel_tests
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.7.0.rc2
|
5
5
|
prerelease: 6
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 7
|
9
|
-
- 0
|
10
|
-
- rc
|
11
|
-
- 1
|
12
|
-
version: 0.7.0.rc1
|
13
6
|
platform: ruby
|
14
|
-
authors:
|
7
|
+
authors:
|
15
8
|
- Michael Grosser
|
16
9
|
autorequire:
|
17
10
|
bindir: bin
|
18
11
|
cert_chain: []
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
12
|
+
date: 2012-02-27 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: parallel
|
16
|
+
requirement: &18742180 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
version: "0"
|
32
|
-
prerelease: false
|
33
|
-
requirement: *id001
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
34
22
|
type: :runtime
|
35
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *18742180
|
36
25
|
description:
|
37
26
|
email: michael@grosser.it
|
38
|
-
executables:
|
27
|
+
executables:
|
39
28
|
- parallel_cucumber
|
40
29
|
- parallel_spec
|
41
30
|
- parallel_test
|
42
31
|
extensions: []
|
43
|
-
|
44
32
|
extra_rdoc_files: []
|
45
|
-
|
46
|
-
files:
|
33
|
+
files:
|
47
34
|
- .gitignore
|
48
35
|
- Gemfile
|
49
36
|
- Gemfile.lock
|
@@ -59,11 +46,11 @@ files:
|
|
59
46
|
- lib/parallel_tests/cucumber/runtime_logger.rb
|
60
47
|
- lib/parallel_tests/grouper.rb
|
61
48
|
- lib/parallel_tests/railtie.rb
|
62
|
-
- lib/parallel_tests/
|
63
|
-
- lib/parallel_tests/
|
64
|
-
- lib/parallel_tests/
|
65
|
-
- lib/parallel_tests/
|
66
|
-
- lib/parallel_tests/
|
49
|
+
- lib/parallel_tests/rspec/failures_logger.rb
|
50
|
+
- lib/parallel_tests/rspec/logger_base.rb
|
51
|
+
- lib/parallel_tests/rspec/runner.rb
|
52
|
+
- lib/parallel_tests/rspec/runtime_logger.rb
|
53
|
+
- lib/parallel_tests/rspec/summary_logger.rb
|
67
54
|
- lib/parallel_tests/tasks.rb
|
68
55
|
- lib/parallel_tests/test/runner.rb
|
69
56
|
- lib/parallel_tests/test/runtime_logger.rb
|
@@ -71,48 +58,40 @@ files:
|
|
71
58
|
- parallel_tests.gemspec
|
72
59
|
- spec/integration_spec.rb
|
73
60
|
- spec/parallel_tests/cucumber/runner_spec.rb
|
74
|
-
- spec/parallel_tests/
|
75
|
-
- spec/parallel_tests/
|
76
|
-
- spec/parallel_tests/
|
77
|
-
- spec/parallel_tests/
|
61
|
+
- spec/parallel_tests/rspec/failure_logger_spec.rb
|
62
|
+
- spec/parallel_tests/rspec/runner_spec.rb
|
63
|
+
- spec/parallel_tests/rspec/runtime_logger_spec.rb
|
64
|
+
- spec/parallel_tests/rspec/summary_logger_spec.rb
|
78
65
|
- spec/parallel_tests/test/runner_spec.rb
|
79
66
|
- spec/parallel_tests/test/runtime_logger_spec.rb
|
80
67
|
- spec/parallel_tests_spec.rb
|
81
68
|
- spec/spec_helper.rb
|
82
69
|
homepage: http://github.com/grosser/parallel_tests
|
83
|
-
licenses:
|
70
|
+
licenses:
|
84
71
|
- MIT
|
85
72
|
post_install_message:
|
86
73
|
rdoc_options: []
|
87
|
-
|
88
|
-
require_paths:
|
74
|
+
require_paths:
|
89
75
|
- lib
|
90
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
91
77
|
none: false
|
92
|
-
requirements:
|
93
|
-
- -
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
|
96
|
-
segments:
|
78
|
+
requirements:
|
79
|
+
- - ! '>='
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
segments:
|
97
83
|
- 0
|
98
|
-
|
99
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
+
hash: 3769225789996379238
|
85
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
86
|
none: false
|
101
|
-
requirements:
|
102
|
-
- -
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
hash: 25
|
105
|
-
segments:
|
106
|
-
- 1
|
107
|
-
- 3
|
108
|
-
- 1
|
87
|
+
requirements:
|
88
|
+
- - ! '>'
|
89
|
+
- !ruby/object:Gem::Version
|
109
90
|
version: 1.3.1
|
110
91
|
requirements: []
|
111
|
-
|
112
92
|
rubyforge_project:
|
113
93
|
rubygems_version: 1.8.15
|
114
94
|
signing_key:
|
115
95
|
specification_version: 3
|
116
96
|
summary: Run Test::Unit / RSpec / Cucumber in parallel
|
117
97
|
test_files: []
|
118
|
-
|