Skip to content

Commit

Permalink
Merge pull request #669 from basho/feature/jra/decouple-rt-refactor
Browse files Browse the repository at this point in the history
Refactor and break up rt module into appropriate subdomain functions
  • Loading branch information
bowrocker committed Jul 31, 2014
2 parents f1127bc + 01a132b commit fa14c84
Show file tree
Hide file tree
Showing 155 changed files with 2,208 additions and 1,981 deletions.
8 changes: 4 additions & 4 deletions src/riak_test_escript.erl
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ maybe_teardown(true, TestResults, Coverage, Verbose) ->
so_kill_riak_maybe();
_ ->
lager:info("Multiple tests run or no failure"),
rt:teardown(),
rt_cluster:teardown(),
print_summary(TestResults, Coverage, Verbose)
end,
ok.
Expand Down Expand Up @@ -293,7 +293,7 @@ run_test(Test, Outdir, TestMetaData, Report, HarnessArgs, NumTests) ->
CoverDir = rt_config:get(cover_output, "coverage"),
case NumTests of
1 -> keep_them_up;
_ -> rt:teardown()
_ -> rt_cluster:teardown()
end,
CoverageFile = rt_cover:maybe_export_coverage(Test, CoverDir, erlang:phash2(TestMetaData)),
case Report of
Expand Down Expand Up @@ -422,8 +422,8 @@ so_kill_riak_maybe() ->
io:format("Would you like to leave Riak running in order to debug?~n"),
Input = io:get_chars("[Y/n] ", 1),
case Input of
"n" -> rt:teardown();
"N" -> rt:teardown();
"n" -> rt_cluster:teardown();
"N" -> rt_cluster:teardown();
_ ->
io:format("Leaving Riak Up... "),
rt:whats_up()
Expand Down
2 changes: 1 addition & 1 deletion src/riak_test_group_leader.erl
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ io_requests(_, Result) ->

%% If we get multiple lines, we'll split them up for lager to maximize the prettiness.
log_chars(Chars) ->
[lager:info("~s", [Line]) || Line <- string:tokens(lists:flatten(Chars), "\n")].
[lager:info("~s", [Line]) || Line <- string:tokens(lists:flatten(Chars), "\n")].
7 changes: 4 additions & 3 deletions src/riak_test_runner.erl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ run(TestModule, Outdir, TestMetaData, HarnessArgs) ->
undefined -> [];
Value -> [{multi_config, Value}]
end,
Backend = rt:set_backend(proplists:get_value(backend, TestMetaData), BackendExtras),
Backend = rt_backend:set_backend(
proplists:get_value(backend, TestMetaData), BackendExtras),
{PropsMod, PropsFun} = function_name(properties, TestModule, 0, rt_cluster),
{SetupMod, SetupFun} = function_name(setup, TestModule, 2, rt_cluster),
{ConfirmMod, ConfirmFun} = function_name(confirm, TestModule),
Expand Down Expand Up @@ -158,7 +159,7 @@ compose_confirm_fun({ConfirmMod, ConfirmFun},
InitialResult = ConfirmMod:ConfirmFun(SetupData, MetaData),
OtherResults = [begin
ensure_all_nodes_running(Nodes),
_ = rt:upgrade(Node, UpgradeVersion),
_ = rt_node:upgrade(Node, UpgradeVersion),
_ = rt_cluster:maybe_wait_for_transfers(Nodes, WaitForTransfers),
ConfirmMod:ConfirmFun(SetupData, MetaData)
end || Node <- Nodes],
Expand All @@ -173,7 +174,7 @@ compose_confirm_fun({ConfirmMod, ConfirmFun},

ensure_all_nodes_running(Nodes) ->
[begin
ok = rt:start_and_wait(Node),
ok = rt_node:start_and_wait(Node),
ok = rt:wait_until_registered(Node, riak_core_ring_manager)
end || Node <- Nodes].

Expand Down
Loading

0 comments on commit fa14c84

Please sign in to comment.