prspec 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/prspec.rb +17 -7
  3. metadata +13 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YWE4YTYyMjc3YmY1MjM2NWQzM2E0OWFkZGM1YzJlMjY0NzI1NDViYw==
4
+ ZDczNzkyZDA0ZTBjZjRlYjNmNjg2YTRjYTlhMWVkYTc0ZDk2N2QwNw==
5
5
  data.tar.gz: !binary |-
6
- N2Y3ZmRjOTg2OTNjYTJmYmQ4NjA5ZjdkZjZjMmUxMDgzMmI1ZWI4ZQ==
6
+ OTE0MDExMGIzZGNmNzg3NDZmZDI3OTdiNDg1MzMwMzkxYTcwNDNiOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YTcxOGEyYmM2NWFjMWQwNjdiZmZmOGI4NDFhYTIwODQ3MGM4MzE2MGViM2U2
10
- N2EyNGY2NGM4MTRiYzc0ZWMxZmY2NTI0ZWFmNGU0ZmI5M2IwOTA1YjQyYTIz
11
- M2U4MDI2ZTEwODhjZTVkZGEzYzBmZWRkZjc5NDQ0MGFmYTQ3Yzg=
9
+ ZTcwNmJiN2UyY2FkNjBlODcxNTk2MTdhODk2MjhlZjIyZDc0MmE2MTlhYjMy
10
+ OWIwYmZmYTNjZTBkZjI5NjdhYWM1ZDc1YmM2ZmQ4ZWY2YjQzNDE2YTgzMDgy
11
+ ODJlZDQ3ZmY3ZTI5MmU1Nzg5NzQwMjM0Yjk3ZGY0OTFmY2MyZjI=
12
12
  data.tar.gz: !binary |-
13
- MWQ0ZDc0NTgyMzU1YTUzYTQwMWI0ZGJkMmY0NjJjNmI1MWI5MmQ5Zjg0NmQ2
14
- Yjc1M2NjMzRkMTUyYjQzZThhNmEyM2U1MGM4NGI0ODBlNjQwMzk1NDljNjM5
15
- ZTUyMjFhZjZkZWQ0MWI5ZmIyNmMwODE2MDhjNWQwOTU4NTg3Mjk=
13
+ YmIxOWNjNDNiMjc2MTM0M2QzNGE4ODE5NmVjYTc0N2FlMGQyMTIyN2YxYTE0
14
+ ZDAwNTUzMzNlZGVkNmFmMWVjNDdmZDQxMmU2NTYwMmVhZjgxNmIwMTVmMzkw
15
+ NTk5ZGViM2RhOTYxNGQ1NWIxNzI1YTQ5MTU3YzI2MTQwYzBkODc=
data/lib/prspec.rb CHANGED
@@ -43,7 +43,7 @@ class PRSpec
43
43
  process_tests = divide_spec_tests(tests)
44
44
  $log.debug "#{tests.length} Spec tests divided among #{@num_threads} arrays."
45
45
  else
46
- $log.error "No spec tests found. Exiting."
46
+ $log.warn "No spec tests found. Exiting."
47
47
  exit 1
48
48
  end
49
49
 
@@ -69,7 +69,8 @@ class PRSpec
69
69
  :rspec_args=>[],
70
70
  :tag_name=>'',
71
71
  :tag_value=>'',
72
- :ignore_pending=>false
72
+ :ignore_pending=>false,
73
+ :serialize=>false
73
74
  }
74
75
  o = OptionParser.new do |opts|
75
76
  opts.banner = "Usage: prspec [options]"
@@ -122,6 +123,10 @@ class PRSpec
122
123
  $log.debug "ignore pending specified... all pending tests will be excluded"
123
124
  options[:ignore_pending] = true
124
125
  end
126
+ opts.on("-s", "--serialize-output", "Wait for each thread to complete and then output to STDOUT serially") do
127
+ $log.debug "serialize output specified... all threads will output to STDOUT as they complete"
128
+ options[:serialize] = true
129
+ end
125
130
  end
126
131
 
127
132
  # handle invalid options
@@ -260,6 +265,9 @@ class PRSpec
260
265
  $log.debug "Thread#{proc.id}: alive..."
261
266
  else
262
267
  $log.debug "Thread#{proc.id}: done."
268
+ if (options[:serialize])
269
+ puts proc.output unless options[:quiet_mode]
270
+ end
263
271
  # collect thread output if in quiet mode
264
272
  if (options[:quiet_mode])
265
273
  @output << proc.output
@@ -332,16 +340,18 @@ class PRSpecThread
332
340
  Dir::chdir @args[:dir] do # change directory for process execution
333
341
  begin
334
342
  pid = nil
335
- if (@args[:quiet_mode])
336
- pid = Process.spawn(cmd, :out=>@out, :err=>@err) # capture both sdtout and stderr in the same pipe
343
+ if (@args[:quiet_mode] || @args[:serialize])
344
+ pid = Process.spawn(cmd, :out=>@out, :err=>@err) # capture both sdtout and stderr
337
345
  else
338
346
  pid = Process.spawn(cmd)
339
347
  end
340
348
  Process.wait(pid)
341
- @output = File.readlines(@out).join("\n") if @args[:quiet_mode]
349
+ @output = File.readlines(@out).join("\n") if (@args[:quiet_mode] || @args[:serialize])
342
350
  rescue
343
- error = "ErrorCode: #{$?.errorcode}; ErrorOutput: "+File.readlines(@err).join("\n") if @args[:quiet_mode]
344
- $log.error "Something bad happened while executing thread#{@id}: #{error}" if @args[:quiet_mode]
351
+ if (@args[:quiet_mode] || @args[:serialize])
352
+ error = "ErrorCode: #{$?.errorcode}; ErrorOutput: "+File.readlines(@err).join("\n")
353
+ $log.error "Something bad happened while executing thread#{@id}: #{error}"
354
+ end
345
355
  end
346
356
  close
347
357
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Holt Smith
@@ -14,6 +14,9 @@ dependencies:
14
14
  name: log4r
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.1'
17
20
  - - ! '>='
18
21
  - !ruby/object:Gem::Version
19
22
  version: 1.1.10
@@ -21,6 +24,9 @@ dependencies:
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '1.1'
24
30
  - - ! '>='
25
31
  - !ruby/object:Gem::Version
26
32
  version: 1.1.10
@@ -28,6 +34,9 @@ dependencies:
28
34
  name: parallel
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
37
+ - - ~>
38
+ - !ruby/object:Gem::Version
39
+ version: '1.0'
31
40
  - - ! '>='
32
41
  - !ruby/object:Gem::Version
33
42
  version: 1.0.0
@@ -35,6 +44,9 @@ dependencies:
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
47
+ - - ~>
48
+ - !ruby/object:Gem::Version
49
+ version: '1.0'
38
50
  - - ! '>='
39
51
  - !ruby/object:Gem::Version
40
52
  version: 1.0.0