Skip to content

Commit 63f943b

Browse files
author
Brett Hazen
committed
Merge remote-tracking branch 'origin/riak_ts-develop' into bch-merge-ts-1.6-to-develop
2 parents 39846b5 + ccf2b5b commit 63f943b

26 files changed

+665
-86
lines changed

basho_builds.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
docker_rt_riak_test_config:
2+
- version: current
3+
product_version: current
4+
product: "riak_ts{% if ee == 'true' %}_ee{% endif %}"
5+
- version: previous
6+
product_version: 1.5.2
7+
product: "riak_ts{% if ee == 'true' %}_ee{% endif %}"
8+
- version: legacy
9+
product_version: 1.4.1
10+
product: "riak_ts{% if ee == 'true' %}_ee{% endif %}"
11+
- version: 2.0.2
12+
product_version: 2.0.2
13+
product: "riak{% if ee == 'true' %}_ee{% endif %}"
14+
- version: 2.0.4
15+
product_version: 2.0.4
16+
product: "riak{% if ee == 'true' %}_ee{% endif %}"
17+
- version: 2.0.5
18+
product_version: 2.0.5
19+
product: "riak{% if ee == 'true' %}_ee{% endif %}"

bin/rtdev-install.sh

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,17 @@ cd $RT_DEST_DIR
4646

4747
echo " - Reinitializing git state"
4848

49-
## Some versions of git and/or OS require these fields
50-
HAS_LOCAL=$(git config --local 2>&1 | grep unknown)
51-
if [ -z "$HAS_LOCAL" ]; then
52-
git config --local user.name "Riak Test"
53-
git config --local user.email "dev@basho.com"
54-
git config --local core.autocrlf input
55-
git config --local core.safecrlf false
56-
git config --local core.filemode true
57-
fi
49+
# Set the path to the root of the working tree. This prevents git to
50+
# ascend the directory tree (and possibly mess with other
51+
# repositories). That is, changes we are going to make with `git
52+
# config` will only affect the rt repo we have just created.
53+
GIT_WORK_TREE="$RT_DEST_DIR"
54+
git config user.name "Riak Test"
55+
git config user.email "dev@basho.com"
56+
git config core.autocrlf input
57+
git config core.safecrlf false
58+
git config core.filemode true
59+
5860

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

bin/rtdev-setup-releases.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,24 @@ else
3535
echo "No devdirs found. Not copying any releases."
3636
fi
3737

38-
cd $RT_DEST_DIR
39-
git init
40-
41-
## Some versions of git and/or OS require these fields
42-
HAS_LOCAL=$(git config --local 2>&1 | grep unknown)
43-
if [ -z "$HAS_LOCAL" ]; then
44-
git config --local user.name "Riak Test"
45-
git config --local user.email "dev@basho.com"
46-
git config --local core.autocrlf input
47-
git config --local core.safecrlf false
48-
git config --local core.filemode true
49-
fi
38+
cd "$RT_DEST_DIR"
39+
git init
40+
41+
# Set the path to the root of the working tree. This prevents git to
42+
# ascend the directory tree (and possibly mess with other
43+
# repositories). That is, changes we are going to make with `git
44+
# config` will only affect the rt repo we have just created.
45+
GIT_WORK_TREE="$RT_DEST_DIR"
46+
git config user.name "Riak Test"
47+
git config user.email "dev@basho.com"
48+
git config core.autocrlf input
49+
git config core.safecrlf false
50+
git config core.filemode true
5051

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

5556
git add --all --force .
5657
git commit -a -m "riak_test init" > /dev/null
57-
5858
echo " - Successfully completed initial git commit of $RT_DEST_DIR"

intercepts/riak_kv_qry_buffers_intercepts.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
%% -------------------------------------------------------------------
22
%%
3-
%% Copyright (c) 2016 Basho Technologies, Inc.
3+
%% Copyright (c) 2016, 2017 Basho Technologies, Inc.
44
%%
55
%% This file is provided to you under the Apache License,
66
%% Version 2.0 (the "License"); you may not use this file

tests/bucket_types.erl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
confirm() ->
99
application:start(inets),
1010
lager:info("Deploy some nodes"),
11+
12+
%% Allow listing of buckets and keys for testing
13+
application:set_env(riakc, allow_listing, true),
14+
1115
Nodes = rt:build_cluster(4, [], [
1216
{riak_core, [{default_bucket_props,
1317
[

tests/http_security.erl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
-define(assertDenied(Op), ?assertMatch({error, {forbidden, _}}, Op)).
1212

1313
confirm() ->
14+
%% Allow listing of buckets and keys for testing
15+
application:set_env(riakc, allow_listing, true),
16+
1417
application:start(crypto),
1518
application:start(asn1),
1619
application:start(public_key),

tests/overload.erl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
%% -------------------------------------------------------------------
22
%%
3-
%% Copyright (c) 2013 Basho Technologies, Inc.
3+
%% Copyright (c) 2013-2017 Basho Technologies, Inc.
44
%%
55
%% This file is provided to you under the Apache License,
66
%% Version 2.0 (the "License"); you may not use this file
@@ -81,6 +81,9 @@ default_config(#config{
8181
{riak_api, [{pb_backlog, 1024}]}].
8282

8383
confirm() ->
84+
%% Allow listing of buckets and keys for testing
85+
application:set_env(riakc, allow_listing, true),
86+
8487
[Node1 | _] = Nodes = setup(),
8588

8689
ok = create_bucket_type(Nodes, ?NORMAL_TYPE, [{n_val, 3}]),

tests/pb_security.erl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
-define(assertDenied(Op), ?assertMatch({error, <<"Permission",_/binary>>}, Op)).
1212

1313
confirm() ->
14+
%% Allow listing of buckets and keys for testing
15+
application:set_env(riakc, allow_listing, true),
16+
1417
application:start(crypto),
1518
application:start(asn1),
1619
application:start(public_key),

tests/rolling_capabilities.erl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
%% -------------------------------------------------------------------
22
%%
3-
%% Copyright (c) 2012 Basho Technologies, Inc.
3+
%% Copyright (c) 2012-2017 Basho Technologies, Inc.
44
%%
55
%% This file is provided to you under the Apache License,
66
%% Version 2.0 (the "License"); you may not use this file
@@ -23,6 +23,9 @@
2323
-include_lib("eunit/include/eunit.hrl").
2424

2525
confirm() ->
26+
%% Allow listing of buckets and keys for testing
27+
application:set_env(riakc, allow_listing, true),
28+
2629
TestMetaData = riak_test_runner:metadata(),
2730
Count = 4,
2831
OldVsn = proplists:get_value(upgrade_version, TestMetaData, previous),

tests/ts_cluster_capabilities_SUITE.erl

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
%% -------------------------------------------------------------------
22
%%
3-
%% Copyright (c) 2016 Basho Technologies, Inc.
3+
%% Copyright (c) 2016-2017 Basho Technologies, Inc.
44
%%
55
%% This file is provided to you under the Apache License,
66
%% Version 2.0 (the "License"); you may not use this file
@@ -30,19 +30,13 @@
3030
%%--------------------------------------------------------------------
3131

3232
-define(TS_VERSION_CURRENT, "current").
33-
34-
%% git checkout riak_ts-1.3.1 && make locked-deps
35-
-define(TS_VERSION_1_3, riak_ts_1_3_1).
36-
3733
-define(SQL_SELECT_CAP, {riak_kv, sql_select_version}).
3834

3935
suite() ->
4036
[{timetrap,{minutes,10}}].
4137

4238
init_per_suite(Config) ->
43-
Versions = rt:find_version_by_name(["riak_ts-1.3.1", "riak_ts_ee-1.3.1"]),
44-
Vsn131 = maybe_missing_1_3_1(Versions),
45-
[{?TS_VERSION_1_3, Vsn131} | Config].
39+
Config.
4640

4741
end_per_suite(_Config) ->
4842
ok.
@@ -143,21 +137,19 @@ capability_not_specified_on_one_node_test(_Ctx) ->
143137
%% Riak TS Capability Tests
144138
%%--------------------------------------------------------------------
145139

146-
sql_select_upgrade_a_node_from_1_3_test(Config) ->
147-
Vsn131 = ?config(?TS_VERSION_1_3, Config),
140+
sql_select_upgrade_a_node_from_legacy_test(_Ctx) ->
148141
[Node_A, Node_B, Node_C] =
149-
rt:deploy_nodes([Vsn131, Vsn131, Vsn131]),
142+
rt:deploy_nodes([legacy, legacy, legacy]),
150143
ok = rt:join_cluster([Node_A,Node_B,Node_C]),
151144
ok = rt:wait_until_ring_converged([Node_A,Node_B,Node_C]),
152145
ok = rt:upgrade(Node_A, ?TS_VERSION_CURRENT),
153146
ok = rt:wait_until_ring_converged([Node_A,Node_B,Node_C]),
154-
ok = rt:wait_until_capability(Node_A, ?SQL_SELECT_CAP, v1),
147+
ok = rt:wait_until_capability(Node_A, ?SQL_SELECT_CAP, v2),
155148
ok.
156149

157-
sql_select_join_with_all_nodes_upgraded_test(Config) ->
158-
Vsn131 = ?config(?TS_VERSION_1_3, Config),
150+
sql_select_join_with_all_nodes_upgraded_test(_Ctx) ->
159151
[Node_A, Node_B, Node_C] =
160-
rt:deploy_nodes([Vsn131, Vsn131, Vsn131]),
152+
rt:deploy_nodes([legacy, legacy, legacy]),
161153
ok = rt:join_cluster([Node_A,Node_B,Node_C]),
162154
rt:wait_until_ring_converged([Node_A,Node_B,Node_C]),
163155
rt:upgrade(Node_A, ?TS_VERSION_CURRENT),
@@ -168,18 +160,14 @@ sql_select_join_with_all_nodes_upgraded_test(Config) ->
168160
rt:wait_until_capability(Node_C, ?SQL_SELECT_CAP, v3),
169161
ok.
170162

171-
%% This test passed for 1.4.0, expecting v1 where commented, but fails for 1.5.0 due to code change. We set it to expect
172-
%% v3 until future changes are made. After 1.5.0 if this test will fail if new code is introduced to handle capability
173-
%% communication. https://bashoeng.atlassian.net/browse/RTS-1415
174-
sql_select_downgrade_a_node_test(Config) ->
175-
Vsn131 = ?config(?TS_VERSION_1_3, Config),
163+
sql_select_downgrade_a_node_test(_Ctx) ->
176164
[Node_A, Node_B, Node_C] =
177-
rt:deploy_nodes([Vsn131, ?TS_VERSION_CURRENT, ?TS_VERSION_CURRENT]),
165+
rt:deploy_nodes([legacy, ?TS_VERSION_CURRENT, ?TS_VERSION_CURRENT]),
178166
ok = rt:join_cluster([Node_A,Node_B,Node_C]),
179167
rt:wait_until_ring_converged([Node_A,Node_B,Node_C]),
180168
% rt:wait_until_capability(Node_A, ?SQL_SELECT_CAP, v3),
181-
rt:wait_until_capability(Node_B, ?SQL_SELECT_CAP, v1),
182-
rt:wait_until_capability(Node_C, ?SQL_SELECT_CAP, v1),
169+
rt:wait_until_capability(Node_B, ?SQL_SELECT_CAP, v2),
170+
rt:wait_until_capability(Node_C, ?SQL_SELECT_CAP, v2),
183171
rt:upgrade(Node_A, ?TS_VERSION_CURRENT),
184172
rt:wait_until_ring_converged([Node_A,Node_B,Node_C]),
185173
rt:wait_until_capability(Node_A, ?SQL_SELECT_CAP, v3),
@@ -189,8 +177,8 @@ sql_select_downgrade_a_node_test(Config) ->
189177
%% pending changes to how capabilities are communicated around the ring, this
190178
%% section will expect v2. Once capabilities are changed in a future version of riak
191179
%% (or if testing 1.4.0 as current)
192-
%% the expected version should go back to v1.
193-
rt:upgrade(Node_A, Vsn131),
180+
%% the expected version should go back to v2.
181+
rt:upgrade(Node_A, legacy),
194182
rt:wait_until_ring_converged([Node_A,Node_B,Node_C]),
195183
rt:wait_until_capability(Node_B, ?SQL_SELECT_CAP, v3),
196184
rt:wait_until_capability(Node_C, ?SQL_SELECT_CAP, v3),
@@ -200,10 +188,9 @@ sql_select_downgrade_a_node_test(Config) ->
200188
%% Perform queries in mixed version cluster
201189
%%--------------------------------------------------------------------
202190

203-
query_in_mixed_version_cluster_test(Config) ->
204-
Vsn131 = ?config(?TS_VERSION_1_3, Config),
191+
query_in_mixed_version_cluster_test(_Ctx) ->
205192
[Node_A, Node_B, Node_C] =
206-
rt:deploy_nodes([?TS_VERSION_CURRENT, Vsn131, ?TS_VERSION_CURRENT]),
193+
rt:deploy_nodes([?TS_VERSION_CURRENT, previous, ?TS_VERSION_CURRENT]),
207194
ok = rt:join_cluster([Node_A,Node_B,Node_C]),
208195
rt:wait_until_ring_converged([Node_A,Node_B,Node_C]),
209196
Table = "grouptab1",
@@ -220,7 +207,7 @@ query_in_mixed_version_cluster_test(Config) ->
220207
[{1,1,B*C} || B <- lists:seq(1,10), C <- lists:seq(1000,5000,1000)]),
221208
ExpectedResultSet = [{N} || N <- lists:seq(1000,5000,1000)],
222209
%%
223-
%% Test that the current version can query version 1.3
210+
%% Test that the current version can query older version
224211
%%
225212
Query =
226213
"SELECT c FROM grouptab1 "
@@ -232,17 +219,11 @@ query_in_mixed_version_cluster_test(Config) ->
232219
{ok,{Cols, Rows}}
233220
),
234221
%%
235-
%% Test that the 1.3 can query the current version
222+
%% Test that the previous can query the current version
236223
%%
237224
{ok, {Cols, Rows}} = run_query(rt:pbc(Node_B), Query),
238225
ts_data:assert_row_sets(
239226
{rt_ignore_columns, ExpectedResultSet},
240227
{ok,{Cols, Rows}}
241228
).
242229

243-
%% If 1.3.1 is not found, use a meaningful atom to prompt the error message
244-
%% rtdev:check_version/1
245-
maybe_missing_1_3_1([]) ->
246-
missing_version_ts_1_3_1;
247-
maybe_missing_1_3_1([Vsn]) ->
248-
Vsn.

0 commit comments

Comments
 (0)