Files
codex-bot 7fa2609191
Docker test deployment / test-build-deploy (push) Failing after 8m35s
Run PostgreSQL and Cassandra integration tests and deploy Compose stack
2026-09-16 03:51:34 +08:00

21 lines
643 B
Python

"""Initialize the single-datacenter test cluster using the checked-in CQL schema."""
import os
from pathlib import Path
from cassandra.cluster import Cluster
cluster = Cluster([os.getenv("CASSANDRA_HOST", "cassandra")], connect_timeout=10)
try:
session = cluster.connect()
schema = Path("/app/deploy/cassandra.cql").read_text()
schema = "\n".join(
line for line in schema.splitlines() if not line.startswith("--")
)
for statement in schema.split(";"):
if statement.strip():
session.execute(statement, timeout=30)
print("Cassandra test schema initialized")
finally:
cluster.shutdown()