Skip to content

Commit bc4a08e

Browse files
committed
SA14/Tests: Add cratedb-version query parameter to satisfy machinery
Some tests are specifically testing situations with older releases of corresponding software components. For example, there are tests validating specific behaviour going back to CrateDB 1.x. In order to satisfy those tests, a corresponding version string has to be seeded. SQLAlchemy 1.4 accepts database connection URIs without hostname, like `crate://?cratedb-version=4.3.2`. However, this does not work for older SQLAlchemy releases, so let's use the most common denominator, like `crate://cratedb.example.org/?cratedb-version=4.3.2`.
1 parent 475ec2d commit bc4a08e

File tree

6 files changed

+11
-6
lines changed

6 files changed

+11
-6
lines changed

DEVELOP.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ Run all tests::
3333

3434
Run specific tests::
3535

36-
# Ignore all tests below src/crate/testing
36+
./bin/test -vvvv -t SqlAlchemyCompilerTest
37+
./bin/test -vvvv -t test_score
38+
./bin/test -vvvv -t sqlalchemy
39+
40+
Ignore specific test directories::
41+
3742
./bin/test -vvvv --ignore_dir=testing
3843

3944
You can run the tests against multiple Python interpreters with tox_::

src/crate/client/sqlalchemy/tests/array_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
class SqlAlchemyArrayTypeTest(TestCase):
4040

4141
def setUp(self):
42-
self.engine = sa.create_engine('crate://')
42+
self.engine = sa.create_engine('crate://cratedb.example.org/?cratedb-version=4.3.2')
4343
Base = declarative_base(bind=self.engine)
4444
self.metadata = sa.MetaData()
4545

src/crate/client/sqlalchemy/tests/bulk_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
class SqlAlchemyBulkTest(TestCase):
3838

3939
def setUp(self):
40-
self.engine = sa.create_engine('crate://')
40+
self.engine = sa.create_engine('crate://cratedb.example.org/?cratedb-version=4.3.2')
4141
Base = declarative_base(bind=self.engine)
4242

4343
class Character(Base):

src/crate/client/sqlalchemy/tests/datetime_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def dst(self, date_time):
5353
class SqlAlchemyDateAndDateTimeTest(TestCase):
5454

5555
def setUp(self):
56-
self.engine = sa.create_engine('crate://')
56+
self.engine = sa.create_engine('crate://cratedb.example.org/?cratedb-version=4.3.2')
5757
Base = declarative_base(bind=self.engine)
5858

5959
class Character(Base):

src/crate/client/sqlalchemy/tests/dict_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class SqlAlchemyDictTypeTest(TestCase):
4141

4242
def setUp(self):
4343
# Need to set an appropriate server version.
44-
self.engine = sa.create_engine('crate:///?cratedb-version=4.3.2')
44+
self.engine = sa.create_engine('crate://cratedb.example.org/?cratedb-version=4.3.2')
4545
metadata = sa.MetaData()
4646
self.mytable = sa.Table('mytable', metadata,
4747
sa.Column('name', sa.String),

src/crate/client/sqlalchemy/tests/update_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
class SqlAlchemyUpdateTest(TestCase):
4242

4343
def setUp(self):
44-
self.engine = sa.create_engine('crate://')
44+
self.engine = sa.create_engine('crate://cratedb.example.org/?cratedb-version=4.3.2')
4545
self.base = declarative_base(bind=self.engine)
4646

4747
class Character(self.base):

0 commit comments

Comments
 (0)