parallel_tests 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/Readme.md +1 -0
- data/lib/parallel_tests/cli.rb +1 -0
- data/lib/parallel_tests/test/runner.rb +5 -4
- data/lib/parallel_tests/version.rb +1 -1
- data/spec/spec_helper.rb +13 -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: 2252b172b8d651430e068691a993c60b1188ef0a
|
4
|
+
data.tar.gz: ff9bd5e5af97914fb962db515fd3c6642daa41f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d075271ae5adb025703922d85991a8f197c8eab126a4836143b30752c5138d6b967841d53500258a699742aef2c7896cdf39d03c1014307c447016147afb186
|
7
|
+
data.tar.gz: ce7fe0057aac13ce7a785521ac0a8f1695cb7ed5edaf11d04521a7399ff487ce90b40ddf7edf3e1bc2c8203d0b6b7aa73d17d4bd55845ce62a3566af13b09e06
|
data/Gemfile.lock
CHANGED
data/Readme.md
CHANGED
@@ -295,6 +295,7 @@ inspired by [pivotal labs](http://pivotallabs.com/users/miked/blog/articles/849-
|
|
295
295
|
- [Matt Hodgson](https://github.com/mhodgson)
|
296
296
|
- [bicarbon8](https://github.com/bicarbon8)
|
297
297
|
- [seichner](https://github.com/seichner)
|
298
|
+
- [Matt Southerden](https://github.com/mattsoutherden)
|
298
299
|
|
299
300
|
[Michael Grosser](http://grosser.it)<br/>
|
300
301
|
michael@grosser.it<br/>
|
data/lib/parallel_tests/cli.rb
CHANGED
@@ -141,6 +141,7 @@ TEXT
|
|
141
141
|
opts.on("--no-symlinks", "Do not traverse symbolic links to find test files") { options[:symlinks] = false }
|
142
142
|
opts.on('--ignore-tags [PATTERN]', 'When counting steps ignore scenarios with tags that match this pattern') { |arg| options[:ignore_tag_pattern] = arg }
|
143
143
|
opts.on("--nice", "execute test commands with low priority.") { options[:nice] = true }
|
144
|
+
opts.on("--runtime-log [PATH]", "Location of previously recorded test runtimes") { |path| options[:runtime_log] = path }
|
144
145
|
opts.on("-v", "--version", "Show Version") { puts ParallelTests::VERSION; exit }
|
145
146
|
opts.on("-h", "--help", "Show this.") { puts opts; exit }
|
146
147
|
end.parse!(argv)
|
@@ -46,7 +46,7 @@ module ParallelTests
|
|
46
46
|
elsif options[:group_by] == :filesize
|
47
47
|
with_filesize_info(tests)
|
48
48
|
else
|
49
|
-
with_runtime_info(tests)
|
49
|
+
with_runtime_info(tests, options)
|
50
50
|
end
|
51
51
|
Grouper.in_even_groups_by_size(tests, num_groups, options)
|
52
52
|
end
|
@@ -130,12 +130,13 @@ module ParallelTests
|
|
130
130
|
result
|
131
131
|
end
|
132
132
|
|
133
|
-
def with_runtime_info(tests)
|
134
|
-
|
133
|
+
def with_runtime_info(tests, options = {})
|
134
|
+
log = options[:runtime_log] || runtime_log
|
135
|
+
lines = File.read(log).split("\n") rescue []
|
135
136
|
|
136
137
|
# use recorded test runtime if we got enough data
|
137
138
|
if lines.size * 1.5 > tests.size
|
138
|
-
puts "Using recorded test runtime"
|
139
|
+
puts "Using recorded test runtime: #{log}"
|
139
140
|
times = Hash.new(1)
|
140
141
|
lines.each do |line|
|
141
142
|
test, time = line.split(":")
|
data/spec/spec_helper.rb
CHANGED
@@ -127,6 +127,19 @@ def test_tests_in_groups(klass, folder, suffix)
|
|
127
127
|
groups[1].should == [@files[2],@files[4],@files[6],@files[7]]
|
128
128
|
end
|
129
129
|
|
130
|
+
it 'partitions from custom runtime-data location' do
|
131
|
+
klass.stub!(:puts)
|
132
|
+
@log = 'tmp/custom_runtime.log'
|
133
|
+
setup_runtime_log
|
134
|
+
|
135
|
+
groups = klass.tests_in_groups([test_root], 2, :runtime_log => @log)
|
136
|
+
groups.size.should == 2
|
137
|
+
# 10 + 1 + 3 + 5 = 19
|
138
|
+
groups[0].should == [@files[0],@files[1],@files[3],@files[5]]
|
139
|
+
# 2 + 4 + 6 + 7 = 19
|
140
|
+
groups[1].should == [@files[2],@files[4],@files[6],@files[7]]
|
141
|
+
end
|
142
|
+
|
130
143
|
it "alpha-sorts partitions when runtime-data is available" do
|
131
144
|
klass.stub!(:puts)
|
132
145
|
setup_runtime_log
|
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.1
|
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-
|
11
|
+
date: 2014-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|