lib/grntest/tester.rb in grntest-1.3.5 vs lib/grntest/tester.rb in grntest-1.3.6
- old
+ new
@@ -1,6 +1,6 @@
-# Copyright (C) 2012-2019 Kouhei Sutou <kou@clear-code.com>
+# Copyright (C) 2012-2020 Sutou Kouhei <kou@clear-code.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@@ -54,11 +54,11 @@
"Use COMMAND as groonga_suggest_create_dataset command",
"(#{tester.groonga_suggest_create_dataset})") do |command|
tester.groonga_suggest_create_dataset = normalize_command(command)
end
- available_interfaces = [:stdio, :http]
+ available_interfaces = ["stdio", "http"]
available_interface_labels = available_interfaces.join(", ")
parser.on("--interface=INTERFACE", available_interfaces,
"Use INTERFACE for communicating Groonga",
"[#{available_interface_labels}]",
"(#{tester.interface})") do |interface|
@@ -69,20 +69,26 @@
"Use POST to send command by HTTP",
"(#{tester.use_http_post?})") do |boolean|
tester.use_http_post = boolean
end
+ parser.on("--[no-]use-http-chunked",
+ "Use chunked Transfer-Encoding to send body by HTTP",
+ "(#{tester.use_http_chunked?})") do |boolean|
+ tester.use_http_chunked = boolean
+ end
+
available_input_types = ["json", "apache-arrow"]
available_input_type_labels = available_input_types.join(", ")
parser.on("--input-type=TYPE", available_input_types,
"Use TYPE as the input type on load",
"[#{available_input_type_labels}]",
"(#{tester.input_type})") do |type|
tester.input_type = type
end
- available_output_types = ["json", "msgpack"]
+ available_output_types = ["json", "msgpack", "apache-arrow"]
available_output_type_labels = available_output_types.join(", ")
parser.on("--output-type=TYPE", available_output_types,
"Use TYPE as the output type",
"[#{available_output_type_labels}]",
"(#{tester.output_type})") do |type|
@@ -95,11 +101,11 @@
"Test against TESTEE",
"[#{available_testee_labels}]",
"(#{tester.testee})") do |testee|
tester.testee = testee
if tester.testee == "groonga-httpd"
- tester.interface = :http
+ tester.interface = "http"
end
end
parser.on("--base-directory=DIRECTORY",
"Use DIRECTORY as a base directory of relative path",
@@ -292,10 +298,11 @@
end
attr_accessor :groonga, :groonga_httpd, :groonga_suggest_create_dataset
attr_accessor :interface
attr_writer :use_http_post
+ attr_writer :use_http_chunked
attr_accessor :input_type
attr_accessor :output_type
attr_accessor :testee
attr_accessor :base_directory, :database_path, :diff, :diff_options
attr_accessor :n_workers
@@ -319,12 +326,13 @@
@groonga_httpd = "groonga-httpd"
@groonga_suggest_create_dataset = "groonga-suggest-create-dataset"
unless command_exist?(@groonga_suggest_create_dataset)
@groonga_suggest_create_dataset = nil
end
- @interface = :stdio
+ @interface = "stdio"
@use_http_post = false
+ @use_http_chunked = false
@input_type = "json"
@output_type = "json"
@testee = "groonga"
@base_directory = Pathname(".")
@database_path = nil
@@ -370,9 +378,13 @@
end
end
def use_http_post?
@use_http_post
+ end
+
+ def use_http_chunked?
+ @use_http_chunked
end
def keep_database?
@keep_database
end