Skip to content

Commit 1c15edd

Browse files
authored
FIX: do not create partitions in tests for postgres < 10 (#196)
1 parent 2563996 commit 1c15edd

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

lib/dl_connector_postgresql/dl_connector_postgresql_tests/db/api/test_data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def test_pg_citext_column(
104104
table = db.table_from_columns(
105105
[sa.Column(name="citext_value", type_=CITEXT)],
106106
)
107+
# TODO: clean up created tables after test finish
107108
db.create_table(table)
108109
db_table = DbTable(db=db, table=table) # type: ignore # TODO: fix
109110
db_table.insert(

lib/dl_connector_postgresql/dl_connector_postgresql_tests/db/core/test_adapter.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ async def test_tables_list(self, conn_bi_context: RequestContextInfo, target_con
2727
SchemaIdent(db_name="test_data", schema_name=None)
2828
)
2929

30-
assert [f"{t.schema_name}.{t.table_name}" for t in tables] == [
30+
assert [
31+
f"{t.schema_name}.{t.table_name}"
32+
for t in tables
33+
if t.schema_name != "public" # skip public schema because it contains garbage tables from other tests
34+
# TODO: clean up tables created in other tests
35+
] == [
3136
"test_data.sample",
3237
"test_data_partitions.sample_partition",
3338
]

lib/dl_connector_postgresql/docker-compose/Dockerfile.db-postgres-9.3

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ FROM postgres:9.3-alpine@sha256:028cb3bc3792c307a490864b5deecfaec9027cef4aad16d3
44

55
COPY db-postgres/data /common-data
66

7-
COPY db-postgres/initdb.d/* /docker-entrypoint-initdb.d/
7+
COPY db-postgres/initdb.d/01_prepare_db.sql /docker-entrypoint-initdb.d/

lib/dl_connector_postgresql/docker-compose/Dockerfile.db-postgres-9.4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ FROM postgres:9.4.26-alpine@sha256:b3ae2dad6f153711444221849919b98c0503e6eef57be
44

55
COPY db-postgres/data /common-data
66

7-
COPY db-postgres/initdb.d/* /docker-entrypoint-initdb.d/
7+
COPY db-postgres/initdb.d/01_prepare_db.sql /docker-entrypoint-initdb.d/

lib/dl_connector_postgresql/docker-compose/Dockerfile.db-postgres-9.4-ssl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ RUN chown 70:70 /etc/ssl/private/server.key && \
1515

1616
COPY db-postgres/data /common-data
1717

18-
COPY db-postgres/initdb.d/* /docker-entrypoint-initdb.d/
18+
COPY db-postgres/initdb.d/01_prepare_db.sql /docker-entrypoint-initdb.d/

0 commit comments

Comments
 (0)