Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix search tests #154

Merged
merged 1 commit into from
Oct 24, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/riak_search_config.erl
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,11 @@ ensure_n_val_setting(Schema) ->
BucketProps = riak_core_bucket:get_bucket(BucketName),
NVal = Schema:n_val(),
CurrentNVal = proplists:get_value(n_val,BucketProps),
case NVal == CurrentNVal of
CurrentAllowMult = proplists:get_value(allow_mult, BucketProps),
case NVal =:= CurrentNVal andalso CurrentAllowMult =:= false of
true ->
ok;
false ->
riak_core_bucket:set_bucket(BucketName, [{n_val, NVal}])
riak_core_bucket:set_bucket(BucketName, [{n_val, NVal},
{allow_mult, false}])
end.
4 changes: 2 additions & 2 deletions src/riak_search_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ test_inner({solr_select, Params, Validators}, _Root) ->
test_inner({solr_select, Params, 200, Validators}, _Root);

test_inner({solr_select, Params, Expect, Validators}, _Root) ->
{Host, Port} = hd(app_helper:get_env(riak_core, http)),
{Host, Port} = hd(app_helper:get_env(riak_api, http)),
test_inner({solr_select, Host, Port, Params, Expect, Validators}, _Root);

test_inner({solr_select, Host, Port, Params, Validators}, _Root) ->
Expand Down Expand Up @@ -206,7 +206,7 @@ test_inner({solr_update, Path, Params}, Root) ->
inets:start(),
case file:read_file(filename:join(Root, Path)) of
{ok, Bytes} ->
{Hostname, Port} = hd(app_helper:get_env(riak_core, http)),
{Hostname, Port} = hd(app_helper:get_env(riak_api, http)),
QueryString = to_querystring(Params),
Url = io_lib:format("http://~s:~p/solr/~s/update?~s", [Hostname, Port, ?TEST_INDEX, QueryString]),
Req = {lists:flatten(Url), [], "text/xml", Bytes},
Expand Down