Navigation Menu

Skip to content

Commit

Permalink
Fix description of new options.
Browse files Browse the repository at this point in the history
Delete feature that limits groonga's option.
  • Loading branch information
komainu8 committed Apr 12, 2017
1 parent e19c1cb commit 7872796
Showing 1 changed file with 16 additions and 42 deletions.
58 changes: 16 additions & 42 deletions lib/groonga/query-log/command/run-regression-test.rb
Expand Up @@ -97,11 +97,10 @@ def create_option_parser
@old_groonga = groonga
end

parser.separator("")
parser.separator("Old Groonga Option:")
parser.on("--old-groonga-option=GROONGA_OPTION",
"Old groonga option",
"(#{@old_groonga_options})") do |groonga_option|
parser.on("--old-groonga-option=OPTION",
"Add an additional old groonga option",
"You can specify this option multiple times to specify multiple groonga options",
"(no options)") do |groonga_option|
@old_groonga_options << groonga_option
end

Expand All @@ -113,11 +112,10 @@ def create_option_parser
@new_groonga = groonga
end

parser.separator("")
parser.separator("New Groonga Option:")
parser.on("--new-groonga-option=GROONGA_OPTION",
"New groonga option",
"(#{@new_groonga_options})") do |groonga_option|
parser.on("--new-groonga-option=OPTION",
"Add an additional new groonga option",
"You can specify this option multiple times to specify multiple groonga options",
"(no options)") do |groonga_option|
@new_groonga_options << groonga_option
end

Expand Down Expand Up @@ -177,37 +175,16 @@ def tester_options
directory_options.merge(options)
end

def groonga_options(options)
groonga_options = Hash[*options]

filter = %w[
--server-id
--document-root
--cache-limit
--max-threads
--default-request-timeout
--memcached-column
--cache-base-path
--log-level
--log-rotate-threshold
--query-log-rotate-threshold
--config-path
--default-command-version
--default-match-escalation-threshold
]
groonga_options.keep_if{|k,v| filter.include?(k)}
end

def old_groonga_server
GroongaServer.new(@old_groonga,
groonga_options(@old_groonga_options),
@old_groonga_options,
@old_database,
server_options)
end

def new_groonga_server
GroongaServer.new(@new_groonga,
groonga_options(@new_groonga_options),
@new_groonga_options,
@new_database,
server_options)
end
Expand All @@ -228,15 +205,12 @@ def initialize(groonga, groonga_options, database_path, options)
def run
return unless @options[:run_queries]

arguments = [
"--bind-address", @host,
"--port", @port.to_s,
"--protocol", "http",
"--log-path", log_path.to_s,
]
@groonga_options.each{|name, value|
arguments.concat([name, value])
}
arguments = @groonga_options.dup

arguments.concat(["--bind-address", @host])
arguments.concat(["--port", @port.to_s])
arguments.concat(["--protocol", "http"])
arguments.concat(["--log-path", log_path.to_s])
if @options[:output_query_log]
arguments.concat(["--query-log-path", query_log_path.to_s])
end
Expand Down

0 comments on commit 7872796

Please sign in to comment.