Skip to content

Commit 354a03e

Browse files
committed
Tests: Run integration tests against MS SQL Server only on Linux
1 parent c9ed8c2 commit 354a03e

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

omniload/main_test.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
from testcontainers.kafka import KafkaContainer # type: ignore
4444
from testcontainers.localstack import LocalStackContainer # type: ignore
4545
from testcontainers.mongodb import MongoDbContainer # type: ignore
46-
from testcontainers.mssql import SqlServerContainer # type: ignore
4746
from testcontainers.mysql import MySqlContainer # type: ignore
4847
from testcontainers.postgres import PostgresContainer # type: ignore
4948
from typer.testing import CliRunner
@@ -789,11 +788,6 @@ def mongodb_server():
789788
"postgres": pgDocker,
790789
"duckdb": EphemeralDuckDb(),
791790
"mysql8": mysqlDocker,
792-
"sqlserver": DockerImage(
793-
"sqlserver",
794-
lambda: SqlServerContainer(MSSQL22_IMAGE, dialect="mssql").start(),
795-
"?driver=ODBC+Driver+18+for+SQL+Server&TrustServerCertificate=Yes",
796-
),
797791
}
798792

799793
DESTINATIONS = {
@@ -802,6 +796,20 @@ def mongodb_server():
802796
"clickhouse+native": clickHouseDocker,
803797
}
804798

799+
if sys.platform == "linux":
800+
# [unixODBC][Driver Manager] Can't open lib 'ODBC Driver 18 for SQL Server' : file not found (0) (SQLDriverConnect)
801+
from testcontainers.mssql import SqlServerContainer # type: ignore
802+
803+
SOURCES.update(
804+
{
805+
"sqlserver": DockerImage(
806+
"sqlserver",
807+
lambda: SqlServerContainer(MSSQL22_IMAGE, dialect="mssql").start(),
808+
"?driver=ODBC+Driver+18+for+SQL+Server&TrustServerCertificate=Yes",
809+
)
810+
}
811+
)
812+
805813

806814
@pytest.fixture(scope="session", autouse=True)
807815
def manage_containers(request, shared_directory):

0 commit comments

Comments
 (0)