parallelized_specs 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Rakefile +2 -2
- data/Readme.md +32 -65
- data/VERSION +1 -1
- data/bin/parallelized_spec +2 -0
- data/bin/{parallel_test → parallelized_test} +6 -7
- data/lib/{parallel_specs.rb → parallelized_specs.rb} +4 -4
- data/lib/{parallel_specs → parallelized_specs}/spec_error_count_logger.rb +2 -2
- data/lib/{parallel_specs → parallelized_specs}/spec_error_logger.rb +2 -2
- data/lib/{parallel_specs → parallelized_specs}/spec_failures_logger.rb +3 -3
- data/lib/{parallel_specs → parallelized_specs}/spec_logger_base.rb +3 -3
- data/lib/{parallel_specs → parallelized_specs}/spec_runtime_logger.rb +1 -1
- data/lib/{parallel_specs → parallelized_specs}/spec_start_finish_logger.rb +2 -2
- data/lib/{parallel_specs → parallelized_specs}/spec_summary_logger.rb +2 -2
- data/lib/{parallel_tests.rb → parallelized_tests.rb} +4 -4
- data/lib/{parallel_tests → parallelized_tests}/grouper.rb +1 -1
- data/lib/{parallel_tests → parallelized_tests}/railtie.rb +2 -2
- data/lib/{parallel_tests → parallelized_tests}/runtime_logger.rb +4 -4
- data/lib/{parallel_tests → parallelized_tests}/tasks.rb +4 -4
- data/lib/tasks/parallelized_tests.rake +1 -0
- data/parallelized_specs.gemspec +26 -26
- data/spec/integration_spec.rb +3 -4
- data/spec/{parallel_specs → parallelized_specs}/spec_failure_logger_spec.rb +8 -8
- data/spec/{parallel_specs → parallelized_specs}/spec_runtime_logger_spec.rb +4 -4
- data/spec/{parallel_specs → parallelized_specs}/spec_summary_logger_spec.rb +2 -2
- data/spec/parallelized_specs_spec.rb +165 -0
- data/spec/{parallel_tests → parallelized_tests}/runtime_logger_spec.rb +13 -13
- data/spec/{parallel_tests_spec.rb → parallelized_tests_spec.rb} +39 -39
- data/spec/spec_helper.rb +1 -1
- metadata +29 -29
- data/bin/parallel_spec +0 -2
- data/lib/tasks/parallel_tests.rake +0 -1
- data/spec/parallel_specs_spec.rb +0 -165
@@ -1,7 +1,7 @@
|
|
1
1
|
namespace :parallel do
|
2
2
|
def run_in_parallel(cmd, options)
|
3
3
|
count = (options[:count] ? options[:count].to_i : nil)
|
4
|
-
executable = File.join(File.dirname(__FILE__), '..', '..', 'bin', '
|
4
|
+
executable = File.join(File.dirname(__FILE__), '..', '..', 'bin', 'parallelized_test')
|
5
5
|
command = "#{executable} --exec '#{cmd}' -n #{count} #{'--non-parallel' if options[:non_parallel]}"
|
6
6
|
abort unless system(command)
|
7
7
|
end
|
@@ -45,9 +45,9 @@ namespace :parallel do
|
|
45
45
|
desc "run #{type} in parallel with parallel:#{type}[num_cpus]"
|
46
46
|
task type, :count, :pattern, :options, :arguments do |t,args|
|
47
47
|
$LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
48
|
-
require "
|
49
|
-
count, pattern, options =
|
50
|
-
executable = File.join(File.dirname(__FILE__), '..', '..', 'bin', '
|
48
|
+
require "parallelized_tests"
|
49
|
+
count, pattern, options = ParallelizedTests.parse_rake_args(args)
|
50
|
+
executable = File.join(File.dirname(__FILE__), '..', '..', 'bin', 'parallelized_test')
|
51
51
|
command = "#{executable} --type #{type} -n #{count} -p '#{pattern}' -r '#{Rails.root}' -o '#{options}' #{args[:arguments]}"
|
52
52
|
abort unless system(command) # allow to chain tasks e.g. rake parallel:spec parallel:features
|
53
53
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), "/../parallelized_tests/tasks")
|
data/parallelized_specs.gemspec
CHANGED
@@ -5,46 +5,46 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "parallelized_specs"
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jake Sorce, Bryan Madsen"]
|
12
|
-
s.date = "2012-04-
|
12
|
+
s.date = "2012-04-18"
|
13
13
|
s.email = "jake@instructure.com"
|
14
|
-
s.executables = ["
|
14
|
+
s.executables = ["parallelized_spec", "parallelized_test"]
|
15
15
|
s.files = [
|
16
16
|
"Gemfile",
|
17
17
|
"Gemfile.lock",
|
18
18
|
"Rakefile",
|
19
19
|
"Readme.md",
|
20
20
|
"VERSION",
|
21
|
-
"bin/
|
22
|
-
"bin/
|
23
|
-
"lib/
|
24
|
-
"lib/
|
25
|
-
"lib/
|
26
|
-
"lib/
|
27
|
-
"lib/
|
28
|
-
"lib/
|
29
|
-
"lib/
|
30
|
-
"lib/
|
31
|
-
"lib/
|
32
|
-
"lib/
|
33
|
-
"lib/
|
34
|
-
"lib/
|
35
|
-
"lib/
|
36
|
-
"lib/tasks/
|
21
|
+
"bin/parallelized_spec",
|
22
|
+
"bin/parallelized_test",
|
23
|
+
"lib/parallelized_specs.rb",
|
24
|
+
"lib/parallelized_specs/spec_error_count_logger.rb",
|
25
|
+
"lib/parallelized_specs/spec_error_logger.rb",
|
26
|
+
"lib/parallelized_specs/spec_failures_logger.rb",
|
27
|
+
"lib/parallelized_specs/spec_logger_base.rb",
|
28
|
+
"lib/parallelized_specs/spec_runtime_logger.rb",
|
29
|
+
"lib/parallelized_specs/spec_start_finish_logger.rb",
|
30
|
+
"lib/parallelized_specs/spec_summary_logger.rb",
|
31
|
+
"lib/parallelized_tests.rb",
|
32
|
+
"lib/parallelized_tests/grouper.rb",
|
33
|
+
"lib/parallelized_tests/railtie.rb",
|
34
|
+
"lib/parallelized_tests/runtime_logger.rb",
|
35
|
+
"lib/parallelized_tests/tasks.rb",
|
36
|
+
"lib/tasks/parallelized_tests.rake",
|
37
37
|
"parallelized_specs.gemspec",
|
38
38
|
"spec/integration_spec.rb",
|
39
|
-
"spec/
|
40
|
-
"spec/
|
41
|
-
"spec/
|
42
|
-
"spec/
|
43
|
-
"spec/
|
44
|
-
"spec/
|
39
|
+
"spec/parallelized_specs/spec_failure_logger_spec.rb",
|
40
|
+
"spec/parallelized_specs/spec_runtime_logger_spec.rb",
|
41
|
+
"spec/parallelized_specs/spec_summary_logger_spec.rb",
|
42
|
+
"spec/parallelized_specs_spec.rb",
|
43
|
+
"spec/parallelized_tests/runtime_logger_spec.rb",
|
44
|
+
"spec/parallelized_tests_spec.rb",
|
45
45
|
"spec/spec_helper.rb"
|
46
46
|
]
|
47
|
-
s.homepage = "http://github.com/
|
47
|
+
s.homepage = "http://github.com/jakesorce/parallelized_specs"
|
48
48
|
s.require_paths = ["lib"]
|
49
49
|
s.rubygems_version = "1.8.22"
|
50
50
|
s.summary = "Run rspec tests in parallel"
|
data/spec/integration_spec.rb
CHANGED
@@ -10,7 +10,7 @@ describe 'CLI' do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def folder
|
13
|
-
"/tmp/
|
13
|
+
"/tmp/parallelized_tests_tests"
|
14
14
|
end
|
15
15
|
|
16
16
|
def write(file, content)
|
@@ -25,7 +25,7 @@ describe 'CLI' do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def executable
|
28
|
-
"#{bin_folder}/
|
28
|
+
"#{bin_folder}/parallelized_test"
|
29
29
|
end
|
30
30
|
|
31
31
|
def run_tests(options={})
|
@@ -87,8 +87,7 @@ describe 'CLI' do
|
|
87
87
|
|
88
88
|
it "can run through parallel_spec / parallel_cucumber" do
|
89
89
|
version = `#{executable} -v`
|
90
|
-
`#{bin_folder}/
|
91
|
-
`#{bin_folder}/parallel_cucumber -v`.should == version
|
90
|
+
`#{bin_folder}/parallelized_spec -v`.should == version
|
92
91
|
end
|
93
92
|
|
94
93
|
it "runs faster with more processes" do
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe ParallelizedSpecs::SpecFailuresLogger do
|
4
4
|
def silence_warnings
|
5
5
|
old_verbose, $VERBOSE = $VERBOSE, nil
|
6
6
|
yield
|
@@ -14,11 +14,11 @@ describe ParallelSpecs::SpecFailuresLogger 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 =
|
17
|
+
@logger = ParallelizedSpecs::SpecFailuresLogger.new( @output )
|
18
18
|
end
|
19
19
|
|
20
20
|
after do
|
21
|
-
silence_warnings{
|
21
|
+
silence_warnings{ ParallelizedSpecs::SpecLoggerBase::RSPEC_1 = false }
|
22
22
|
end
|
23
23
|
|
24
24
|
def clean_output
|
@@ -37,9 +37,9 @@ describe ParallelSpecs::SpecFailuresLogger do
|
|
37
37
|
end
|
38
38
|
|
39
39
|
it "should invoke spec for rspec 1" do
|
40
|
-
silence_warnings{
|
41
|
-
|
42
|
-
|
40
|
+
silence_warnings{ ParallelizedSpecs::SpecLoggerBase::RSPEC_1 = true }
|
41
|
+
ParallelizedSpecs.stub!(:bundler_enabled?).and_return true
|
42
|
+
ParallelizedSpecs.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
|
@@ -49,8 +49,8 @@ describe ParallelSpecs::SpecFailuresLogger do
|
|
49
49
|
end
|
50
50
|
|
51
51
|
it "should invoke rspec for rspec 2" do
|
52
|
-
|
53
|
-
|
52
|
+
ParallelizedSpecs.stub!(:bundler_enabled?).and_return true
|
53
|
+
ParallelizedSpecs.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,6 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe ParallelizedSpecs::SpecRuntimeLogger 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 ParallelSpecs::SpecRuntimeLogger do
|
|
18
18
|
logger = if block_given?
|
19
19
|
yield(f)
|
20
20
|
else
|
21
|
-
|
21
|
+
ParallelizedSpecs::SpecRuntimeLogger.new(f)
|
22
22
|
end
|
23
23
|
|
24
24
|
example = (mock(:location => "#{Dir.pwd}/spec/foo.rb:123"))
|
@@ -59,7 +59,7 @@ describe ParallelSpecs::SpecRuntimeLogger 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
|
-
|
62
|
+
ParallelizedSpecs::SpecRuntimeLogger.new(f)
|
63
63
|
end
|
64
64
|
result.should include('FooBar')
|
65
65
|
result.should include('foo.rb')
|
@@ -68,7 +68,7 @@ describe ParallelSpecs::SpecRuntimeLogger do
|
|
68
68
|
it "overwrites a given path" do
|
69
69
|
result = log_for_a_file do |f|
|
70
70
|
f.write 'FooBar'
|
71
|
-
|
71
|
+
ParallelizedSpecs::SpecRuntimeLogger.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
|
3
|
+
describe ParallelizedSpecs::SpecSummaryLogger do
|
4
4
|
let(:output){ OutputLogger.new([]) }
|
5
|
-
let(:logger){
|
5
|
+
let(:logger){ ParallelizedSpecs::SpecSummaryLogger.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
|
@@ -0,0 +1,165 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'parallelized_specs/spec_runtime_logger'
|
3
|
+
require 'parallelized_specs/spec_summary_logger'
|
4
|
+
require 'parallelized_specs/spec_failures_logger'
|
5
|
+
|
6
|
+
describe ParallelizedSpecs do
|
7
|
+
test_tests_in_groups(ParallelizedSpecs, 'spec', '_spec.rb')
|
8
|
+
|
9
|
+
describe :run_tests do
|
10
|
+
before do
|
11
|
+
File.stub!(:file?).with('script/spec').and_return false
|
12
|
+
File.stub!(:file?).with('spec/spec.opts').and_return false
|
13
|
+
File.stub!(:file?).with('spec/parallelized_spec.opts').and_return false
|
14
|
+
ParallelizedSpecs.stub!(:bundler_enabled?).and_return false
|
15
|
+
end
|
16
|
+
|
17
|
+
it "uses TEST_ENV_NUMBER=blank when called for process 0" do
|
18
|
+
ParallelizedSpecs.should_receive(:open).with{|x,y|x=~/TEST_ENV_NUMBER= /}.and_return mocked_process
|
19
|
+
ParallelizedSpecs.run_tests(['xxx'],0,{})
|
20
|
+
end
|
21
|
+
|
22
|
+
it "uses TEST_ENV_NUMBER=2 when called for process 1" do
|
23
|
+
ParallelizedSpecs.should_receive(:open).with{|x,y| x=~/TEST_ENV_NUMBER=2/}.and_return mocked_process
|
24
|
+
ParallelizedSpecs.run_tests(['xxx'],1,{})
|
25
|
+
end
|
26
|
+
|
27
|
+
it "runs with color when called from cmdline" do
|
28
|
+
ParallelizedSpecs.should_receive(:open).with{|x,y| x=~/ --tty /}.and_return mocked_process
|
29
|
+
$stdout.should_receive(:tty?).and_return true
|
30
|
+
ParallelizedSpecs.run_tests(['xxx'],1,{})
|
31
|
+
end
|
32
|
+
|
33
|
+
it "runs without color when not called from cmdline" do
|
34
|
+
ParallelizedSpecs.should_receive(:open).with{|x,y| x !~ / --tty /}.and_return mocked_process
|
35
|
+
$stdout.should_receive(:tty?).and_return false
|
36
|
+
ParallelizedSpecs.run_tests(['xxx'],1,{})
|
37
|
+
end
|
38
|
+
|
39
|
+
it "runs with color for rspec 1 when called for the cmdline" do
|
40
|
+
File.should_receive(:file?).with('script/spec').and_return true
|
41
|
+
ParallelizedSpecs.should_receive(:open).with{|x,y| x=~/ RSPEC_COLOR=1 /}.and_return mocked_process
|
42
|
+
$stdout.should_receive(:tty?).and_return true
|
43
|
+
ParallelizedSpecs.run_tests(['xxx'],1,{})
|
44
|
+
end
|
45
|
+
|
46
|
+
it "runs without color for rspec 1 when not called for the cmdline" do
|
47
|
+
File.should_receive(:file?).with('script/spec').and_return true
|
48
|
+
ParallelizedSpecs.should_receive(:open).with{|x,y| x !~ / RSPEC_COLOR=1 /}.and_return mocked_process
|
49
|
+
$stdout.should_receive(:tty?).and_return false
|
50
|
+
ParallelizedSpecs.run_tests(['xxx'],1,{})
|
51
|
+
end
|
52
|
+
|
53
|
+
it "run bundle exec spec when on bundler rspec 1" do
|
54
|
+
File.stub!(:file?).with('script/spec').and_return false
|
55
|
+
ParallelizedSpecs.stub!(:bundler_enabled?).and_return true
|
56
|
+
ParallelizedSpecs.stub!(:run).with("bundle show rspec").and_return "/foo/bar/rspec-1.0.2"
|
57
|
+
ParallelizedSpecs.should_receive(:open).with{|x,y| x =~ %r{bundle exec spec}}.and_return mocked_process
|
58
|
+
ParallelizedSpecs.run_tests(['xxx'],1,{})
|
59
|
+
end
|
60
|
+
|
61
|
+
it "run bundle exec rspec when on bundler rspec 2" do
|
62
|
+
File.stub!(:file?).with('script/spec').and_return false
|
63
|
+
ParallelizedSpecs.stub!(:bundler_enabled?).and_return true
|
64
|
+
ParallelizedSpecs.stub!(:run).with("bundle show rspec").and_return "/foo/bar/rspec-2.0.2"
|
65
|
+
ParallelizedSpecs.should_receive(:open).with{|x,y| x =~ %r{bundle exec rspec}}.and_return mocked_process
|
66
|
+
ParallelizedSpecs.run_tests(['xxx'],1,{})
|
67
|
+
end
|
68
|
+
|
69
|
+
it "runs script/spec when script/spec can be found" do
|
70
|
+
File.should_receive(:file?).with('script/spec').and_return true
|
71
|
+
ParallelizedSpecs.should_receive(:open).with{|x,y| x =~ %r{script/spec}}.and_return mocked_process
|
72
|
+
ParallelizedSpecs.run_tests(['xxx'],1,{})
|
73
|
+
end
|
74
|
+
|
75
|
+
it "runs spec when script/spec cannot be found" do
|
76
|
+
File.stub!(:file?).with('script/spec').and_return false
|
77
|
+
ParallelizedSpecs.should_receive(:open).with{|x,y| x !~ %r{script/spec}}.and_return mocked_process
|
78
|
+
ParallelizedSpecs.run_tests(['xxx'],1,{})
|
79
|
+
end
|
80
|
+
|
81
|
+
it "uses no -O when no opts where found" do
|
82
|
+
File.stub!(:file?).with('spec/spec.opts').and_return false
|
83
|
+
ParallelizedSpecs.should_receive(:open).with{|x,y| x !~ %r{spec/spec.opts}}.and_return mocked_process
|
84
|
+
ParallelizedSpecs.run_tests(['xxx'],1,{})
|
85
|
+
end
|
86
|
+
|
87
|
+
it "uses -O spec/spec.opts when found (with script/spec)" do
|
88
|
+
File.stub!(:file?).with('script/spec').and_return true
|
89
|
+
File.stub!(:file?).with('spec/spec.opts').and_return true
|
90
|
+
ParallelizedSpecs.should_receive(:open).with{|x,y| x =~ %r{script/spec\s+ -O spec/spec.opts}}.and_return mocked_process
|
91
|
+
ParallelizedSpecs.run_tests(['xxx'],1,{})
|
92
|
+
end
|
93
|
+
|
94
|
+
it "uses -O spec/parallel_spec.opts when found (with script/spec)" do
|
95
|
+
File.stub!(:file?).with('script/spec').and_return true
|
96
|
+
File.should_receive(:file?).with('spec/parallelized_spec.opts').and_return true
|
97
|
+
ParallelizedSpecs.should_receive(:open).with{|x,y| x =~ %r{script/spec\s+ -O spec/parallel_spec.opts}}.and_return mocked_process
|
98
|
+
ParallelizedSpecs.run_tests(['xxx'],1,{})
|
99
|
+
end
|
100
|
+
|
101
|
+
it "uses -O spec/parallel_spec.opts with rspec1" do
|
102
|
+
File.should_receive(:file?).with('spec/parallelized_spec.opts').and_return true
|
103
|
+
|
104
|
+
ParallelizedSpecs.stub!(:bundler_enabled?).and_return true
|
105
|
+
ParallelizedSpecs.stub!(:run).with("bundle show rspec").and_return "/foo/bar/rspec-1.0.2"
|
106
|
+
|
107
|
+
ParallelizedSpecs.should_receive(:open).with{|x,y| x =~ %r{spec\s+ -O spec/parallel_spec.opts}}.and_return mocked_process
|
108
|
+
ParallelizedSpecs.run_tests(['xxx'],1,{})
|
109
|
+
end
|
110
|
+
|
111
|
+
it "uses -O spec/parallel_spec.opts with rspec2" do
|
112
|
+
File.should_receive(:file?).with('spec/parallelized_spec.opts').and_return true
|
113
|
+
|
114
|
+
ParallelizedSpecs.stub!(:bundler_enabled?).and_return true
|
115
|
+
ParallelizedSpecs.stub!(:run).with("bundle show rspec").and_return "/foo/bar/rspec-2.4.2"
|
116
|
+
|
117
|
+
ParallelizedSpecs.should_receive(:open).with{|x,y| x =~ %r{rspec\s+ --color --tty -O spec/parallel_spec.opts}}.and_return mocked_process
|
118
|
+
ParallelizedSpecs.run_tests(['xxx'],1,{})
|
119
|
+
end
|
120
|
+
|
121
|
+
it "uses options passed in" do
|
122
|
+
ParallelizedSpecs.should_receive(:open).with{|x,y| x =~ %r{rspec -f n}}.and_return mocked_process
|
123
|
+
ParallelizedSpecs.run_tests(['xxx'],1, :test_options => '-f n')
|
124
|
+
end
|
125
|
+
|
126
|
+
it "returns the output" do
|
127
|
+
io = open('spec/spec_helper.rb')
|
128
|
+
ParallelizedSpecs.stub!(:print)
|
129
|
+
ParallelizedSpecs.should_receive(:open).and_return io
|
130
|
+
ParallelizedSpecs.run_tests(['xxx'],1,{})[:stdout].should =~ /\$LOAD_PATH << File/
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
describe :find_results do
|
135
|
+
it "finds multiple results in spec output" do
|
136
|
+
output = <<EOF
|
137
|
+
....F...
|
138
|
+
..
|
139
|
+
failute fsddsfsd
|
140
|
+
...
|
141
|
+
ff.**..
|
142
|
+
0 examples, 0 failures, 0 pending
|
143
|
+
ff.**..
|
144
|
+
1 example, 1 failure, 1 pending
|
145
|
+
EOF
|
146
|
+
|
147
|
+
ParallelizedSpecs.find_results(output).should == ['0 examples, 0 failures, 0 pending','1 example, 1 failure, 1 pending']
|
148
|
+
end
|
149
|
+
|
150
|
+
it "is robust against scrambeled output" do
|
151
|
+
output = <<EOF
|
152
|
+
....F...
|
153
|
+
..
|
154
|
+
failute fsddsfsd
|
155
|
+
...
|
156
|
+
ff.**..
|
157
|
+
0 exFampl*es, 0 failures, 0 pend.ing
|
158
|
+
ff.**..
|
159
|
+
1 exampF.les, 1 failures, 1 pend.ing
|
160
|
+
EOF
|
161
|
+
|
162
|
+
ParallelizedSpecs.find_results(output).should == ['0 examples, 0 failures, 0 pending','1 examples, 1 failures, 1 pending']
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe ParallelizedTests::RuntimeLogger do
|
4
4
|
|
5
5
|
describe :writing do
|
6
6
|
it "overwrites the runtime_log file on first log invocation" do
|
@@ -8,10 +8,10 @@ describe ParallelTests::RuntimeLogger do
|
|
8
8
|
end
|
9
9
|
test = FakeTest.new
|
10
10
|
time = Time.now
|
11
|
-
File.open(
|
12
|
-
|
13
|
-
|
14
|
-
result = File.read(
|
11
|
+
File.open(ParallelizedTests.runtime_log, 'w'){ |f| f.puts("FooBar") }
|
12
|
+
ParallelizedTests::RuntimeLogger.send(:class_variable_set,:@@has_started, false)
|
13
|
+
ParallelizedTests::RuntimeLogger.log(test, time, Time.at(time.to_f+2.00))
|
14
|
+
result = File.read(ParallelizedTests.runtime_log)
|
15
15
|
result.should_not include('FooBar')
|
16
16
|
result.should include('test/fake_test.rb:2.00')
|
17
17
|
end
|
@@ -25,11 +25,11 @@ describe ParallelTests::RuntimeLogger do
|
|
25
25
|
other_test = OtherFakeTest.new
|
26
26
|
|
27
27
|
time = Time.now
|
28
|
-
File.open(
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
result = File.read(
|
28
|
+
File.open(ParallelizedTests.runtime_log, 'w'){ |f| f.puts("FooBar") }
|
29
|
+
ParallelizedTests::RuntimeLogger.send(:class_variable_set,:@@has_started, false)
|
30
|
+
ParallelizedTests::RuntimeLogger.log(test, time, Time.at(time.to_f+2.00))
|
31
|
+
ParallelizedTests::RuntimeLogger.log(other_test, time, Time.at(time.to_f+2.00))
|
32
|
+
result = File.read(ParallelizedTests.runtime_log)
|
33
33
|
result.should_not include('FooBar')
|
34
34
|
result.should include('test/fake_test.rb:2.00')
|
35
35
|
result.should include('test/other_fake_test.rb:2.00')
|
@@ -43,7 +43,7 @@ describe ParallelTests::RuntimeLogger do
|
|
43
43
|
end
|
44
44
|
test = FakeTest.new
|
45
45
|
time = Time.now
|
46
|
-
|
46
|
+
ParallelizedTests::RuntimeLogger.message(test, time, Time.at(time.to_f+2.00)).should == 'test/fake_test.rb:2.00'
|
47
47
|
end
|
48
48
|
|
49
49
|
it "formats results for complex test names" do
|
@@ -53,7 +53,7 @@ describe ParallelTests::RuntimeLogger do
|
|
53
53
|
end
|
54
54
|
test = AVeryComplex::FakeTest.new
|
55
55
|
time = Time.now
|
56
|
-
|
56
|
+
ParallelizedTests::RuntimeLogger.message(test, time, Time.at(time.to_f+2.00)).should == 'test/a_very_complex/fake_test.rb:2.00'
|
57
57
|
end
|
58
58
|
|
59
59
|
it "guesses subdirectory structure for rails test classes" do
|
@@ -67,7 +67,7 @@ describe ParallelTests::RuntimeLogger do
|
|
67
67
|
end
|
68
68
|
test = FakeControllerTest.new
|
69
69
|
time = Time.now
|
70
|
-
|
70
|
+
ParallelizedTests::RuntimeLogger.message(test, time, Time.at(time.to_f+2.00)).should == 'test/functional/fake_controller_test.rb:2.00'
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|