Navigation Menu

Skip to content

Commit

Permalink
run-regression-test: add --stop-on-failure option
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 18, 2018
1 parent bf9786c commit 012e220
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/groonga-query-log/command/run-regression-test.rb
Expand Up @@ -46,6 +46,7 @@ def initialize
@output_query_log = false
@care_order = true
@ignored_drilldown_keys = []
@stop_on_failure = false
end

def run(command_line)
Expand Down Expand Up @@ -151,6 +152,11 @@ def create_option_parser
"specifying this option multiple times") do |key|
@ignored_drilldown_keys << key
end
parser.on("--[no-]stop-on-failure",
"Stop execution on the first failure",
"(#{@stop_on_failure})") do |boolean|
@stop_on_failure = boolean
end

parser
end
Expand Down Expand Up @@ -178,6 +184,7 @@ def tester_options
:care_order => @care_order,
:skip_finished_queries => @skip_finished_queries,
:ignored_drilldown_keys => @ignored_drilldown_keys,
:stop_on_failure => @stop_on_failure,
}
directory_options.merge(options)
end
Expand Down Expand Up @@ -331,6 +338,7 @@ def initialize(old, new, options)
@input_directory = options[:input_directory] || Pathname.new(".")
@working_directory = options[:working_directory] || Pathname.new(".")
@n_clients = options[:n_clients] || 1
@stop_on_failure = options[:stop_on_failure]
@options = options
@n_ready_waits = 2
end
Expand Down Expand Up @@ -387,6 +395,7 @@ def run_test
end
unless verify_server(log_path, query_log_path, &callback)
same = false
break if @stop_on_failure
end
rescue Interrupt
puts("Interrupt: #{query_log_path}")
Expand Down Expand Up @@ -424,6 +433,9 @@ def verify_server(test_log_path, query_log_path, &callback)
if use_persistent_cache?
command_line << "--verify-cache"
end
if @stop_on_failure
command_line << "--stop-on-failure"
end
verify_server = VerifyServer.new
verify_server.run(command_line, &callback)
end
Expand Down

0 comments on commit 012e220

Please sign in to comment.