couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [30/48] couch commit: updated refs/heads/master to 7776921
Date Sat, 04 Apr 2015 23:29:25 GMT
Enable couchdb_os_daemons_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/9589b63b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/9589b63b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/9589b63b

Branch: refs/heads/master
Commit: 9589b63bfbcba8e16d34bc900949a55ec16f0c62
Parents: d4d726c
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Wed Feb 4 08:41:21 2015 -0800
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Tue Feb 10 11:06:16 2015 -0800

----------------------------------------------------------------------
 test/couchdb_os_daemons_tests.erl        | 14 +++++---------
 test/fixtures/os_daemon_configer.escript | 13 +++++--------
 2 files changed, 10 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/9589b63b/test/couchdb_os_daemons_tests.erl
----------------------------------------------------------------------
diff --git a/test/couchdb_os_daemons_tests.erl b/test/couchdb_os_daemons_tests.erl
index b978e38..fe59005 100644
--- a/test/couchdb_os_daemons_tests.erl
+++ b/test/couchdb_os_daemons_tests.erl
@@ -36,19 +36,17 @@
 -define(TIMEOUT, 1000).
 
 
--ifdef(run_broken_tests).
-
 setup(DName) ->
-    {ok, CfgPid} = config:start_link(?CONFIG_CHAIN),
+    Ctx = test_util:start(?MODULE, [], [{dont_mock, [config]}]),
     {ok, OsDPid} = couch_os_daemons:start_link(),
     config:set("os_daemons", DName,
                      filename:join([?FIXTURESDIR, DName]), false),
     timer:sleep(?DELAY),  % sleep a bit to let daemon set kill flag
-    {CfgPid, OsDPid}.
+    {Ctx, OsDPid}.
 
-teardown(_, {CfgPid, OsDPid}) ->
-    test_util:stop_config(CfgPid),
-    test_util:stop_sync_throw(OsPid, fun() ->
+teardown(_, {Ctx, OsDPid}) ->
+    test_util:stop(Ctx),
+    test_util:stop_sync_throw(OsDPid, fun() ->
         exit(OsDPid, shutdown)
     end, {timeout, os_daemon_stop}, ?TIMEOUT).
 
@@ -215,5 +213,3 @@ check_dead(D, Name) ->
     ?assertEqual(halted, D#daemon.status),
     ?assertEqual(nil, D#daemon.errors),
     ?assertEqual(nil, D#daemon.buf).
-
--endif.

http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/9589b63b/test/fixtures/os_daemon_configer.escript
----------------------------------------------------------------------
diff --git a/test/fixtures/os_daemon_configer.escript b/test/fixtures/os_daemon_configer.escript
index 0074fc0..3e02ef9 100755
--- a/test/fixtures/os_daemon_configer.escript
+++ b/test/fixtures/os_daemon_configer.escript
@@ -12,19 +12,18 @@
 % License for the specific language governing permissions and limitations under
 % the License.
 
--include("../couch_eunit.hrl").
-
+-include("../../include/couch_eunit.hrl").
 
 read() ->
     case io:get_line('') of
         eof ->
             stop;
         Data ->
-            ejson:decode(Data)
+            jiffy:decode(Data)
     end.
 
 write(Mesg) ->
-    Data = iolist_to_binary(ejson:encode(Mesg)),
+    Data = iolist_to_binary(jiffy:encode(Mesg)),
     io:format(binary_to_list(Data) ++ "\n", []).
 
 get_cfg(Section) ->
@@ -83,19 +82,17 @@ loop({error, _Reason}) ->
 
 main([]) ->
     init_code_path(),
-    config:start_link(?CONFIG_CHAIN),
-    couch_drv:start_link(),
     do_tests().
 
 init_code_path() ->
     Paths = [
         "couchdb",
-        "ejson",
+        "jiffy",
         "erlang-oauth",
         "ibrowse",
         "mochiweb",
         "snappy"
     ],
     lists:foreach(fun(Name) ->
-        code:add_patha(filename:join([?BUILDDIR, "src", Name]))
+        code:add_patha(filename:join([?BUILDDIR(), "src", Name, "ebin"]))
     end, Paths).


Mime
View raw message