access to master's failed files. proper exit status via rake.
This commit is contained in:
parent
fcad8a27cc
commit
d47f53d897
@ -14,6 +14,7 @@ module Hydra #:nodoc:
|
|||||||
include Hydra::Messages::Master
|
include Hydra::Messages::Master
|
||||||
include Open3
|
include Open3
|
||||||
traceable('MASTER')
|
traceable('MASTER')
|
||||||
|
attr_reader :failed_files
|
||||||
|
|
||||||
# Create a new Master
|
# Create a new Master
|
||||||
#
|
#
|
||||||
@ -54,6 +55,7 @@ module Hydra #:nodoc:
|
|||||||
@files = Array(opts.fetch('files') { nil })
|
@files = Array(opts.fetch('files') { nil })
|
||||||
raise "No files, nothing to do" if @files.empty?
|
raise "No files, nothing to do" if @files.empty?
|
||||||
@incomplete_files = @files.dup
|
@incomplete_files = @files.dup
|
||||||
|
@failed_files = []
|
||||||
@workers = []
|
@workers = []
|
||||||
@listeners = []
|
@listeners = []
|
||||||
@event_listeners = Array(opts.fetch('listeners') { nil } )
|
@event_listeners = Array(opts.fetch('listeners') { nil } )
|
||||||
@ -116,6 +118,9 @@ module Hydra #:nodoc:
|
|||||||
@incomplete_files.delete_at(@incomplete_files.index(message.file))
|
@incomplete_files.delete_at(@incomplete_files.index(message.file))
|
||||||
trace "#{@incomplete_files.size} Files Remaining"
|
trace "#{@incomplete_files.size} Files Remaining"
|
||||||
@event_listeners.each{|l| l.file_end(message.file, message.output) }
|
@event_listeners.each{|l| l.file_end(message.file, message.output) }
|
||||||
|
unless message.output == '.'
|
||||||
|
@failed_files << message.file
|
||||||
|
end
|
||||||
if @incomplete_files.empty?
|
if @incomplete_files.empty?
|
||||||
@workers.each do |worker|
|
@workers.each do |worker|
|
||||||
@event_listeners.each{|l| l.worker_end(worker) }
|
@event_listeners.each{|l| l.worker_end(worker) }
|
||||||
|
@ -109,7 +109,10 @@ module Hydra #:nodoc:
|
|||||||
$stderr.puts %{WARNING: RAILS_ENV is "development". Make sure to set it properly (ex: "RAILS_ENV=test rake hydra")}
|
$stderr.puts %{WARNING: RAILS_ENV is "development". Make sure to set it properly (ex: "RAILS_ENV=test rake hydra")}
|
||||||
end
|
end
|
||||||
|
|
||||||
Hydra::Master.new(@opts)
|
master = Hydra::Master.new(@opts)
|
||||||
|
unless master.failed_files.empty?
|
||||||
|
raise "Hydra: Not all tests passes"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user