Skip to content

Commit 56e2ea2

Browse files
committed
setup new travis matrix
1 parent da90d81 commit 56e2ea2

File tree

9 files changed

+157
-23
lines changed

9 files changed

+157
-23
lines changed

.ci/travis-before-install.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
3+
echo "TRAVIS_OS_NAME = ${TRAVIS_OS_NAME}"
4+
5+
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
6+
curl -L https://packagecloud.io/tarantool/${TARANTOOL_VERSION}/gpgkey | sudo apt-key add -
7+
release=`lsb_release -c -s`
8+
sudo apt-get -y install apt-transport-https
9+
sudo rm -f /etc/apt/sources.list.d/*tarantool*.list
10+
echo "deb https://packagecloud.io/tarantool/${TARANTOOL_VERSION}/ubuntu/ $release main" | sudo tee /etc/apt/sources.list.d/tarantool_${TARANTOOL_VERSION}.list
11+
echo "deb-src https://packagecloud.io/tarantool/${TARANTOOL_VERSION}/ubuntu/ $release main" | sudo tee -a /etc/apt/sources.list.d/tarantool_${TARANTOOL_VERSION}.list
12+
sudo apt-get -qq update
13+
sudo apt-get -y install tarantool
14+
sudo tarantoolctl stop example || exit 0
15+
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
16+
if [[ "${TARANTOOL_VERSION}" == "1_7" ]]; then
17+
brew install tarantool --HEAD
18+
else
19+
brew install tarantool
20+
fi
21+
fi

.ci/travis-install.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
3+
set -e -x
4+
5+
if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
6+
echo "linux"
7+
elif [ "${TRAVIS_OS_NAME}" == "osx" ]; then
8+
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
9+
PYENV_ROOT="$HOME/.pyenv"
10+
PATH="$PYENV_ROOT/bin:$PATH"
11+
eval "$(pyenv init -)"
12+
13+
if ! (pyenv versions | grep "${PYTHON_VERSION}$"); then
14+
pyenv install ${PYTHON_VERSION}
15+
fi
16+
pyenv global ${PYTHON_VERSION}
17+
pyenv rehash
18+
fi
19+
20+
sudo pip install --upgrade pip wheel
21+
sudo pip install --upgrade setuptools
22+
pip install -r requirements.txt
23+
pip install coveralls
24+
pip install -e .

.ci/travis-tests.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
if [[ "${BUILD}" != *tests* ]]; then
4+
echo "Skipping tests."
5+
exit 0
6+
fi
7+
8+
if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
9+
PYENV_ROOT="$HOME/.pyenv"
10+
PATH="$PYENV_ROOT/bin:$PATH"
11+
eval "$(pyenv init -)"
12+
fi
13+
14+
if [[ "${BUILD}" == *quicktests* ]]; then
15+
make && make quicktest
16+
else
17+
make && make test
18+
make clean && make debug && make test
19+
fi

.travis.yml

Lines changed: 74 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,78 @@
11
language: python
2-
python:
3-
- 3.5
4-
- 3.5-dev
5-
- 3.6
6-
- 3.6-dev
7-
- 3.7-dev
8-
- nightly
2+
3+
matrix:
4+
fast_finish: true
5+
include:
6+
# osx
7+
- os: osx
8+
language: generic
9+
env: BUILD=tests PYTHON_VERSION=3.5.2 TARANTOOL_VERSION=1_6
10+
11+
- os: osx
12+
language: generic
13+
env: BUILD=tests PYTHON_VERSION=3.6.0 TARANTOOL_VERSION=1_6
14+
15+
- os: osx
16+
language: generic
17+
env: BUILD=tests PYTHON_VERSION=3.5.2 TARANTOOL_VERSION=1_7
18+
19+
- os: osx
20+
language: generic
21+
env: BUILD=tests PYTHON_VERSION=3.6.0 TARANTOOL_VERSION=1_7
22+
23+
# precise
24+
- os: linux
25+
dist: precise
26+
sudo: required
27+
language: python
28+
python: "3.5"
29+
env: BUILD=quicktests TARANTOOL_VERSION=1_6
30+
31+
- os: linux
32+
dist: precise
33+
sudo: required
34+
language: python
35+
python: "3.5"
36+
env: BUILD=quicktests TARANTOOL_VERSION=1_7
37+
38+
# trusty
39+
- os: linux
40+
dist: trusty
41+
sudo: required
42+
language: python
43+
python: "3.5"
44+
env: BUILD=quicktests TARANTOOL_VERSION=1_6
45+
46+
- os: linux
47+
dist: trusty
48+
sudo: required
49+
language: python
50+
python: "3.5"
51+
env: BUILD=quicktests TARANTOOL_VERSION=1_7
52+
53+
# latest tarantool
54+
- os: linux
55+
dist: trusty
56+
sudo: required
57+
language: python
58+
python: "3.5"
59+
env: BUILD=tests TARANTOOL_VERSION=1_7
60+
61+
- os: linux
62+
dist: trusty
63+
sudo: required
64+
language: python
65+
python: "3.6"
66+
env: BUILD=tests TARANTOOL_VERSION=1_7
67+
68+
cache:
69+
- pip
70+
971
before_install:
10-
- curl -L https://packagecloud.io/tarantool/1_7/gpgkey | sudo apt-key add -
11-
- release=`lsb_release -c -s`
12-
- sudo apt-get -y install apt-transport-https
13-
- sudo rm -f /etc/apt/sources.list.d/*tarantool*.list
14-
- echo "deb https://packagecloud.io/tarantool/1_7/ubuntu/ $release main" | sudo tee /etc/apt/sources.list.d/tarantool_1_7.list
15-
- echo "deb-src https://packagecloud.io/tarantool/1_7/ubuntu/ $release main" | sudo tee -a /etc/apt/sources.list.d/tarantool_1_7.list
16-
- sudo apt-get -qq update
17-
- sudo apt-get -y install tarantool
18-
- sudo tarantoolctl stop example
72+
- .ci/travis-before-install.sh
73+
1974
install:
20-
- pip install -r requirements.txt
21-
- pip install -e .
75+
- .ci/travis-install.sh
76+
2277
script:
23-
- make test
78+
- .ci/travis-tests.sh

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ test:
4141
$(PYTHON) -m unittest discover -s tests
4242
#USE_UVLOOP=1 $(PYTHON) -m unittest discover -s tests
4343

44+
quicktest:
45+
$(PYTHON) -m unittest discover -s tests
46+
4447

4548
test_16:
4649
TARANTOOL_DOCKER_VERSION=1.6 $(PYTHON) -m unittest discover -s tests

asynctnt/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from asynctnt.log import logger
1010

1111
__all__ = (
12-
'Connection', 'connect'
12+
'Connection', 'connect', 'ConnectionState'
1313
)
1414

1515

asynctnt/iproto/request.pyx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
cimport cython
12
from libc.stdint cimport uint64_t, int64_t
23

34
cimport tnt
45

56

7+
@cython.final
8+
@cython.freelist(_BUFFER_FREELIST_SIZE)
69
cdef class Request:
710
@staticmethod
811
cdef inline Request new(tnt.tp_request_type op,

tests/test_connect.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ async def test__connect_wait_tnt_started(self):
125125
coro = self.ensure_future(conn.connect())
126126
await self.sleep(0.3)
127127
await self.tnt.start()
128+
await self.sleep(1)
128129
await coro
129130
self.assertEqual(conn.state, ConnectionState.CONNECTED)
130131
await conn.disconnect()

tests/test_op_update.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
from asynctnt import Iterator
44
from asynctnt import Response
5-
from asynctnt.exceptions import TarantoolSchemaError
5+
from asynctnt.exceptions import TarantoolSchemaError, TarantoolDatabaseError, \
6+
ErrorCode
67
from tests import BaseTarantoolTestCase
78
from tests.util import get_complex_param
89

@@ -332,6 +333,13 @@ async def test__update_by_index_name_no_schema(self):
332333

333334
async def test__update_operations_none(self):
334335
data = await self._fill_data()
335-
res = await self.conn.update(self.TESTER_SPACE_NAME,
336-
[data[0][0]], None)
336+
try:
337+
res = await self.conn.update(self.TESTER_SPACE_NAME,
338+
[data[0][0]], None)
339+
except TarantoolDatabaseError as e:
340+
if self.conn.version < (1, 7):
341+
if e.code == ErrorCode.ER_ILLEGAL_PARAMS:
342+
# success
343+
return
344+
raise
337345
self.assertListEqual(res.body, [data[0]], 'empty operations')

0 commit comments

Comments
 (0)