Skip to content

Commit

Permalink
less output from eunit tests, added NODEBUG
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Parfitt authored and kellymclaughlin committed Jan 8, 2014
1 parent 03d6508 commit d5162e3
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 1 deletion.
File renamed without changes.
1 change: 1 addition & 0 deletions src/riak_core_cluster_conn.erl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
-include("riak_core_connection.hrl").

-ifdef(TEST).
-define(NODEBUG, true).
-include_lib("eunit/include/eunit.hrl").
%% For testing, we need to have two different cluster manager services running
%% on the same node, which is normally not done. The remote cluster service is
Expand Down
6 changes: 5 additions & 1 deletion src/riak_repl2_ip.erl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
maybe_apply_nat_map/3, apply_reverse_nat_map/3]).

-ifdef(TEST).
-define(NODEBUG, true).
-include_lib("eunit/include/eunit.hrl").
-endif.

Expand Down Expand Up @@ -318,7 +319,8 @@ make_ifaddrs(Interfaces) ->


get_matching_address_test_() ->
{setup, fun() ->
error_logger:tty(false),
{setup, fun() ->
application:set_env(riak_core, cluster_mgr, {{0, 0, 0, 0},
9090}),
lager:start(),
Expand Down Expand Up @@ -499,6 +501,7 @@ get_matching_address_test_() ->
]}.

determine_netmask_test_() ->
error_logger:tty(false),
[
{"simple case",
fun() ->
Expand All @@ -524,6 +527,7 @@ determine_netmask_test_() ->
].

natmap_test_() ->
error_logger:tty(false),
[
{"forward lookups work",
fun() ->
Expand Down
4 changes: 4 additions & 0 deletions src/riak_repl_stats.erl
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ is_rt_dirty() ->
-ifdef(TEST).

repl_stats_test_() ->
error_logger:tty(false),
{"stats test", setup, fun() ->
folsom:start(),
meck:new(folsom_utils, [passthrough]),
Expand Down Expand Up @@ -372,13 +373,15 @@ repl_stats_test_() ->
}.

test_register_stats() ->
error_logger:tty(false),
register_stats(),
RegisteredReplStats = [Stat || {App, Stat} <- folsom_metrics:get_metrics(),
App == riak_repl],
{Stats, _Types} = lists:unzip(stats()),
?assertEqual(lists:sort(Stats), lists:sort(RegisteredReplStats)).

test_populate_stats() ->
error_logger:tty(false),
Bytes = 1000,
ok = client_bytes_sent(Bytes),
ok = client_bytes_recv(Bytes),
Expand All @@ -400,6 +403,7 @@ test_populate_stats() ->
ok = rt_sink_errors().

test_check_stats() ->
error_logger:tty(false),
Expected = [
{server_bytes_sent,1000},
{server_bytes_recv,1000},
Expand Down
1 change: 1 addition & 0 deletions test/riak_core_cluster_mgr_sup_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
-include_lib("eunit/include/eunit.hrl").

murdering_test_() ->
error_logger:tty(false),
{setup, fun() ->
% if the cluster_mgr is restarted after the leader process is running,
% it should ask about who the current leader is.
Expand Down
2 changes: 2 additions & 0 deletions test/riak_core_cluster_mgr_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

-include("riak_core_cluster.hrl").
-include("riak_core_connection.hrl").
-define(NODEBUG, true).
-include_lib("eunit/include/eunit.hrl").

-define(TRACE(Stmt),Stmt).
Expand All @@ -31,6 +32,7 @@
-define(MULTINODE_REMOTE_ADDR, {"127.0.0.1", 6097}).

single_node_test_() ->
error_logger:tty(false),
{setup,
fun start_link_setup/0,
fun(Pids) ->
Expand Down
1 change: 1 addition & 0 deletions test/riak_repl2_rt_source_sink_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
}).

connection_test_() ->
error_logger:tty(false),
{foreach, fun() ->
riak_repl_test_util:start_test_ring(),
riak_repl_test_util:abstract_gen_tcp(),
Expand Down
1 change: 1 addition & 0 deletions test/riak_repl_sup_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
% Why? Because it's nice to know that system can start.

can_start_test() ->
error_logger:tty(false),
{timeout, 60000, {setup, fun() ->
% core features that are needed
{ok, _Eventer} = riak_core_ring_events:start_link(),
Expand Down

0 comments on commit d5162e3

Please sign in to comment.