[Groonga-commit] droonga/drntest at 30d5db5 [master] Add --timeout option to work on slow environment such as Travis CI

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Apr 30 16:01:27 JST 2014


Kouhei Sutou	2014-04-30 16:01:27 +0900 (Wed, 30 Apr 2014)

  New Revision: 30d5db5550444f20e0963d1da1c9ff7656ced38c
  https://github.com/droonga/drntest/commit/30d5db5550444f20e0963d1da1c9ff7656ced38c

  Message:
    Add --timeout option to work on slow environment such as Travis CI

  Modified files:
    lib/drntest/configuration.rb
    lib/drntest/engine.rb
    lib/drntest/test-executor.rb
    lib/drntest/tester.rb

  Modified: lib/drntest/configuration.rb (+2 -0)
===================================================================
--- lib/drntest/configuration.rb    2014-04-29 00:54:35 +0900 (f0fc366)
+++ lib/drntest/configuration.rb    2014-04-30 16:01:27 +0900 (8070569)
@@ -19,6 +19,7 @@ module Drntest
     attr_accessor :base_path, :engine_config
     attr_accessor :droonga_engine, :droonga_engine_options
     attr_accessor :catalog_version
+    attr_accessor :timeout
 
     def initialize
       @port            = 24224
@@ -29,6 +30,7 @@ module Drntest
       @droonga_engine  = "droonga-engine"
       @droonga_engine_options = []
       @catalog_version = "2"
+      @timeout         = 1
     end
 
     def suite_path

  Modified: lib/drntest/engine.rb (+1 -1)
===================================================================
--- lib/drntest/engine.rb    2014-04-29 00:54:35 +0900 (c5d1f0d)
+++ lib/drntest/engine.rb    2014-04-30 16:01:27 +0900 (698b5a8)
@@ -117,7 +117,7 @@ module Drntest
       }
       options = {
         :chdir => temporary_dir.to_s,
-        STDERR => STDOUT,
+        :err => :out,
       }
       arguments = [env, *command]
       arguments << options

  Modified: lib/drntest/test-executor.rb (+6 -1)
===================================================================
--- lib/drntest/test-executor.rb    2014-04-29 00:54:35 +0900 (ffc3116)
+++ lib/drntest/test-executor.rb    2014-04-30 16:01:27 +0900 (eda6159)
@@ -29,7 +29,12 @@ module Drntest
     def execute
       catch do |abort_tag|
         begin
-          Droonga::Client.open(tag: @config.tag, port: @config.port) do |client|
+          options = {
+            :tag     => @config.tag,
+            :port    => @config.port,
+            :timeout => @config.timeout,
+          }
+          Droonga::Client.open(options) do |client|
             context = Context.new(client, @config, @results, abort_tag)
             operations.each do |operation|
               context.execute(operation)

  Modified: lib/drntest/tester.rb (+6 -0)
===================================================================
--- lib/drntest/tester.rb    2014-04-29 00:54:35 +0900 (6e1a107)
+++ lib/drntest/tester.rb    2014-04-30 16:01:27 +0900 (efd36c2)
@@ -123,6 +123,12 @@ module Drntest
         @suite_pattern = pattern
       end
 
+      parser.on("--timeout=TIMEOUT", Float,
+                "Wait TIMEOUT seconds for " +
+                  "receiving responses from Droonga engine") do |timeout|
+        @config.timeout = timeout
+      end
+
       parser
     end
 
-------------- next part --------------
HTML����������������������������...
Download 



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