parallel_tests 1.0.0 → 1.0.1

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: d87fe66d8f59d1f365394d2e81e038638220c891
4
- data.tar.gz: ffbb3e8e45357f998107b623cad4b3f25b6e859f
3
+ metadata.gz: 2252b172b8d651430e068691a993c60b1188ef0a
4
+ data.tar.gz: ff9bd5e5af97914fb962db515fd3c6642daa41f9
5
5
  SHA512:
6
- metadata.gz: 792175a098da834f91641fdbdb2898c6d6944703fe7ca12ee4e6b103b948582c4d24aac09ad4e45981e8dbeedcb30012d365667e0c9691016b601bbcb9756e80
7
- data.tar.gz: c3d9d360e4adf512a569ae390faae2bec9dfabe4e8ffd45e46c7f05e882a5afbd6dfac18579b85a701368085234d0035ca0b7a9d55776f59c44819ae114ff711
6
+ metadata.gz: 4d075271ae5adb025703922d85991a8f197c8eab126a4836143b30752c5138d6b967841d53500258a699742aef2c7896cdf39d03c1014307c447016147afb186
7
+ data.tar.gz: ce7fe0057aac13ce7a785521ac0a8f1695cb7ed5edaf11d04521a7399ff487ce90b40ddf7edf3e1bc2c8203d0b6b7aa73d17d4bd55845ce62a3566af13b09e06
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- parallel_tests (1.0.0)
4
+ parallel_tests (1.0.1)
5
5
  parallel
6
6
 
7
7
  GEM
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/>
@@ -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
- lines = File.read(runtime_log).split("\n") rescue []
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(":")
@@ -1,3 +1,3 @@
1
1
  module ParallelTests
2
- VERSION = Version = '1.0.0'
2
+ VERSION = Version = '1.0.1'
3
3
  end
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.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-06-07 00:00:00.000000000 Z
11
+ date: 2014-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel