Skip to content

Commit 52127c4

Browse files
author
Luke Bakken
committed
Switch to using dpkg for installing Riak, use 2.0.7 and 2.1.4
Skip preflist test if not supported update to latest tools Skip write once test if bucket type does not exist
1 parent dc6d55d commit 52127c4

File tree

6 files changed

+43
-31
lines changed

6 files changed

+43
-31
lines changed

.travis.yml

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,36 @@ sudo: required
22
dist: trusty
33
language: python
44
python:
5-
- '2.7'
6-
- '3.3'
7-
- '3.4'
8-
- '3.5'
9-
- nightly
5+
- '2.7'
6+
- '3.3'
7+
- '3.4'
8+
- '3.5'
9+
- nightly
1010
install:
11-
- pip install --upgrade flake8
11+
- pip install --upgrade flake8
1212
before_script:
13-
- sudo ./tools/travis-ci/riak-install
14-
- sudo ./tools/devrel/riak-cluster-config "$(which riak-admin)" 8098 false false
13+
- sudo ./tools/travis-ci/riak-install -d "$RIAK_DOWNLOAD_URL"
14+
- sudo ./tools/devrel/riak-cluster-config "$(which riak-admin)" 8098 false false
1515
env:
1616
matrix:
17-
- RIAK_TEST_PROTOCOL=pbc
18-
- RIAK_TEST_PROTOCOL=http
17+
- RIAK_TEST_PROTOCOL=pbc RIAK_DOWNLOAD_URL=http://s3.amazonaws.com/downloads.basho.com/riak/2.0/2.0.7/ubuntu/trusty/riak_2.0.7-1_amd64.deb
18+
- RIAK_TEST_PROTOCOL=http RIAK_DOWNLOAD_URL=http://s3.amazonaws.com/downloads.basho.com/riak/2.0/2.0.7/ubuntu/trusty/riak_2.0.7-1_amd64.deb
19+
- RIAK_TEST_PROTOCOL=pbc RIAK_DOWNLOAD_URL=http://s3.amazonaws.com/downloads.basho.com/riak/2.1/2.1.4/ubuntu/trusty/riak_2.1.4-1_amd64.deb
20+
- RIAK_TEST_PROTOCOL=http RIAK_DOWNLOAD_URL=http://s3.amazonaws.com/downloads.basho.com/riak/2.1/2.1.4/ubuntu/trusty/riak_2.1.4-1_amd64.deb
1921
global:
20-
- RIAK_TEST_PB_PORT=8087
21-
- RIAK_TEST_HTTP_PORT=8098
22-
- RUN_BTYPES=1
23-
- RUN_CLIENT=1
24-
- RUN_MAPREDUCE=1
25-
- RUN_KV=1
26-
- RUN_RESOLVE=1
27-
- RUN_YZ=1
28-
- RUN_DATATYPES=1
29-
- RUN_INDEXES=1
22+
- RIAK_TEST_PB_PORT=8087
23+
- RIAK_TEST_HTTP_PORT=8098
24+
- RUN_BTYPES=1
25+
- RUN_CLIENT=1
26+
- RUN_MAPREDUCE=1
27+
- RUN_KV=1
28+
- RUN_RESOLVE=1
29+
- RUN_YZ=1
30+
- RUN_DATATYPES=1
31+
- RUN_INDEXES=1
3032
script:
31-
- flake8 --exclude=riak/pb riak *.py
32-
- python setup.py test
33+
- flake8 --exclude=riak/pb riak *.py
34+
- python setup.py test
3335
notifications:
3436
slack:
3537
secure: kU1XcvTAliCWKuYpMWEMbD4qkbmlnWGLAIKbBQjtIh5ZRzISgjdUFzGcC31eHoQFv12LQdp5KAFj0Y1FyEvLxi0W8VeWKpsBGc06ntuECaN9MNHRBzKKclrTMGTfpBWZ5IO17XSUu2lKaNz6GDGRkiZA+sxYAVPfZSXY3u86IuY=

riak/tests/test_btypes.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,10 @@ def test_write_once_bucket_type(self):
155155
skey = 'write_once-init'
156156
btype = self.client.bucket_type(bt)
157157
bucket = btype.bucket(bt)
158-
sobj = bucket.get(skey)
158+
try:
159+
sobj = bucket.get(skey)
160+
except RiakError as e:
161+
raise unittest.SkipTest(e)
159162
if not sobj.exists:
160163
for i in range(100):
161164
o = bucket.new(self.key_name + str(i))

riak/tests/test_kv.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -616,16 +616,19 @@ def test_get_params(self):
616616
self.assertFalse(missing.exists)
617617

618618
def test_preflist(self):
619+
619620
bucket = self.client.bucket(self.bucket_name)
620621
bucket.new(self.key_name, data={"foo": "one",
621622
"bar": "baz"}).store()
622-
preflist = bucket.get_preflist(self.key_name)
623-
preflist2 = self.client.get_preflist(bucket, self.key_name)
624-
625-
for pref in (preflist, preflist2):
626-
self.assertEqual(len(pref), 3)
627-
self.assertIn(pref[0]['node'], nodes)
628-
[self.assertTrue(node['primary']) for node in pref]
623+
try:
624+
preflist = bucket.get_preflist(self.key_name)
625+
preflist2 = self.client.get_preflist(bucket, self.key_name)
626+
for pref in (preflist, preflist2):
627+
self.assertEqual(len(pref), 3)
628+
self.assertIn(pref[0]['node'], nodes)
629+
[self.assertTrue(node['primary']) for node in pref]
630+
except NotImplementedError as e:
631+
raise unittest.SkipTest(e)
629632

630633
def generate_siblings(self, original, count=5, delay=None):
631634
vals = []

riak/transports/http/transport.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,8 @@ def get_preflist(self, bucket, key):
770770
:type key: string
771771
:rtype: list of dicts
772772
"""
773+
if not self.preflists():
774+
raise NotImplementedError("fetching preflists is not supported.")
773775
bucket_type = self._get_bucket_type(bucket.bucket_type)
774776
url = self.preflist_path(bucket.name, key, bucket_type=bucket_type)
775777
status, headers, body = self._request('GET', url)

riak/transports/tcp/transport.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,8 @@ def get_preflist(self, bucket, key):
526526
:type key: string
527527
:rtype: list of dicts
528528
"""
529+
if not self.preflists():
530+
raise NotImplementedError("fetching preflists is not supported.")
529531
msg_code = riak.pb.messages.MSG_CODE_GET_BUCKET_KEY_PREFLIST_REQ
530532
codec = self._get_codec(msg_code)
531533
msg = codec.encode_get_preflist(bucket, key)

tools

Submodule tools updated 1 file

0 commit comments

Comments
 (0)