Run PostgreSQL and Cassandra integration tests and deploy Compose stack
Docker test deployment / test-build-deploy (push) Failing after 8m35s
Docker test deployment / test-build-deploy (push) Failing after 8m35s
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
"""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()
|
||||
Reference in New Issue
Block a user