Skip to content

Commit ec572c5

Browse files
committed
Adding yaml for job builder automation. Fixing up some timing issues in unit tests
1 parent e11c575 commit ec572c5

2 files changed

Lines changed: 55 additions & 6 deletions

File tree

build.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
python:
2+
- 2.7
3+
- 3.4
4+
os:
5+
- ubuntu/trusty64
6+
cassandra:
7+
- 1.2
8+
- 2.0
9+
- 2.1
10+
- 2.2
11+
- 3.0
12+
env:
13+
EVENT_LOOP_MANAGER:
14+
- libev
15+
CYTHON:
16+
- CYTHON
17+
- NO_CYTHON
18+
build:
19+
- script: |
20+
export JAVA_HOME=$CCM_JAVA_HOME
21+
export PATH=$JAVA_HOME/bin:$PATH
22+
23+
# Install dependencies
24+
if [[ $EVENT_LOOP_MANAGER == 'libev' ]]; then
25+
sudo apt-get install -y libev4 libev-dev
26+
fi
27+
pip install -r test-requirements.txt
28+
29+
30+
if [[ $CYTHON == 'CYTHON' ]]; then
31+
pip install cython
32+
pip install numpy
33+
# Install the driver & compile C extensions
34+
python setup.py build_ext --inplace
35+
else
36+
# Install the driver & compile C extensions with no cython
37+
python setup.py build_ext --inplace --no-cython
38+
fi
39+
40+
echo "==========RUNNING CQLENGINE TESTS=========="
41+
CASSANDRA_VERSION=$CCM_CASSANDRA_VERSION nosetests -s -v --with-xunit --xunit-file=cqle_results.xml tests/integration/cqlengine/ || true
42+
43+
echo "==========RUNNING INTEGRATION TESTS=========="
44+
CASSANDRA_VERSION=$CCM_CASSANDRA_VERSION nosetests -s -v --with-xunit --xunit-file=standard_results.xml tests/integration/standard/ || true
45+
46+
echo "==========RUNNING LONG INTEGRATION TESTS=========="
47+
CASSANDRA_VERSION=$CCM_CASSANDRA_VERSION nosetests -s -v --with-xunit --xunit-file=long_results.xml tests/integration/long/ || true
48+
- xunit:
49+
- "*_results.xml"

tests/integration/standard/test_metadata.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,12 +1793,12 @@ def setup_class(cls):
17931793
cls.cluster = Cluster(protocol_version=PROTOCOL_VERSION)
17941794
cls.keyspace_name = cls.__name__.lower()
17951795
cls.session = cls.cluster.connect()
1796-
cls.session.execute("CREATE KEYSPACE IF NOT EXISTS %s WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}" % cls.keyspace_name)
1796+
cls.session.execute("CREATE KEYSPACE %s WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}" % cls.keyspace_name)
17971797
cls.session.set_keyspace(cls.keyspace_name)
17981798

17991799
@classmethod
18001800
def teardown_class(cls):
1801-
cls.session.execute("DROP KEYSPACE IF EXISTS %s" % cls.keyspace_name)
1801+
cls.session.execute("DROP KEYSPACE %s" % cls.keyspace_name)
18021802
cls.cluster.shutdown()
18031803

18041804
def _run_on_all_nodes(self, query, params):
@@ -1821,8 +1821,8 @@ def test_keyspace_bad_options(self):
18211821
self._run_on_all_nodes('UPDATE system.schema_keyspaces SET strategy_options=%s' + where_cls, (strategy_options,))
18221822

18231823
def test_keyspace_bad_index(self):
1824-
self.session.execute('CREATE TABLE %s (k int PRIMARY KEY, v int)' % self.function_name)
1825-
self.session.execute('CREATE INDEX ON %s(v)' % self.function_name)
1824+
self.session.execute('CREATE TABLE %s (k int PRIMARY KEY, v int)' % self.function_name, timeout=30.0)
1825+
self.session.execute('CREATE INDEX ON %s(v)' % self.function_name, timeout=30.0)
18261826
where_cls = " WHERE keyspace_name='%s' AND columnfamily_name='%s' AND column_name='v'" \
18271827
% (self.keyspace_name, self.function_name)
18281828
index_options = self.session.execute('SELECT index_options FROM system.schema_columns' + where_cls)[0].index_options
@@ -1838,7 +1838,7 @@ def test_keyspace_bad_index(self):
18381838
self._run_on_all_nodes('UPDATE system.schema_columns SET index_options=%s' + where_cls, (index_options,))
18391839

18401840
def test_table_bad_comparator(self):
1841-
self.session.execute('CREATE TABLE %s (k int PRIMARY KEY, v int)' % self.function_name)
1841+
self.session.execute('CREATE TABLE %s (k int PRIMARY KEY, v int)' % self.function_name, timeout=30.0)
18421842
where_cls = " WHERE keyspace_name='%s' AND columnfamily_name='%s'" % (self.keyspace_name, self.function_name)
18431843
comparator = self.session.execute('SELECT comparator FROM system.schema_columnfamilies' + where_cls)[0].comparator
18441844
try:
@@ -1854,7 +1854,7 @@ def test_table_bad_comparator(self):
18541854

18551855
@unittest.skipUnless(PROTOCOL_VERSION >= 3, "Requires protocol version 3+")
18561856
def test_user_type_bad_typename(self):
1857-
self.session.execute('CREATE TYPE %s (i int, d double)' % self.function_name)
1857+
self.session.execute('CREATE TYPE %s (i int, d double)' % self.function_name, timeout=60.0)
18581858
where_cls = " WHERE keyspace_name='%s' AND type_name='%s'" % (self.keyspace_name, self.function_name)
18591859
field_types = self.session.execute('SELECT field_types FROM system.schema_usertypes' + where_cls)[0].field_types
18601860
try:

0 commit comments

Comments
 (0)