Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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
26 changes: 13 additions & 13 deletions bin/rtdev-setup-releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,24 @@ else
echo "No devdirs found. Not copying any releases."
fi

cd $RT_DEST_DIR
git init

## Some versions of git and/or OS require these fields
HAS_LOCAL=$(git config --local 2>&1 | grep unknown)
if [ -z "$HAS_LOCAL" ]; then
git config --local user.name "Riak Test"
git config --local user.email "[email protected]"
git config --local core.autocrlf input
git config --local core.safecrlf false
git config --local core.filemode true
fi
cd "$RT_DEST_DIR"
git init

# Set the path to the root of the working tree. This prevents git to
# ascend the directory tree (and possibly mess with other
# repositories). That is, changes we are going to make with `git
# config` will only affect the rt repo we have just created.
GIT_WORK_TREE="$RT_DEST_DIR"
git config user.name "Riak Test"
git config user.email "[email protected]"
git config core.autocrlf input
git config core.safecrlf false
git config core.filemode true

## this prevents priv/*.so files from being deleted by git clean -fd
## (the latter is executed in rtdev-current.sh):
echo "priv/" >.gitignore

git add --all --force .
git commit -a -m "riak_test init" > /dev/null

echo " - Successfully completed initial git commit of $RT_DEST_DIR"
2 changes: 1 addition & 1 deletion intercepts/riak_kv_qry_buffers_intercepts.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%% -------------------------------------------------------------------
%%
%% Copyright (c) 2016 Basho Technologies, Inc.
%% Copyright (c) 2016, 2017 Basho Technologies, Inc.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
Expand Down
10 changes: 1 addition & 9 deletions tests/ts_cluster_group_by_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ end_per_testcase(_TestCase, _Config) ->
groups() ->
[].

all() ->
all() ->
rt:grep_test_functions(?MODULE).

client_pid(Ctx) ->
Expand Down Expand Up @@ -115,11 +115,3 @@ group_by_2_test(Ctx) ->
{rt_ignore_columns, [{1,500.5},{2,500.5},{3,500.5}]},
{ok,{Cols, lists:sort(Rows)}}
).








26 changes: 19 additions & 7 deletions tests/ts_qbuf_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@

-export([
ack_query_error/3,
ack_query_error/4,
base_query/1,
base_query/2,
create_table/2,
full_query/2,
insert_data/3,
Expand Down Expand Up @@ -80,8 +82,10 @@ insert_data(C, Table, Data) ->
%% Form queries

base_query(Table) ->
fmt("select * from ~s where a = '~s' and b = '~s' and c >= ~b and c <= ~b",
[Table,
base_query(Table, "*").
base_query(Table, Select) ->
fmt("select ~s from ~s where a = '~s' and b = '~s' and c >= ~b and c <= ~b",
[Select, Table,
binary_to_list(?WHERE_FILTER_A),
binary_to_list(?WHERE_FILTER_B),
?TIMEBASE, ?TIMEBASE + ?LIFESPAN_EXTRA * 1000]).
Expand All @@ -108,18 +112,26 @@ make_orderby_with_qualifiers(F) ->


ack_query_error(Cfg, Query, ErrCode) ->
ack_query_error(Cfg, Query, ErrCode, <<".*">>).

ack_query_error(Cfg, Query, ExpErrCode, ExpErrMsgPat) ->
Node = hd(proplists:get_value(cluster, Cfg)),
C = rt:pbc(Node),
Res = riakc_ts:query(C, Query, [], undefined, []),
case Res of
{error, {ErrCode, ErrMsg}} ->
io:format("reported error ~s", [ErrMsg]),
ok;
{error, {ExpErrCode, GotErrMsg}} ->
case re:run(GotErrMsg, ExpErrMsgPat, []) of
{match, _} ->
ok;
nomatch ->
ct:pal("Query: ~s\nWrong reported error: ~s\n", [Query, GotErrMsg]),
fail
end;
{error, OtherReason} ->
io:format("error not correctly reported: got ~p instead", [OtherReason]),
ct:pal("Query: ~s\nError not correctly reported: got ~p instead\n", [Query, OtherReason]),
fail;
NonError ->
io:format("error not detected: got ~p instead", [NonError]),
ct:pal("Query: ~s\nError not detected: got ~p instead\n", [Query, NonError]),
fail
end.

Expand Down
1 change: 1 addition & 0 deletions tests/ts_qbuf_util.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
-define(ORDBY_COLS, ["a", "b", "c", "d", "e", undefined]).

%% error codes as defined in riak_kv_ts_svc.erl
-define(E_SUBMIT, 1001).
-define(E_SELECT_RESULT_TOO_BIG, 1022).
-define(E_QBUF_CREATE_ERROR, 1023).
-define(E_QBUF_LDB_ERROR, 1024).
Expand Down
Loading