Skip to content

feat: add integration tests with docker-compose (#7)#20

Merged
mikkeldamsgaard merged 4 commits into
mainfrom
feature/integration-tests-7
Feb 24, 2026
Merged

feat: add integration tests with docker-compose (#7)#20
mikkeldamsgaard merged 4 commits into
mainfrom
feature/integration-tests-7

Conversation

@mikkeldamsgaard

Copy link
Copy Markdown
Contributor

Closes #7

Changes

  • 18 integration tests covering: wait-for (TCP/HTTP/timeout/multiple), render, fetch, exec, seed PostgreSQL/MySQL with cross-table refs, idempotency, reset, create database/schema, and 4 create-if-missing tests with known non-existing database names
  • tests/docker-compose.yml — Postgres 16, MySQL 8.0, nginx services
  • tests/fixtures/ — seed-postgres.yaml, seed-mysql.yaml, template.conf.tmpl
  • .github/workflows/integration.yml — CI workflow with service containers
  • Updated CHANGELOG.md and tests/README.md

How to verify

docker compose -f tests/docker-compose.yml up -d --wait
INTEGRATION=1 cargo test --test integration_test -- --test-threads=1
docker compose -f tests/docker-compose.yml down
cargo fmt --check
cargo clippy -- -D warnings
cargo test --all

All 29 tests pass (11 unit + 18 integration), clippy clean, fmt clean.

…er, fetch, exec, seed PostgreSQL/MySQL with cross-table refs, idempotency, reset, create database/schema, create-if-missing tests
Copilot AI review requested due to automatic review settings February 24, 2026 21:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive integration testing infrastructure using Docker Compose to test initium against real database services. It introduces 18 end-to-end tests covering all major commands (wait-for, render, fetch, exec, seed) with PostgreSQL 16, MySQL 8.0, and nginx services.

Changes:

  • Added 18 integration tests for wait-for (TCP/HTTP/timeout/multiple targets), render, fetch, exec, and seed operations with PostgreSQL and MySQL
  • Created Docker Compose configuration with Postgres 16, MySQL 8.0, and nginx services with health checks
  • Added separate GitHub Actions workflow for integration tests using service containers
  • Enhanced database interface to properly handle auto-increment ID columns in seed operations
  • Updated documentation with integration test instructions and test scenario table

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/integration_test.rs New integration test suite with 18 tests covering all major commands and database operations
tests/fixtures/template.conf.tmpl Template fixture for testing render command with environment variable substitution
tests/fixtures/seed-postgres.yaml PostgreSQL seed specification with cross-table references for testing seed functionality
tests/fixtures/seed-mysql.yaml MySQL seed specification with cross-table references for testing seed functionality
tests/docker-compose.yml Service definitions for Postgres, MySQL, and nginx with health checks on non-standard ports
tests/README.md Documentation for running unit and integration tests with scenario descriptions
src/seed/executor.rs Passes auto_id column name to database layer for proper ID retrieval
src/seed/db.rs Enhanced insert_row to accept auto_id_column parameter for RETURNING clause in PostgreSQL
CHANGELOG.md Documented new integration testing infrastructure and test coverage
.github/workflows/integration.yml CI workflow for integration tests with service containers

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mikkeldamsgaard mikkeldamsgaard merged commit 7fcbd8a into main Feb 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add integration tests with docker-compose

2 participants