You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2014/01/17 23:07:20 UTC

[46/50] git commit: [squash] to etap updates

[squash] to etap updates


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

Branch: refs/heads/import
Commit: 53e6dbec4203ee77e5c5ba1d22844489bf13fe74
Parents: 6f0123b
Author: Paul J. Davis <pa...@gmail.com>
Authored: Thu Mar 14 02:06:36 2013 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Wed Mar 20 06:02:57 2013 -0500

----------------------------------------------------------------------
 test/02-httpc-pool.t              | 14 ++------------
 test/03-replication-compact.t     | 23 ++++++++---------------
 test/04-replication-large-atts.t  | 17 +++--------------
 test/05-replication-many-leaves.t | 17 +++--------------
 test/06-doc-missing-stubs.t       | 17 +++--------------
 5 files changed, 19 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/53e6dbec/test/02-httpc-pool.t
----------------------------------------------------------------------
diff --git a/test/02-httpc-pool.t b/test/02-httpc-pool.t
index 23d7ab7..fc86cce 100755
--- a/test/02-httpc-pool.t
+++ b/test/02-httpc-pool.t
@@ -13,21 +13,11 @@
 % the License.
 
 main(_) ->
-    test_util:init_code_path(),
-
-    etap:plan(55),
-    case (catch test()) of
-        ok ->
-            etap:end_tests();
-        Other ->
-            etap:diag(io_lib:format("Test died abnormally: ~p", [Other])),
-            etap:bail(Other)
-    end,
-    ok.
+    test_util:run(55, fun() -> test() end).
 
 
 test() ->
-    couch_server_sup:start_link(test_util:config_files()),
+    test_util:start_couch(),
     ibrowse:start(),
 
     test_pool_full(),

http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/53e6dbec/test/03-replication-compact.t
----------------------------------------------------------------------
diff --git a/test/03-replication-compact.t b/test/03-replication-compact.t
index 619d2b4..888d123 100755
--- a/test/03-replication-compact.t
+++ b/test/03-replication-compact.t
@@ -16,6 +16,8 @@
 % target of a replication doesn't affect the replication and that the
 % replication doesn't hold their reference counters forever.
 
+-mode(compile).
+
 -define(b2l(B), binary_to_list(B)).
 
 -record(user_ctx, {
@@ -66,21 +68,11 @@ target_db_name() -> <<"couch_test_rep_db_b">>.
 
 
 main(_) ->
-    test_util:init_code_path(),
-
-    etap:plan(376),
-    case (catch test()) of
-        ok ->
-            etap:end_tests();
-        Other ->
-            etap:diag(io_lib:format("Test died abnormally: ~p", [Other])),
-            etap:bail(Other)
-    end,
-    ok.
+    test_util:run(376, fun() -> test() end).
 
 
 test() ->
-    couch_server_sup:start_link(test_util:config_files()),
+    test_util:start_couch(),
     ibrowse:start(),
 
     Pairs = [
@@ -112,13 +104,13 @@ test() ->
 
             delete_db(SourceDb),
             delete_db(TargetDb),
-            couch_server_sup:stop(),
+            ok = test_util:stop_couch(),
             ok = timer:sleep(1000),
-            couch_server_sup:start_link(test_util:config_files())
+            ok = test_util:start_couch()
         end,
         Pairs),
 
-    couch_server_sup:stop(),
+    ok = test_util:stop_couch(),
     ok.
 
 
@@ -284,6 +276,7 @@ compare_dbs(#db{name = SourceName}, #db{name = TargetName}) ->
 
 
 check_active_tasks(RepPid, {BaseId, Ext} = _RepId, Src, Tgt) ->
+    timer:sleep(1000),
     Source = case Src of
     {remote, NameSrc} ->
         <<(db_url(NameSrc))/binary, $/>>;

http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/53e6dbec/test/04-replication-large-atts.t
----------------------------------------------------------------------
diff --git a/test/04-replication-large-atts.t b/test/04-replication-large-atts.t
index caf2f67..9adaead 100755
--- a/test/04-replication-large-atts.t
+++ b/test/04-replication-large-atts.t
@@ -49,21 +49,11 @@ target_db_name() -> <<"couch_test_rep_db_b">>.
 
 
 main(_) ->
-    test_util:init_code_path(),
-
-    etap:plan(1192),
-    case (catch test()) of
-        ok ->
-            etap:end_tests();
-        Other ->
-            etap:diag(io_lib:format("Test died abnormally: ~p", [Other])),
-            etap:bail(Other)
-    end,
-    ok.
+    test_util:run(1192, fun() -> test() end).
 
 
 test() ->
-    couch_server_sup:start_link(test_util:config_files()),
+    test_util:start_couch(),
     ibrowse:start(),
     crypto:start(),
     config:set("attachments", "compressible_types", "text/*", false),
@@ -98,8 +88,7 @@ test() ->
         Pairs),
 
     delete_db(SourceDb),
-    couch_server_sup:stop(),
-    ok.
+    test_util:stop_couch().
 
 
 populate_db(Db, DocCount) ->

http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/53e6dbec/test/05-replication-many-leaves.t
----------------------------------------------------------------------
diff --git a/test/05-replication-many-leaves.t b/test/05-replication-many-leaves.t
index be63d41..bd795ec 100755
--- a/test/05-replication-many-leaves.t
+++ b/test/05-replication-many-leaves.t
@@ -61,21 +61,11 @@ doc_num_conflicts(<<"doc3">>) -> 210.
 
 
 main(_) ->
-    test_util:init_code_path(),
-
-    etap:plan(56),
-    case (catch test()) of
-        ok ->
-            etap:end_tests();
-        Other ->
-            etap:diag(io_lib:format("Test died abnormally: ~p", [Other])),
-            etap:bail(Other)
-    end,
-    ok.
+    test_util:run(56, fun() -> test() end).
 
 
 test() ->
-    couch_server_sup:start_link(test_util:config_files()),
+    test_util:start_couch(),
     ibrowse:start(),
     crypto:start(),
     config:set("replicator", "connection_timeout", "90000", false),
@@ -125,8 +115,7 @@ test() ->
         end,
         Pairs),
 
-    couch_server_sup:stop(),
-    ok.
+    test_util:stop_couch().
 
 
 populate_db(Db) ->

http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/53e6dbec/test/06-doc-missing-stubs.t
----------------------------------------------------------------------
diff --git a/test/06-doc-missing-stubs.t b/test/06-doc-missing-stubs.t
index 0fffec2..116550c 100755
--- a/test/06-doc-missing-stubs.t
+++ b/test/06-doc-missing-stubs.t
@@ -52,22 +52,12 @@ target_revs_limit() -> 3.
 
 
 main(_) ->
-    test_util:init_code_path(),
-
-    etap:plan(128),
-    case (catch test()) of
-        ok ->
-            etap:end_tests();
-        Other ->
-            etap:diag(io_lib:format("Test died abnormally: ~p", [Other])),
-            etap:bail(Other)
-    end,
-    ok.
+    test_util:run(128, fun() -> test() end).
 
 
 % Test motivated by COUCHDB-1365.
 test() ->
-    couch_server_sup:start_link(test_util:config_files()),
+    test_util:start_couch(),
     ibrowse:start(),
 
     Pairs = [
@@ -109,8 +99,7 @@ test() ->
         end,
         Pairs),
 
-    couch_server_sup:stop(),
-    ok.
+    test_util:stop_couch().
 
 
 populate_db(Db) ->