Skip to content

Commit 4186a46

Browse files
author
Brett Hazen
committed
Finally get GiddyUp working
- Stuff all output into the regression results directory; including logs and configs - Move start of lager to very top of escript - Move results printing into rt_reporter - Reporting now must be completed before cleaning up nodes - Test result reporting moved from executor into test runner - Node logs are copied to the outdir directory locally or uploaded to GiddyUp - Add the name of test to the rt_test_plan
1 parent f7e61bf commit 4186a46

12 files changed

+618
-357
lines changed

regression_test_wrapper.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ ln -s $RESULTS $RESULTS_SYMLINK
2727
RT_OPTS="-v --continue -c $1"
2828

2929
echo "Running bitcask regression tests using the following test cases: $BITCASK_BACKEND_TEST_CASES"
30-
./riak_test $RT_OPTS -t $BITCASK_BACKEND_TEST_CASES &> $RESULTS_DIR/bitcask_results.log
30+
./riak_test $RT_OPTS -t $BITCASK_BACKEND_TEST_CASES -o $RESULTS_DIR &> $RESULTS_DIR/bitcask_results.log
3131

3232
echo "Running leveldb regression tests using the following test cases: $ELEVELDB_BACKEND_TEST_CASES"
33-
./riak_test $RT_OPTS -t $ELEVELDB_BACKEND_TEST_CASES -b eleveldb &> $RESULTS_DIR/leveldb_results.log
33+
./riak_test $RT_OPTS -t $ELEVELDB_BACKEND_TEST_CASES -b eleveldb -o $RESULTS_DIR &> $RESULTS_DIR/leveldb_results.log
3434

3535
echo "Running memory regression tests using the following test cases: $MEMORY_BACKEND_TEST_CASES"
36-
./riak_test $RT_OPTS -t $MEMORY_BACKEND_TEST_CASES -b memory &> $RESULTS_DIR/memory_results.log
36+
./riak_test $RT_OPTS -t $MEMORY_BACKEND_TEST_CASES -b memory -o $RESULTS_DIR &> $RESULTS_DIR/memory_results.log
3737

3838
echo "Results of the test run written to $RESULTS_DIR"

src/giddyup.erl

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ post_result(TestResult) ->
8383
URL = "http://" ++ Host ++ "/test_results",
8484
lager:info("giddyup url: ~s", [URL]),
8585
rt:check_ibrowse(),
86-
case rt:post_result(TestResult, #rt_webhook{name="GiddyUp", url=URL, headers=[basic_auth()]}) of
86+
case post_result(TestResult, #rt_webhook{name="GiddyUp", url=URL, headers=[basic_auth()]}) of
8787
{ok, RC, Headers} ->
8888
{_, Location} = lists:keyfind("Location", 1, Headers),
8989
lager:info("Test Result successfully POSTed to GiddyUp! ResponseCode: ~s, URL: ~s", [RC, Location]),
@@ -92,6 +92,34 @@ post_result(TestResult) ->
9292
error
9393
end.
9494

95+
-spec(post_result(proplists:proplist(), term()) -> tuple()|error).
96+
post_result(TestResult, #rt_webhook{url=URL, headers=HookHeaders, name=Name}) ->
97+
try ibrowse:send_req(URL,
98+
[{"Content-Type", "application/json"}],
99+
post,
100+
mochijson2:encode(TestResult),
101+
[{content_type, "application/json"}] ++ HookHeaders,
102+
300000) of %% 5 minute timeout
103+
104+
{ok, RC=[$2|_], Headers, _Body} ->
105+
{ok, RC, Headers};
106+
{ok, ResponseCode, Headers, Body} ->
107+
lager:info("Test Result did not generate the expected 2XX HTTP response code."),
108+
lager:debug("Post"),
109+
lager:debug("Response Code: ~p", [ResponseCode]),
110+
lager:debug("Headers: ~p", [Headers]),
111+
lager:debug("Body: ~p", [Body]),
112+
error;
113+
X ->
114+
lager:warning("Some error POSTing test result: ~p", [X]),
115+
error
116+
catch
117+
Class:Reason ->
118+
lager:error("Error reporting to ~s. ~p:~p", [Name, Class, Reason]),
119+
lager:error("Payload: ~p", [TestResult]),
120+
error
121+
end.
122+
95123
post_artifact(TRURL, {FName, Body}) ->
96124
%% First compute the path of where to post the artifact
97125
URL = artifact_url(TRURL, FName),

0 commit comments

Comments
 (0)