From ec572c518cce960034403b62b29edf0e5ce27e9c Mon Sep 17 00:00:00 2001 From: GregBestland Date: Fri, 14 Aug 2015 12:00:20 -0500 Subject: [PATCH] Adding yaml for job builder automation. Fixing up some timing issues in unit tests --- build.yaml | 49 +++++++++++++++++++++ tests/integration/standard/test_metadata.py | 12 ++--- 2 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 build.yaml diff --git a/build.yaml b/build.yaml new file mode 100644 index 00000000..6a395828 --- /dev/null +++ b/build.yaml @@ -0,0 +1,49 @@ +python: + - 2.7 + - 3.4 +os: + - ubuntu/trusty64 +cassandra: + - 1.2 + - 2.0 + - 2.1 + - 2.2 + - 3.0 +env: + EVENT_LOOP_MANAGER: + - libev + CYTHON: + - CYTHON + - NO_CYTHON +build: + - script: | + export JAVA_HOME=$CCM_JAVA_HOME + export PATH=$JAVA_HOME/bin:$PATH + + # Install dependencies + if [[ $EVENT_LOOP_MANAGER == 'libev' ]]; then + sudo apt-get install -y libev4 libev-dev + fi + pip install -r test-requirements.txt + + + if [[ $CYTHON == 'CYTHON' ]]; then + pip install cython + pip install numpy + # Install the driver & compile C extensions + python setup.py build_ext --inplace + else + # Install the driver & compile C extensions with no cython + python setup.py build_ext --inplace --no-cython + fi + + echo "==========RUNNING CQLENGINE TESTS==========" + CASSANDRA_VERSION=$CCM_CASSANDRA_VERSION nosetests -s -v --with-xunit --xunit-file=cqle_results.xml tests/integration/cqlengine/ || true + + echo "==========RUNNING INTEGRATION TESTS==========" + CASSANDRA_VERSION=$CCM_CASSANDRA_VERSION nosetests -s -v --with-xunit --xunit-file=standard_results.xml tests/integration/standard/ || true + + echo "==========RUNNING LONG INTEGRATION TESTS==========" + CASSANDRA_VERSION=$CCM_CASSANDRA_VERSION nosetests -s -v --with-xunit --xunit-file=long_results.xml tests/integration/long/ || true + - xunit: + - "*_results.xml" \ No newline at end of file diff --git a/tests/integration/standard/test_metadata.py b/tests/integration/standard/test_metadata.py index b7c86071..621f3b31 100644 --- a/tests/integration/standard/test_metadata.py +++ b/tests/integration/standard/test_metadata.py @@ -1793,12 +1793,12 @@ class BadMetaTest(unittest.TestCase): cls.cluster = Cluster(protocol_version=PROTOCOL_VERSION) cls.keyspace_name = cls.__name__.lower() cls.session = cls.cluster.connect() - cls.session.execute("CREATE KEYSPACE IF NOT EXISTS %s WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}" % cls.keyspace_name) + cls.session.execute("CREATE KEYSPACE %s WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}" % cls.keyspace_name) cls.session.set_keyspace(cls.keyspace_name) @classmethod def teardown_class(cls): - cls.session.execute("DROP KEYSPACE IF EXISTS %s" % cls.keyspace_name) + cls.session.execute("DROP KEYSPACE %s" % cls.keyspace_name) cls.cluster.shutdown() def _run_on_all_nodes(self, query, params): @@ -1821,8 +1821,8 @@ class BadMetaTest(unittest.TestCase): self._run_on_all_nodes('UPDATE system.schema_keyspaces SET strategy_options=%s' + where_cls, (strategy_options,)) def test_keyspace_bad_index(self): - self.session.execute('CREATE TABLE %s (k int PRIMARY KEY, v int)' % self.function_name) - self.session.execute('CREATE INDEX ON %s(v)' % self.function_name) + self.session.execute('CREATE TABLE %s (k int PRIMARY KEY, v int)' % self.function_name, timeout=30.0) + self.session.execute('CREATE INDEX ON %s(v)' % self.function_name, timeout=30.0) where_cls = " WHERE keyspace_name='%s' AND columnfamily_name='%s' AND column_name='v'" \ % (self.keyspace_name, self.function_name) index_options = self.session.execute('SELECT index_options FROM system.schema_columns' + where_cls)[0].index_options @@ -1838,7 +1838,7 @@ class BadMetaTest(unittest.TestCase): self._run_on_all_nodes('UPDATE system.schema_columns SET index_options=%s' + where_cls, (index_options,)) def test_table_bad_comparator(self): - self.session.execute('CREATE TABLE %s (k int PRIMARY KEY, v int)' % self.function_name) + self.session.execute('CREATE TABLE %s (k int PRIMARY KEY, v int)' % self.function_name, timeout=30.0) where_cls = " WHERE keyspace_name='%s' AND columnfamily_name='%s'" % (self.keyspace_name, self.function_name) comparator = self.session.execute('SELECT comparator FROM system.schema_columnfamilies' + where_cls)[0].comparator try: @@ -1854,7 +1854,7 @@ class BadMetaTest(unittest.TestCase): @unittest.skipUnless(PROTOCOL_VERSION >= 3, "Requires protocol version 3+") def test_user_type_bad_typename(self): - self.session.execute('CREATE TYPE %s (i int, d double)' % self.function_name) + self.session.execute('CREATE TYPE %s (i int, d double)' % self.function_name, timeout=60.0) where_cls = " WHERE keyspace_name='%s' AND type_name='%s'" % (self.keyspace_name, self.function_name) field_types = self.session.execute('SELECT field_types FROM system.schema_usertypes' + where_cls)[0].field_types try: