You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by be...@apache.org on 2014/01/13 09:23:34 UTC
[1/5] git commit: updated refs/heads/1994-merge-rcouch to fe86218
Updated Branches:
refs/heads/1994-merge-rcouch c8753b582 -> fe862184f
exit with the correct error code
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/ccb6d7b9
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/ccb6d7b9
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/ccb6d7b9
Branch: refs/heads/1994-merge-rcouch
Commit: ccb6d7b9f340097f22aec8be43afdf834e9af5d5
Parents: c8753b5
Author: Benoit Chesneau <be...@apache.org>
Authored: Sun Jan 12 13:55:04 2014 +0100
Committer: Benoit Chesneau <be...@apache.org>
Committed: Sun Jan 12 13:55:04 2014 +0100
----------------------------------------------------------------------
test/javascript/test_js.escript | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/ccb6d7b9/test/javascript/test_js.escript
----------------------------------------------------------------------
diff --git a/test/javascript/test_js.escript b/test/javascript/test_js.escript
index 4ee7a8a..dac7bd7 100755
--- a/test/javascript/test_js.escript
+++ b/test/javascript/test_js.escript
@@ -129,8 +129,10 @@ start_couch() ->
stop_couch() ->
application:stop(couch_replicator),
+ timer:sleep(1000),
application:stop(couch_httpd),
- application:stop(couch).
+ application:stop(couch),
+ application:stop(os_mon).
restart_couch() ->
stop_couch(),
@@ -191,16 +193,18 @@ test(TestDir, Files) ->
NSuccess = length(Success),
Count = NFailed + NSuccess,
- io:format("==> javascript tests results.~n~n", []),
+ io:format("~n==> javascript tests results.~n~n", []),
lists:foreach(fun({Name, Status}) ->
io:format("~s ... ~s~n", [Name, Status])
end, lists:usort(Failed ++ Success)),
case NFailed of
0 ->
- io:format("~nAll tests successful.~nTests: ~p~n", [Count]);
+ io:format("~nAll tests successful.~nTests: ~p~n", [Count]),
+ halt(0);
_ ->
- io:format("~n~p/~p tests failed~n", [NFailed, Count])
+ io:format("~n~p/~p tests failed~n", [NFailed, Count]),
+ halt(1)
end.
main([]) ->
TestDir = filename:join([scriptdir(), "test"]),
[2/5] git commit: updated refs/heads/1994-merge-rcouch to fe86218
Posted by be...@apache.org.
only display sasl reports on error. be less verbose in tests
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/7644cf50
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/7644cf50
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/7644cf50
Branch: refs/heads/1994-merge-rcouch
Commit: 7644cf50f5a2017b31d81ff5969f6171a2ee200a
Parents: ccb6d7b
Author: Benoit Chesneau <be...@apache.org>
Authored: Sun Jan 12 20:58:30 2014 +0100
Committer: Benoit Chesneau <be...@apache.org>
Committed: Sun Jan 12 20:58:30 2014 +0100
----------------------------------------------------------------------
apps/couch_httpd/src/couch_httpd_misc_handlers.erl | 1 -
test/javascript/test_js.escript | 4 ++++
2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/7644cf50/apps/couch_httpd/src/couch_httpd_misc_handlers.erl
----------------------------------------------------------------------
diff --git a/apps/couch_httpd/src/couch_httpd_misc_handlers.erl b/apps/couch_httpd/src/couch_httpd_misc_handlers.erl
index 57cc5ec..1999e5e 100644
--- a/apps/couch_httpd/src/couch_httpd_misc_handlers.erl
+++ b/apps/couch_httpd/src/couch_httpd_misc_handlers.erl
@@ -99,7 +99,6 @@ handle_restart_req(#httpd{method='POST'}=Req) ->
ok = couch_httpd:verify_is_server_admin(Req),
Result = send_json(Req, 202, {[{ok, true}]}),
couch_server_sup:restart_core_server(),
- couch_httpd_sup:reload_listeners(),
Result;
handle_restart_req(Req) ->
send_method_not_allowed(Req, "POST").
http://git-wip-us.apache.org/repos/asf/couchdb/blob/7644cf50/test/javascript/test_js.escript
----------------------------------------------------------------------
diff --git a/test/javascript/test_js.escript b/test/javascript/test_js.escript
index dac7bd7..e01f68d 100755
--- a/test/javascript/test_js.escript
+++ b/test/javascript/test_js.escript
@@ -118,6 +118,10 @@ init_code_path() ->
start_couch() ->
ok = init_code_path(),
IniFiles = config_files(),
+
+ application:load(sasl),
+ application:set_env(sasl, errlog_type, error),
+
application:load(couch),
application:set_env(couch, config_files, IniFiles),
couch_util:start_app_deps(couch),
[4/5] git commit: updated refs/heads/1994-merge-rcouch to fe86218
Posted by be...@apache.org.
fix make testjs: fix restart_couch
change the code to stream the standard output so we can really restart
when asked.
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/99cd0e46
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/99cd0e46
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/99cd0e46
Branch: refs/heads/1994-merge-rcouch
Commit: 99cd0e4672a40732120bb71d1b00a18f113a752b
Parents: 9407c44
Author: Benoit Chesneau <be...@apache.org>
Authored: Mon Jan 13 00:37:20 2014 +0100
Committer: Benoit Chesneau <be...@apache.org>
Committed: Mon Jan 13 00:37:20 2014 +0100
----------------------------------------------------------------------
share/www/script/test/config.js | 1 -
test/javascript/test_js.escript | 80 +++++++++++++++++++++++-------------
2 files changed, 52 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/99cd0e46/share/www/script/test/config.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/config.js b/share/www/script/test/config.js
index 193aa89..175466c 100644
--- a/share/www/script/test/config.js
+++ b/share/www/script/test/config.js
@@ -51,7 +51,6 @@ couchTests.config = function(debug) {
}
T(config.couchdb.database_dir);
- T(config.daemons.httpd);
T(config.httpd_global_handlers._config);
T(config.log.level);
T(config.query_servers.javascript);
http://git-wip-us.apache.org/repos/asf/couchdb/blob/99cd0e46/test/javascript/test_js.escript
----------------------------------------------------------------------
diff --git a/test/javascript/test_js.escript b/test/javascript/test_js.escript
index e01f68d..2a02972 100755
--- a/test/javascript/test_js.escript
+++ b/test/javascript/test_js.escript
@@ -115,17 +115,23 @@ init_code_path() ->
%% init config
init_config().
-start_couch() ->
+start_couch(Verbose) ->
ok = init_code_path(),
IniFiles = config_files(),
application:load(sasl),
+ %% disable sasl logging
application:set_env(sasl, errlog_type, error),
+ application:set_env(sasl, sasl_error_logger, false),
+ %% start couch
application:load(couch),
application:set_env(couch, config_files, IniFiles),
couch_util:start_app_deps(couch),
application:start(couch),
+ %% set couch log level
+ couch_config:set("log", "level", atom_to_list(Verbose), false),
+
couch_util:start_app_deps(couch_httpd),
application:start(couch_httpd),
couch_util:start_app_deps(couch_replicator),
@@ -133,17 +139,30 @@ start_couch() ->
stop_couch() ->
application:stop(couch_replicator),
- timer:sleep(1000),
application:stop(couch_httpd),
application:stop(couch),
application:stop(os_mon).
-restart_couch() ->
+restart_couch(Verbose) ->
stop_couch(),
- timer:sleep(1000),
- start_couch().
+ start_couch(Verbose).
+
+exec_loop(Port, Verbose, Acc) ->
+ receive
+ {Port, {data, {eol, "OK"}}} ->
+ ok;
+ {Port, {data, {eol, "restart"}}} ->
+ restart_couch(Verbose),
+ exec_loop(Port, Verbose, Acc);
+ {Port, {data, {eol, Line}}} ->
+ exec_loop(Port, Verbose, Acc ++ "\n" ++ Line);
+ {Port, {data, {noeol, Verbose, Line}}} ->
+ exec_loop(Port, Verbose, Acc ++ Line);
+ {Port, {exit_status, _}} ->
+ {error, Acc}
+ end.
-exec(Path) ->
+exec(Path, Verbose) ->
COUCHJS = filename:join([builddir(), "apps", "couch", "priv",
"couchjs"]),
CouchUri = filename:join([testdir(), "data", "couch.uri"]),
@@ -159,31 +178,31 @@ exec(Path) ->
Path,
js_test_file("cli_runner.js")], " "),
- Resp = os:cmd(Cmd),
- Lines = string:tokens(Resp, "\n"),
- Result = lists:foldr(fun
- ("restart", Acc) ->
- restart_couch(),
- Acc;
- ("OK", _Acc) ->
- ok;
- (_Else, Acc) ->
- io:format("got else ~p~n", [_Else]),
- Acc
- end, fail, Lines),
- io:format("~s ... ~s~n", [filename:basename(Path), Result]),
- Result.
-
+ PortSettings = [exit_status, {line, 16384}, use_stdio, stderr_to_stdout,
+ hide],
+
+ io:format("~s ... testing~n", [filename:basename(Path)]),
+ Port = open_port({spawn, Cmd}, PortSettings),
+ Result = case exec_loop(Port, Verbose, "") of
+ ok ->
+ io:format("~s ... ok~n", [filename:basename(Path)]),
+ ok;
+ {error, Output} ->
+ io:format("~s ... fail~n", [filename:basename(Path)]),
+ io:format("javascript traceback:~n~s~n", [Output]),
+ fail
+ end,
+ Result.
-test(TestDir, Files) ->
- start_couch(),
+test(TestDir, Files, Verbose) ->
+ start_couch(Verbose),
timer:sleep(1000),
io:format("==> run javascript tests.~n~n", []),
{Failed, Success} = lists:foldl(fun(Name, {FAILs, OKs}) ->
Path = filename:join([TestDir, Name]),
- Result = exec(Path),
+ Result = exec(Path, Verbose),
case Result of
ok-> {FAILs, [{Name, ok} | OKs]};
_ -> {[{Name, fail} | FAILs], OKs}
@@ -191,8 +210,6 @@ test(TestDir, Files) ->
end, {[], []}, Files),
- stop_couch(),
-
NFailed = length(Failed),
NSuccess = length(Success),
Count = NFailed + NSuccess,
@@ -210,9 +227,16 @@ test(TestDir, Files) ->
io:format("~n~p/~p tests failed~n", [NFailed, Count]),
halt(1)
end.
+
main([]) ->
TestDir = filename:join([scriptdir(), "test"]),
- test(TestDir, filelib:wildcard("*.js", TestDir));
+ test(TestDir, filelib:wildcard("*.js", TestDir), none);
+main(["-v", File | _]) ->
+ Dir = filename:absname(filename:dirname(File)),
+ test(Dir, [filename:basename(File)], info);
+main(["-vv", File | _]) ->
+ Dir = filename:absname(filename:dirname(File)),
+ test(Dir, [filename:basename(File)], debug);
main([File |_]) ->
Dir = filename:absname(filename:dirname(File)),
- test(Dir, [filename:basename(File)]).
+ test(Dir, [filename:basename(File)], none).
[5/5] git commit: updated refs/heads/1994-merge-rcouch to fe86218
Posted by be...@apache.org.
export couch_httpd:set_auth_handlers/0
This function wasn't exported so any changes to the
`httpf/authentication_handlers` setting wasn't effective.
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/fe862184
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/fe862184
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/fe862184
Branch: refs/heads/1994-merge-rcouch
Commit: fe862184f580c7951c326c7556ff8bd7e938dfcf
Parents: 99cd0e4
Author: Benoit Chesneau <be...@apache.org>
Authored: Mon Jan 13 09:01:59 2014 +0100
Committer: Benoit Chesneau <be...@apache.org>
Committed: Mon Jan 13 09:01:59 2014 +0100
----------------------------------------------------------------------
apps/couch_httpd/src/couch_httpd.erl | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/fe862184/apps/couch_httpd/src/couch_httpd.erl
----------------------------------------------------------------------
diff --git a/apps/couch_httpd/src/couch_httpd.erl b/apps/couch_httpd/src/couch_httpd.erl
index ae28817..8cef53f 100644
--- a/apps/couch_httpd/src/couch_httpd.erl
+++ b/apps/couch_httpd/src/couch_httpd.erl
@@ -30,7 +30,7 @@
-export([send_json/2,send_json/3,send_json/4,last_chunk/1,parse_multipart_request/3]).
-export([accepted_encodings/1,handle_request_int/5,validate_referer/1,validate_ctype/2]).
-export([http_1_0_keep_alive/2]).
-
+-export([set_auth_handlers/0]).
start_link(couch_http) ->
Port = couch_config:get("httpd", "port", "5984"),
@@ -157,7 +157,7 @@ set_auth_handlers() ->
couch_config:get("httpd", "authentication_handlers", "")),
AuthHandlers = lists:map(
fun(A) -> {make_arity_1_fun(A), ?l2b(A)} end, AuthenticationSrcs),
- ok = application:set_env(couch, auth_handlers, AuthHandlers).
+ ok = application:set_env(couch_httpd, auth_handlers, AuthHandlers).
% SpecStr is a string like "{my_module, my_fun}"
% or "{my_module, my_fun, <<"my_arg">>}"
@@ -286,7 +286,7 @@ handle_request_int(MochiReq, DefaultFun,
},
HandlerFun = couch_util:dict_find(HandlerKey, UrlHandlers, DefaultFun),
- {ok, AuthHandlers} = application:get_env(couch, auth_handlers),
+ {ok, AuthHandlers} = application:get_env(couch_httpd, auth_handlers),
{ok, Resp} =
try
[3/5] git commit: updated refs/heads/1994-merge-rcouch to fe86218
Posted by be...@apache.org.
provide a release able to work with libs installed on the system.
ie. prevent any external pollution.
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/9407c44b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/9407c44b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/9407c44b
Branch: refs/heads/1994-merge-rcouch
Commit: 9407c44bd881bafab9ce5ebce089e0ccad2ae63d
Parents: 7644cf5
Author: Benoit Chesneau <be...@apache.org>
Authored: Sun Jan 12 21:06:29 2014 +0100
Committer: Benoit Chesneau <be...@apache.org>
Committed: Sun Jan 12 21:06:29 2014 +0100
----------------------------------------------------------------------
rel/reltool.config.script | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9407c44b/rel/reltool.config.script
----------------------------------------------------------------------
diff --git a/rel/reltool.config.script b/rel/reltool.config.script
index c3c989a..48c6ba6 100644
--- a/rel/reltool.config.script
+++ b/rel/reltool.config.script
@@ -65,12 +65,30 @@ CouchJSName = proplists:get_value(couchjs_name, Cfg, "couchjs"),
{profile, embedded},
{relocatable, true},
+ {incl_cond, exclude},
{excl_sys_filters, ["^bin/.*",
"^erts.*/bin/(dialyzer|typer)",
"^erts.*/doc",
"^erts.*/man"]},
{excl_archive_filters, [".*"]},
+ %% stdlib
+ {app, asn1, [{incl_cond, include}]},
+ {app, sasl, [{incl_cond, include}]},
+ {app, crypto, [{incl_cond, include}]},
+ {app, public_key, [{incl_cond, include}]},
+ {app, ssl, [{incl_cond, include}]},
+ {app, xmerl, [{incl_cond, include}]},
+ {app, observer, [{incl_cond, include}]},
+
+
+ {app, kernel, [{incl_cond, include}]},
+ {app, stdlib, [{incl_cond, include}]},
+ {app, inets, [{incl_cond, include}]},
+ {app, os_mon, [{incl_cond, include}]},
+ {app, compiler, [{incl_cond, include}]},
+ {app, syntax_tools, [{incl_cond, include}]},
+ {app, runtime_tools, [{incl_cond, include}]},
%% dependencies
{app, mochiweb, [{incl_cond, include}]},