mirror of
https://github.com/inspec/inspec
synced 2024-11-26 06:30:26 +00:00
CHEF-3806 Fix for InSpec Parallel hangs for cetain CIS profile on Windows. (#71)
Sending EOF Marker at the end of of the whole suit run here instead of depending on the controls count Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com> Co-authored-by: Vasu1105 <vasundhara.jagdale@progress.com>
This commit is contained in:
parent
28031ae7ff
commit
b9bc201ced
1 changed files with 6 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
|||
module InspecPlugins::Parallelism
|
||||
class StreamingReporter < Inspec.plugin(2, :streaming_reporter)
|
||||
# Registering these methods with RSpec::Core::Formatters class is mandatory
|
||||
RSpec::Core::Formatters.register self, :example_passed, :example_failed, :example_pending
|
||||
RSpec::Core::Formatters.register self, :example_passed, :example_failed, :example_pending, :close
|
||||
|
||||
def initialize(output)
|
||||
@status_mapping = {}
|
||||
|
@ -21,6 +21,11 @@ module InspecPlugins::Parallelism
|
|||
set_example(notification, "skipped")
|
||||
end
|
||||
|
||||
def close(notification)
|
||||
# HACK: if we've reached the end of the execution, send a special marker, to ease EOF detection on Windows
|
||||
puts "EOF_MARKER"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_example(notification, status)
|
||||
|
@ -46,10 +51,6 @@ module InspecPlugins::Parallelism
|
|||
display_name = control_id.to_s.lstrip.force_encoding(Encoding::UTF_8) unless title
|
||||
|
||||
puts "#{@control_counter}/#{stat}/#{controls_count}/#{display_name}"
|
||||
# HACK: if we've reached the end of the execution, send a special marker, to ease EOF detection on Windows
|
||||
if @control_counter == controls_count
|
||||
puts "EOF_MARKER"
|
||||
end
|
||||
end
|
||||
|
||||
def set_status_mapping(control_id, status)
|
||||
|
|
Loading…
Reference in a new issue