parallel_tests 0.11.2 → 0.11.3

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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- parallel_tests (0.11.2)
4
+ parallel_tests (0.11.3)
5
5
  parallel
6
6
 
7
7
  GEM
data/Readme.md CHANGED
@@ -188,6 +188,7 @@ Options are:
188
188
  --non-parallel execute same commands but do not in parallel, needs --exec
189
189
  --no-symlinks Do not traverse symbolic links to find test files
190
190
  --ignore-tags [PATTERN] When counting steps ignore scenarios with tags that match this pattern
191
+ --nice execute test commands with low priority.
191
192
  -v, --version Show Version
192
193
  -h, --help Show this.
193
194
 
@@ -282,6 +283,8 @@ inspired by [pivotal labs](http://pivotallabs.com/users/miked/blog/articles/849-
282
283
  - [Aaron Jensen](https://github.com/aaronjensen)
283
284
  - [Artur Roszczyk](https://github.com/sevos)
284
285
  - [Caleb Tomlinson](https://github.com/calebTomlinson)
286
+ - [Jawwad Ahmad](https://github.com/jawwad)
287
+ - [Iain Beeston](https://github.com/iainbeeston)
285
288
 
286
289
  [Michael Grosser](http://grosser.it)<br/>
287
290
  michael@grosser.it<br/>
@@ -128,6 +128,7 @@ TEXT
128
128
  opts.on("--non-parallel", "execute same commands but do not in parallel, needs --exec") { options[:non_parallel] = true }
129
129
  opts.on("--no-symlinks", "Do not traverse symbolic links to find test files") { options[:symlinks] = false }
130
130
  opts.on('--ignore-tags [PATTERN]', 'When counting steps ignore scenarios with tags that match this pattern') { |arg| options[:ignore_tag_pattern] = arg }
131
+ opts.on("--nice", "execute test commands with low priority.") { options[:nice] = true }
131
132
  opts.on("-v", "--version", "Show Version") { puts ParallelTests::VERSION; exit }
132
133
  opts.on("-h", "--help", "Show this.") { puts opts; exit }
133
134
  end.parse!(argv)
@@ -52,6 +52,7 @@ module ParallelTests
52
52
  "TEST_ENV_NUMBER" => test_env_number(process_number),
53
53
  "PARALLEL_TEST_GROUPS" => num_processes
54
54
  )
55
+ cmd = "nice #{cmd}" if options[:nice]
55
56
  execute_command_and_capture_output(env, cmd, options[:serialize_stdout])
56
57
  end
57
58
 
@@ -1,3 +1,3 @@
1
1
  module ParallelTests
2
- VERSION = Version = '0.11.2'
2
+ VERSION = Version = '0.11.3'
3
3
  end
@@ -29,6 +29,10 @@ describe ParallelTests::CLI do
29
29
  call(["--type", "test", "-t", "rspec"])
30
30
  subject.instance_variable_get(:@runner).should == ParallelTests::RSpec::Runner
31
31
  end
32
+
33
+ it "parses nice as nice" do
34
+ call(["--nice"]).should == defaults.merge(:nice => true)
35
+ end
32
36
  end
33
37
 
34
38
  describe "#load_runner" do
@@ -25,6 +25,11 @@ describe ParallelTests::RSpec::Runner do
25
25
  ParallelTests::Test::Runner.should_receive(:execute_command).with{|a,b,c,d| a !~ regex}
26
26
  end
27
27
 
28
+ it "runs command using nice when specifed" do
29
+ ParallelTests::Test::Runner.should_receive(:execute_command_and_capture_output).with{|a,b,c| b =~ %r{^nice rspec}}
30
+ call('xxx', 1, 22, :nice => true)
31
+ end
32
+
28
33
  it "runs with color when called from cmdline" do
29
34
  should_run_with %r{ --tty}
30
35
  $stdout.should_receive(:tty?).and_return true
@@ -419,5 +419,12 @@ EOF
419
419
  err.should == "345\n"
420
420
  end
421
421
  end
422
+
423
+ it "uses a lower priority process when the nice option is used" do
424
+ priority_cmd = "puts Process.getpriority(Process::PRIO_PROCESS, 0)"
425
+ priority_without_nice = run_with_file(priority_cmd){ |cmd| call("ruby #{cmd}", 1, 4, {}) }.first.to_i
426
+ priority_with_nice = run_with_file(priority_cmd){ |cmd| call("ruby #{cmd}", 1, 4, :nice => true) }.first.to_i
427
+ priority_without_nice.should < priority_with_nice
428
+ end
422
429
  end
423
430
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parallel_tests
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.2
4
+ version: 0.11.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-26 00:00:00.000000000 Z
12
+ date: 2013-04-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: parallel
@@ -96,7 +96,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
96
96
  version: '0'
97
97
  segments:
98
98
  - 0
99
- hash: 2511710589731106807
99
+ hash: -466527625892660787
100
100
  required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  none: false
102
102
  requirements:
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  segments:
107
107
  - 0
108
- hash: 2511710589731106807
108
+ hash: -466527625892660787
109
109
  requirements: []
110
110
  rubyforge_project:
111
111
  rubygems_version: 1.8.25