Skip to content

Commit

Permalink
Merge pull request #93 from bruin-data/fix/skip-test-clickhouse
Browse files Browse the repository at this point in the history
Enable mysql source in test
  • Loading branch information
sanjushahgupta authored Jan 26, 2025
2 parents a7d6f2d + dceb744 commit e9e9d8d
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions ingestr/main_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from testcontainers.localstack import LocalStackContainer # type: ignore
from testcontainers.postgres import PostgresContainer # type: ignore
from typer.testing import CliRunner
from testcontainers.mysql import MySqlContainer # type: ignore

from ingestr.main import app
from ingestr.src.appstore.errors import (
Expand Down Expand Up @@ -447,7 +448,6 @@ def start(self) -> str:
url = super().start()
if self.container is None:
raise ValueError("Container is not initialized.")

port = self.container.get_exposed_port(8123)
return (
url.replace("clickhouse://", "clickhouse+native://") + f"?http_port={port}"
Expand Down Expand Up @@ -478,12 +478,12 @@ def stop_fully(self):
clickHouseDocker = ClickhouseDockerImage(
lambda: ClickHouseContainer(CLICKHOUSE_IMAGE).start()
)
mysqlDocker = DockerImage(lambda: MySqlContainer(MYSQL8_IMAGE, username="root").start())

SOURCES = {
"postgres": pgDocker,
"duckdb": DuckDb(),
# "mysql8": DockerImage(
# lambda: MySqlContainer(MYSQL8_IMAGE, username="root").start()
# ),
"mysql8": mysqlDocker,
# "sqlserver": DockerImage(
# lambda: SqlServerContainer(MSSQL22_IMAGE, dialect="mssql").start(),
# "?driver=ODBC+Driver+18+for+SQL+Server&TrustServerCertificate=Yes",
Expand All @@ -497,7 +497,6 @@ def stop_fully(self):
"clickhouse+native": clickHouseDocker,
}


@pytest.fixture(scope="session", autouse=True)
def manage_containers():
# Run all tests
Expand Down Expand Up @@ -528,9 +527,6 @@ def test_create_replace(source, dest):
source_uri = source_future.result()
dest_uri = dest_future.result()

print(f"source_uri: {source_uri}")
print(f"dest_uri: {dest_uri}")

db_to_db_create_replace(source_uri, dest_uri)
source.stop()
dest.stop()
Expand Down Expand Up @@ -1203,7 +1199,7 @@ def test_kafka_to_db(dest):
with ThreadPoolExecutor() as executor:
dest_future = executor.submit(dest.start)
source_future = executor.submit(
KafkaContainer("confluentinc/cp-kafka:7.6.0").start, timeout=60
KafkaContainer("confluentinc/cp-kafka:7.6.0").start, timeout=120
)
dest_uri = dest_future.result()
kafka = source_future.result()
Expand Down

0 comments on commit e9e9d8d

Please sign in to comment.