parallel_tests 0.8.5 → 0.8.6

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.8.5)
4
+ parallel_tests (0.8.6)
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.16)
21
+ parallel (0.5.17)
22
22
  rake (0.8.7)
23
23
  rspec (2.6.0)
24
24
  rspec-core (~> 2.6.0)
data/Readme.md CHANGED
@@ -132,7 +132,6 @@ Options are:
132
132
  -o, --test-options '[OPTIONS]' execute test commands with those options
133
133
  -t, --type [TYPE] test(default) / rspec / cucumber
134
134
  --non-parallel execute same commands but do not in parallel, needs --exec
135
- --chunk-timeout [TIMEOUT] timeout before re-printing the output of a child-process
136
135
  --no-symlinks Do not traverse symbolic links to find test files
137
136
  -v, --version Show Version
138
137
  -h, --help Show this.
@@ -97,7 +97,6 @@ TEXT
97
97
  opts.on("-o", "--test-options '[OPTIONS]'", "execute test commands with those options") { |arg| options[:test_options] = arg }
98
98
  opts.on("-t", "--type [TYPE]", "test(default) / rspec / cucumber") { |type| options[:type] = type }
99
99
  opts.on("--non-parallel", "execute same commands but do not in parallel, needs --exec") { options[:non_parallel] = true }
100
- opts.on("--chunk-timeout [TIMEOUT]", "timeout before re-printing the output of a child-process") { |timeout| options[:chunk_timeout] = timeout.to_f }
101
100
  opts.on("--no-symlinks", "Do not traverse symbolic links to find test files") { options[:symlinks] = false }
102
101
  opts.on("-v", "--version", "Show Version") { puts ParallelTests::VERSION; exit }
103
102
  opts.on("-h", "--help", "Show this.") { puts opts; exit }
@@ -42,7 +42,7 @@ module ParallelTests
42
42
  def self.execute_command(cmd, process_number, options)
43
43
  cmd = "TEST_ENV_NUMBER=#{test_env_number(process_number)} ; export TEST_ENV_NUMBER; #{cmd}"
44
44
  f = open("|#{cmd}", 'r')
45
- output = fetch_output(f, options)
45
+ output = fetch_output(f)
46
46
  f.close
47
47
  {:stdout => output, :exit_status => $?.exitstatus}
48
48
  end
@@ -77,31 +77,13 @@ module ParallelTests
77
77
  end
78
78
 
79
79
  # read output of the process and print in in chucks
80
- def self.fetch_output(process, options)
80
+ def self.fetch_output(process)
81
81
  all = ''
82
- buffer = ''
83
- timeout = options[:chunk_timeout] || 0.2
84
- flushed = Time.now.to_f
85
-
86
- while char = process.getc
87
- char = (char.is_a?(Fixnum) ? char.chr : char) # 1.8 <-> 1.9
88
- all << char
89
-
90
- # print in chunks so large blocks stay together
91
- now = Time.now.to_f
92
- buffer << char
93
- if flushed + timeout < now
94
- $stdout.print buffer
95
- $stdout.flush
96
- buffer = ''
97
- flushed = now
98
- end
99
- end
100
-
101
- # print the remainder
102
- $stdout.print buffer
103
- $stdout.flush
104
-
82
+ while buffer = process.readpartial(1000000)
83
+ all << buffer
84
+ $stdout.print buffer
85
+ $stdout.flush
86
+ end rescue EOFError
105
87
  all
106
88
  end
107
89
 
@@ -1,3 +1,3 @@
1
1
  module ParallelTests
2
- VERSION = Version = '0.8.5'
2
+ VERSION = Version = '0.8.6'
3
3
  end
@@ -39,7 +39,7 @@ describe 'CLI' do
39
39
  def run_tests(test_folder, options={})
40
40
  ensure_folder folder
41
41
  processes = "-n #{options[:processes]||2}" unless options[:processes] == false
42
- command = "cd #{folder} && #{options[:export]} #{executable(options)} #{test_folder} --chunk-timeout 999 #{processes} #{options[:add]} 2>&1"
42
+ command = "cd #{folder} && #{options[:export]} #{executable(options)} #{test_folder} #{processes} #{options[:add]} 2>&1"
43
43
  result = `#{command}`
44
44
  raise "FAILED #{command}\n#{result}" if $?.success? == !!options[:fail]
45
45
  result
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.8.5
4
+ version: 0.8.6
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: 2012-07-19 00:00:00.000000000 Z
12
+ date: 2012-07-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: parallel
@@ -90,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
90
90
  version: '0'
91
91
  segments:
92
92
  - 0
93
- hash: -2098378474977036135
93
+ hash: -3705474874621268177
94
94
  required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  version: '0'
100
100
  segments:
101
101
  - 0
102
- hash: -2098378474977036135
102
+ hash: -3705474874621268177
103
103
  requirements: []
104
104
  rubyforge_project:
105
105
  rubygems_version: 1.8.24