mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-06 08:35:22 +00:00
Initial work on standardizing test results
This commit is contained in:
parent
6f40557746
commit
af9e6aad8c
@ -25,21 +25,19 @@ main(Args) ->
|
||||
application:set_env(lager, handlers, [{lager_console_backend, LagerLevel}]),
|
||||
lager:start(),
|
||||
|
||||
%% add handler for specific test.
|
||||
gen_event:add_handler(lager_event, riak_test_lager_backend, [LagerLevel, false]),
|
||||
|
||||
%% rt:set_config(rtdev_path, Path),
|
||||
%% rt:set_config(rt_max_wait_time, 180000),
|
||||
%% rt:set_config(rt_retry_delay, 500),
|
||||
%% rt:set_config(rt_harness, rtbe),
|
||||
rt:setup_harness(Test, HarnessArgs),
|
||||
TestA = list_to_atom(Test),
|
||||
%% st:TestFn(),
|
||||
TestA:TestA(),
|
||||
SingleTestResult = riak_test_runner:run(TestA),
|
||||
io:format("STR: ~p~n", [SingleTestResult]),
|
||||
rt:cleanup_harness(),
|
||||
|
||||
%% Custom Logging Voodoo
|
||||
{ok, Logs} = gen_event:delete_handler(lager_event, riak_test_lager_backend, []),
|
||||
io:format("Test Status: ~s~n", [proplists:get_value(status, SingleTestResult)]),
|
||||
Logs = proplists:get_value(log, SingleTestResult),
|
||||
|
||||
io:format("Handled Log: ~n"),
|
||||
[ io:put_chars(user, [Log, "\n"]) || Log <- Logs ],
|
||||
|
||||
|
13
src/riak_test_runner.erl
Normal file
13
src/riak_test_runner.erl
Normal file
@ -0,0 +1,13 @@
|
||||
-module(riak_test_runner).
|
||||
|
||||
-export([run/1]).
|
||||
|
||||
run(TestModule) ->
|
||||
LagerLevel = rt:config(rt_lager_level, debug),
|
||||
gen_event:add_handler(lager_event, riak_test_lager_backend, [LagerLevel, false]),
|
||||
|
||||
Result = TestModule:run(),
|
||||
|
||||
{ok, Log} = gen_event:delete_handler(lager_event, riak_test_lager_backend, []),
|
||||
|
||||
[{status, Result}, {log, Log}].
|
@ -8,7 +8,7 @@
|
||||
wait_until_nodes_ready/1,
|
||||
wait_until_no_pending_changes/1]).
|
||||
|
||||
verify_build_cluster() ->
|
||||
run() ->
|
||||
%% Deploy a set of new nodes
|
||||
lager:info("Deploying 3 nodes"),
|
||||
Nodes = rt:deploy_nodes(3),
|
||||
@ -30,4 +30,4 @@ verify_build_cluster() ->
|
||||
lager:info("Ensure each node owns a portion of the ring"),
|
||||
[?assertEqual(Nodes, owners_according_to(Node)) || Node <- Nodes],
|
||||
lager:info("verify_build_cluster: PASS"),
|
||||
ok.
|
||||
pass.
|
||||
|
Loading…
Reference in New Issue
Block a user