Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

expose non-escript test running for integration with new harness

  • Loading branch information...
commit 0207e487231cd361d03bbcb82d7435412a9ef0ee 1 parent fde2f7d
@beerriot beerriot authored
Showing with 10 additions and 3 deletions.
  1. +10 −3 src/mapred_verify.erl
View
13 src/mapred_verify.erl
@@ -1,6 +1,7 @@
-module(mapred_verify).
-export([main/1]).
+-export([do_verification/1]).
-define(BUCKET, <<"mr_validate">>).
-define(PROP(K, L), proplists:get_value(K, L)).
@@ -10,7 +11,14 @@ main([]) ->
main(Args) ->
case setup_environment(Args) of
{ok, Props} ->
- do_verification(Props);
+ case do_verification(Props) of
+ Fails when is_integer(Fails) ->
+ %% exit 0 on success, non-zero on failure
+ erlang:halt(Fails);
+ _ ->
+ %% just shutdown normally when not running tests
+ ok
+ end;
error ->
usage()
end.
@@ -33,8 +41,7 @@ do_verification(Props) ->
case ?PROP(runjobs, Props) of
true ->
io:format("Verifying map/reduce jobs~n"),
- R = run_jobs(Client, ?BUCKET, KeyCount, ?PROP(testdef, Props)),
- erlang:halt(R);
+ run_jobs(Client, ?BUCKET, KeyCount, ?PROP(testdef, Props));
false ->
ok
end.
Please sign in to comment.
Something went wrong with that request. Please try again.