Navigation Menu

Skip to content

Commit

Permalink
verify-server: return true on success
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 13, 2018
1 parent cf25872 commit 502968e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/groonga-query-log/command/verify-server.rb
Expand Up @@ -27,17 +27,20 @@ def initialize

def run(command_line, &callback)
input_paths = create_parser.parse(command_line)
same = true
verifier = ServerVerifier.new(@options)
if input_paths.empty?
verifier.verify($stdin, &callback)
same = verifier.verify($stdin, &callback)
else
input_paths.each do |input_path|
File.open(input_path) do |input|
verifier.verify(input, &callback)
unless verifier.verify(input, &callback)
same = false
end
end
end
end
true
same
end

private
Expand Down
3 changes: 3 additions & 0 deletions lib/groonga-query-log/server-verifier.rb
Expand Up @@ -31,11 +31,13 @@ def initialize(options)
end

def verify(input, &callback)
@same = true
producer = run_producer(input, &callback)
reporter = run_reporter
producer.join
@different_results.push(nil)
reporter.join
@same
end

private
Expand Down Expand Up @@ -145,6 +147,7 @@ def verify_command(groonga1_client, groonga2_client, command)
end

def report_result(output, result)
@same = false
command, response1, response2 = result
command_source = command.original_source || command.to_uri_format
output.puts("command: #{command_source}")
Expand Down

0 comments on commit 502968e

Please sign in to comment.