Skip to content

Commit 77dc6b3

Browse files
Pierre-Luc GagnéCopilot
andcommitted
chore(docker): remove init-db.sql — database and tables created by tests
The init-db.sql script created a symbol table never used by any test. The ds_mysql_test database is already created via the MYSQL_DATABASE env var. Each integration test now creates and drops its own tables via RAII scope_guard. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f155195 commit 77dc6b3

3 files changed

Lines changed: 0 additions & 46 deletions

File tree

tests/integration/docker/docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ services:
1010
ports:
1111
- "${DS_MYSQL_TEST_PORT:-3307}:3306"
1212
volumes:
13-
- ./init-db.sql:/docker-entrypoint-initdb.d/init.sql:ro
1413
- mysql_data:/var/lib/mysql
1514
healthcheck:
1615
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]

tests/integration/docker/docker_up.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,6 @@ echo "Waiting for MySQL to be ready..."
6161
for i in {1..60}; do
6262
if docker-compose -f "$COMPOSE_FILE" exec -T mysql mysqladmin ping -h localhost > /dev/null 2>&1; then
6363
echo "MySQL is ready"
64-
65-
# Apply init-db.sql unconditionally so seed data always exists,
66-
# even when the data volume was created before changes were added.
67-
# The script is idempotent (CREATE TABLE IF NOT EXISTS, INSERT IGNORE).
68-
echo "Applying init-db.sql..."
69-
docker-compose -f "$COMPOSE_FILE" exec -T mysql \
70-
mysql -u root -proot < "$ROOT_DIR/tests/integration/docker/init-db.sql"
71-
echo "Database initialisation complete"
7264
exit 0
7365
fi
7466
echo "Waiting... ($i/60)"

tests/integration/docker/init-db.sql

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)