Skip to content
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
55 changes: 47 additions & 8 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,49 @@ schedules:
schedule: per_commit
branches:
include: [master, /python.*/]
env_vars: |
EVENT_LOOP_MANAGER='libev'

nightly_libev:
schedule: nightly
branches:
include: [master]
env_vars: |
EVENT_LOOP_MANAGER='libev'
matrix:
exclude:
- cassandra: ['2.0', '2.1', '2.2', '3.0']

nightly_gevent:
schedule: nightly
branches:
include: [master]
env_vars: |
EVENT_LOOP_MANAGER='gevent'
matrix:
exclude:
- pythoon: 3.4
- cassandra: ['2.0', '2.1', '2.2', '3.0']

nightly_eventlet:
schedule: nightly
branches:
include: [master]
env_vars: |
EVENT_LOOP_MANAGER='eventlet'
matrix:
exclude:
- cassandra: ['2.0', '2.1', '2.2', '3.0']

nightly_async:
schedule: nightly
branches:
include: [master]
env_vars: |
EVENT_LOOP_MANAGER='async'
matrix:
exclude:
- cassandra: ['2.0', '2.1', '2.2', '3.0']

python:
- 2.7
Expand All @@ -16,8 +59,6 @@ cassandra:
- '3.0'
- '3.11'
env:
EVENT_LOOP_MANAGER:
- libev
CYTHON:
- CYTHON
- NO_CYTHON
Expand All @@ -28,9 +69,7 @@ build:

pip install git+https://github.com/pcmanus/ccm.git
# Install dependencies
if [[ $EVENT_LOOP_MANAGER == 'libev' ]]; then
sudo apt-get install -y libev4 libev-dev
fi
sudo apt-get install -y libev4 libev-dev
pip install -r test-requirements.txt
pip install nose-ignore-docstring
FORCE_CYTHON=False
Expand All @@ -46,12 +85,12 @@ build:
fi

echo "==========RUNNING CQLENGINE TESTS=========="
CASSANDRA_VERSION=$CCM_CASSANDRA_VERSION VERIFY_CYTHON=$FORCE_CYTHON nosetests -s -v --logging-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --with-ignore-docstrings --with-xunit --xunit-file=cqle_results.xml tests/integration/cqlengine/ || true
EVENT_LOOP_MANAGER=$EVENT_LOOP_MANAGER CASSANDRA_VERSION=$CCM_CASSANDRA_VERSION VERIFY_CYTHON=$FORCE_CYTHON nosetests -s -v --logging-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --with-ignore-docstrings --with-xunit --xunit-file=cqle_results.xml tests/integration/cqlengine/ || true

echo "==========RUNNING INTEGRATION TESTS=========="
CASSANDRA_VERSION=$CCM_CASSANDRA_VERSION VERIFY_CYTHON=$FORCE_CYTHON nosetests -s -v --logging-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --with-ignore-docstrings --with-xunit --xunit-file=standard_results.xml tests/integration/standard/ || true
EVENT_LOOP_MANAGER=$EVENT_LOOP_MANAGER CASSANDRA_VERSION=$CCM_CASSANDRA_VERSION VERIFY_CYTHON=$FORCE_CYTHON nosetests -s -v --logging-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --with-ignore-docstrings --with-xunit --xunit-file=standard_results.xml tests/integration/standard/ || true

echo "==========RUNNING LONG INTEGRATION TESTS=========="
CASSANDRA_VERSION=$CCM_CASSANDRA_VERSION VERIFY_CYTHON=$FORCE_CYTHON nosetests -s -v --logging-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --with-ignore-docstrings --with-xunit --xunit-file=long_results.xml tests/integration/long/ || true
EVENT_LOOP_MANAGER=$EVENT_LOOP_MANAGER CASSANDRA_VERSION=$CCM_CASSANDRA_VERSION VERIFY_CYTHON=$FORCE_CYTHON nosetests -s -v --logging-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --with-ignore-docstrings --with-xunit --xunit-file=long_results.xml tests/integration/long/ || true
- xunit:
- "*_results.xml"
30 changes: 27 additions & 3 deletions tests/integration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,39 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os

from cassandra.io.geventreactor import GeventConnection
from cassandra.io.libevreactor import LibevConnection
from cassandra.io.asyncorereactor import AsyncoreConnection
from cassandra.io.eventletreactor import EventletConnection
from cassandra.io.twistedreactor import TwistedConnection

EVENT_LOOP_MANAGER = os.getenv('EVENT_LOOP_MANAGER', "gevent")
if EVENT_LOOP_MANAGER == "gevent":
import gevent.monkey
gevent.monkey.patch_all()
connection_class = GeventConnection
elif EVENT_LOOP_MANAGER == "eventlet":
from eventlet import monkey_patch
monkey_patch()
connection_class = EventletConnection
elif EVENT_LOOP_MANAGER == "async":
connection_class = AsyncoreConnection
elif EVENT_LOOP_MANAGER == "twisted":
connection_class = TwistedConnection
else:
connection_class = LibevConnection

from cassandra.cluster import Cluster
Cluster.connection_class = connection_class

try:
import unittest2 as unittest
except ImportError:
import unittest # noqa
from packaging.version import Version
import logging
import os
import socket
import sys
import time
Expand All @@ -30,9 +55,8 @@

from cassandra import OperationTimedOut, ReadTimeout, ReadFailure, WriteTimeout, WriteFailure, AlreadyExists, \
InvalidRequest
from cassandra.cluster import Cluster

from cassandra.protocol import ConfigurationException
from cassandra.policies import RoundRobinPolicy

try:
from ccmlib.cluster import Cluster as CCMCluster
Expand Down