[Groonga-commit] droonga/drntest at d9c90e4 [master] Migrate to droonga-engine from fluent-plugin-droonga

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Apr 17 18:47:44 JST 2014


Kouhei Sutou	2014-04-17 18:47:44 +0900 (Thu, 17 Apr 2014)

  New Revision: d9c90e45fa13e5d00f462300d86249f9ff1b4839
  https://github.com/droonga/drntest/commit/d9c90e45fa13e5d00f462300d86249f9ff1b4839

  Message:
    Migrate to droonga-engine from fluent-plugin-droonga

  Modified files:
    lib/drntest/configuration.rb
    lib/drntest/engine.rb
    lib/drntest/tester.rb

  Modified: lib/drntest/configuration.rb (+3 -3)
===================================================================
--- lib/drntest/configuration.rb    2014-04-17 18:45:42 +0900 (449dd94)
+++ lib/drntest/configuration.rb    2014-04-17 18:47:44 +0900 (f0fc366)
@@ -17,7 +17,7 @@ module Drntest
   class Configuration
     attr_accessor :port, :host, :tag
     attr_accessor :base_path, :engine_config
-    attr_accessor :fluentd, :fluentd_options
+    attr_accessor :droonga_engine, :droonga_engine_options
     attr_accessor :catalog_version
 
     def initialize
@@ -26,8 +26,8 @@ module Drntest
       @tag             = "droonga"
       @base_path       = Pathname(Dir.pwd)
       @engine_config   = "default"
-      @fluentd         = "fluentd"
-      @fluentd_options = []
+      @droonga_engine  = "droonga-engine"
+      @droonga_engine_options = []
       @catalog_version = "2"
     end
 

  Modified: lib/drntest/engine.rb (+5 -18)
===================================================================
--- lib/drntest/engine.rb    2014-04-17 18:45:42 +0900 (0c69a95)
+++ lib/drntest/engine.rb    2014-04-17 18:47:44 +0900 (c5d1f0d)
@@ -32,10 +32,6 @@ module Drntest
       teardown
     end
 
-    def config_file
-      @config.engine_config_path + "fluentd.conf"
-    end
-
     def catalog_file
       @config.engine_config_path + "catalog.json"
     end
@@ -101,13 +97,8 @@ module Drntest
     end
 
     def setup(target_path)
-      return unless temporary?
-
       setup_temporary_dir
 
-      temporary_config = temporary_dir + "fluentd.conf"
-      FileUtils.cp(config_file, temporary_config)
-
       catalog_json = load_catalog_json(target_path)
       temporary_catalog = temporary_dir + "catalog.json"
       temporary_catalog.open("w") do |output|
@@ -115,9 +106,11 @@ module Drntest
       end
 
       command = [
-        @config.fluentd,
-        "--config", temporary_config.to_s,
-        *@config.fluentd_options,
+        @config.droonga_engine,
+        "--host", @config.host,
+        "--port", @config.port.to_s,
+        "--tag", @config.tag,
+        *@config.droonga_engine_options,
       ]
       env = {
         "DROONGA_CATALOG" => temporary_catalog.to_s,
@@ -134,8 +127,6 @@ module Drntest
     end
 
     def teardown
-      return unless temporary?
-
       Process.kill(:TERM, @pid)
       Process.wait(@pid)
 
@@ -164,10 +155,6 @@ module Drntest
       temporary_base_dir + "drntest"
     end
 
-    def temporary?
-      @config.fluentd && config_file.exist?
-    end
-
     def ready?
       begin
         socket = TCPSocket.new(@config.host, @config.port)

  Modified: lib/drntest/tester.rb (+7 -7)
===================================================================
--- lib/drntest/tester.rb    2014-04-17 18:45:42 +0900 (c89bf3b)
+++ lib/drntest/tester.rb    2014-04-17 18:47:44 +0900 (6e1a107)
@@ -95,16 +95,16 @@ module Drntest
         @config.engine_config = config
       end
 
-      parser.on("--fluentd=PATH",
-                "Path to the fluentd executable",
-                "(#{@config.fluentd})") do |fluentd|
-        @config.fluentd = fluentd
+      parser.on("--droonga-engine=PATH",
+                "Path to the droonga-engine executable",
+                "(#{@config.droonga_engine})") do |droonga_engine|
+        @config.droonga_engine = droonga_engine
       end
 
-      parser.on("--fluentd-options=OPTIONS",
-                "Options for fluentd",
+      parser.on("--droonga-engine-options=OPTIONS",
+                "Options for droonga-engine",
                 "You can specify this option multiple times") do |options|
-        @config.fluentd_options.concat(Shellwords.split(options))
+        @config.droonga_engine_options.concat(Shellwords.split(options))
       end
 
       parser.on("--test=PATTERN",
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index