couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [17/48] couch commit: updated refs/heads/master to 7776921
Date Sat, 04 Apr 2015 23:29:12 GMT
Use test_util:start in test suite

Use test_util:start in setup fixture of tests.
We also add ioq to list of dependencies for some tests.

COUCHDB-2547


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/061c5304
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/061c5304
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/061c5304

Branch: refs/heads/master
Commit: 061c5304f4aac97a56faf89d1dd21d003dea3572
Parents: a78267b
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Mon Feb 2 06:57:44 2015 -0800
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Tue Feb 10 11:03:19 2015 -0800

----------------------------------------------------------------------
 test/couch_btree_tests.erl  | 94 +++++++++++++++++++++++-----------------
 test/couch_stream_tests.erl | 30 +++++++------
 test/couchdb_cors_tests.erl |  2 +-
 3 files changed, 73 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/061c5304/test/couch_btree_tests.erl
----------------------------------------------------------------------
diff --git a/test/couch_btree_tests.erl b/test/couch_btree_tests.erl
index 60469cf..35cf416 100644
--- a/test/couch_btree_tests.erl
+++ b/test/couch_btree_tests.erl
@@ -86,9 +86,13 @@ sorted_kvs_test_() ->
     {
         "BTree with sorted keys",
         {
-            foreachx,
-            fun setup_kvs/1, fun teardown/2,
-            [{Sorted, Fun} || Fun <- Funs]
+            setup,
+            fun() -> test_util:start(?MODULE, [ioq]) end, fun test_util:stop/1,
+            {
+                foreachx,
+                fun setup_kvs/1, fun teardown/2,
+                [{Sorted, Fun} || Fun <- Funs]
+            }
         }
     }.
 
@@ -99,9 +103,13 @@ rsorted_kvs_test_() ->
     {
         "BTree with backward sorted keys",
         {
-            foreachx,
-            fun setup_kvs/1, fun teardown/2,
-            [{Reversed, Fun} || Fun <- Funs]
+            setup,
+            fun() -> test_util:start(?MODULE, [ioq]) end, fun test_util:stop/1,
+            {
+                foreachx,
+                fun setup_kvs/1, fun teardown/2,
+                [{Reversed, Fun} || Fun <- Funs]
+            }
         }
     }.
 
@@ -112,50 +120,58 @@ shuffled_kvs_test_() ->
     {
         "BTree with shuffled keys",
         {
-            foreachx,
-            fun setup_kvs/1, fun teardown/2,
-            [{Shuffled, Fun} || Fun <- Funs]
+            setup,
+            fun() -> test_util:start(?MODULE, [ioq]) end, fun test_util:stop/1,
+            {
+                foreachx,
+                fun setup_kvs/1, fun teardown/2,
+                [{Shuffled, Fun} || Fun <- Funs]
+            }
         }
     }.
 
 reductions_test_() ->
     {
         "BTree reductions",
-        [
-            {
-                "Common tests",
+        {
+            setup,
+            fun() -> test_util:start(?MODULE, [ioq]) end, fun test_util:stop/1,
+            [
                 {
-                    foreach,
-                    fun setup_red/0, fun teardown/1,
-                    [
-                        fun should_reduce_without_specified_direction/1,
-                        fun should_reduce_forward/1,
-                        fun should_reduce_backward/1
-                    ]
-                }
-            },
-            {
-                "Range requests",
-                [
+                    "Common tests",
                     {
-                        "Forward direction",
+                        foreach,
+                        fun setup_red/0, fun teardown/1,
+                        [
+                            fun should_reduce_without_specified_direction/1,
+                            fun should_reduce_forward/1,
+                            fun should_reduce_backward/1
+                        ]
+                    }
+                },
+                {
+                    "Range requests",
+                    [
                         {
-                            foreachx,
-                            fun setup_red/1, fun teardown/2,
-                            [{fwd, F} || F <- red_test_funs()]
-                        }
-                    },
-                    {
-                        "Backward direction",
+                            "Forward direction",
+                            {
+                                foreachx,
+                                fun setup_red/1, fun teardown/2,
+                                [{fwd, F} || F <- red_test_funs()]
+                            }
+                        },
                         {
-                            foreachx,
-                            fun setup_red/1, fun teardown/2,
-                            [{rev, F} || F <- red_test_funs()]
+                            "Backward direction",
+                            {
+                                foreachx,
+                                fun setup_red/1, fun teardown/2,
+                                [{rev, F} || F <- red_test_funs()]
+                            }
                         }
-                    }
-                ]
-            }
-        ]
+                    ]
+                }
+            ]
+        }
     }.
 
 

http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/061c5304/test/couch_stream_tests.erl
----------------------------------------------------------------------
diff --git a/test/couch_stream_tests.erl b/test/couch_stream_tests.erl
index e12e714..e842c86 100644
--- a/test/couch_stream_tests.erl
+++ b/test/couch_stream_tests.erl
@@ -28,19 +28,23 @@ stream_test_() ->
     {
         "CouchDB stream tests",
         {
-            foreach,
-            fun setup/0, fun teardown/1,
-            [
-                fun should_write/1,
-                fun should_write_consecutive/1,
-                fun should_write_empty_binary/1,
-                fun should_return_file_pointers_on_close/1,
-                fun should_return_stream_size_on_close/1,
-                fun should_return_valid_pointers/1,
-                fun should_recall_last_pointer_position/1,
-                fun should_stream_more_with_4K_chunk_size/1,
-                fun should_stop_on_normal_exit_of_stream_opener/1
-            ]
+            setup,
+            fun() -> test_util:start(?MODULE, [ioq]) end, fun test_util:stop/1,
+            {
+                foreach,
+                fun setup/0, fun teardown/1,
+                [
+                    fun should_write/1,
+                    fun should_write_consecutive/1,
+                    fun should_write_empty_binary/1,
+                    fun should_return_file_pointers_on_close/1,
+                    fun should_return_stream_size_on_close/1,
+                    fun should_return_valid_pointers/1,
+                    fun should_recall_last_pointer_position/1,
+                    fun should_stream_more_with_4K_chunk_size/1,
+                    fun should_stop_on_normal_exit_of_stream_opener/1
+                ]
+            }
         }
     }.
 

http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/061c5304/test/couchdb_cors_tests.erl
----------------------------------------------------------------------
diff --git a/test/couchdb_cors_tests.erl b/test/couchdb_cors_tests.erl
index 5d4bc83..4b2e2b5 100644
--- a/test/couchdb_cors_tests.erl
+++ b/test/couchdb_cors_tests.erl
@@ -22,7 +22,7 @@
 
 
 start() ->
-    Ctx = test_util:start_couch(),
+    Ctx = test_util:start_couch([ioq]),
     ok = config:set("httpd", "enable_cors", "true", false),
     ok = config:set("vhosts", "example.com", "/", false),
     Ctx.


Mime
View raw message