Skip to content

Commit

Permalink
Add new feature that limits option of groonga.
Browse files Browse the repository at this point in the history
  • Loading branch information
komainu8 committed Apr 11, 2017
1 parent 3d942fb commit e19c1cb
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions lib/groonga/query-log/command/run-regression-test.rb
Expand Up @@ -177,16 +177,37 @@ 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,
@old_groonga_options,
groonga_options(@old_groonga_options),
@old_database,
server_options)
end

def new_groonga_server
GroongaServer.new(@new_groonga,
@new_groonga_options,
groonga_options(@new_groonga_options),
@new_database,
server_options)
end
Expand All @@ -213,11 +234,9 @@ def run
"--protocol", "http",
"--log-path", log_path.to_s,
]

@groonga_options.each{|groonga_option|
arguments << groonga_option
@groonga_options.each{|name, value|
arguments.concat([name, value])
}

if @options[:output_query_log]
arguments.concat(["--query-log-path", query_log_path.to_s])
end
Expand Down

0 comments on commit e19c1cb

Please sign in to comment.