[Groonga-commit] droonga/fluent-plugin-droonga at 377e572 [master] Make tests about dependencies independent from the order of planned messages

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Jan 31 13:26:06 JST 2014


YUKI Hiroshi	2014-01-31 13:26:06 +0900 (Fri, 31 Jan 2014)

  New Revision: 377e572254de4ec8860fa540f2825cc905c808f6
  https://github.com/droonga/fluent-plugin-droonga/commit/377e572254de4ec8860fa540f2825cc905c808f6

  Message:
    Make tests about dependencies independent from the order of planned messages

  Modified files:
    test/unit/plugin/distributor/test_search_planner.rb

  Modified: test/unit/plugin/distributor/test_search_planner.rb (+10 -2)
===================================================================
--- test/unit/plugin/distributor/test_search_planner.rb    2014-01-31 15:52:47 +0900 (f5d0e38)
+++ test/unit/plugin/distributor/test_search_planner.rb    2014-01-31 13:26:06 +0900 (1477e65)
@@ -45,17 +45,24 @@ class DistributedSearchPlannerTest < Test::Unit::TestCase
   end
 
   def dependencies
-    messages.collect do |message|
+    dependencies = messages.collect do |message|
       {
         "type"    => message["type"],
         "inputs"  => message["inputs"],
         "outputs" => message["outputs"],
       }
     end
+    sort_dependencies(dependencies)
+  end
+
+  def sort_dependencies(dependencies)
+    dependencies.sort do |a, b|
+      a["type"] <=> b["type"]
+    end
   end
 
   def expected_dependencies(reduce_inputs, gather_inputs)
-    [
+    dependencies = [
       {
         "type"    => "search_reduce",
         "inputs"  => reduce_inputs,
@@ -72,6 +79,7 @@ class DistributedSearchPlannerTest < Test::Unit::TestCase
         "outputs" => reduce_inputs,
       },
     ]
+    sort_dependencies(dependencies)
   end
 
   class MultipleQueriesTest < self
-------------- next part --------------
HTML����������������������������...
Download 



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