diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
new file mode 100644
index 0000000..80c39bd
--- /dev/null
+++ b/.github/workflows/integration.yml
@@ -0,0 +1,61 @@
+name: Integration Tests
+on:
+ workflow_dispatch:
+ push:
+ branches: [main]
+ pull_request:
+ branches: [main]
+permissions:
+ contents: read
+jobs:
+ integration:
+ runs-on: ubuntu-latest
+ services:
+ postgres:
+ image: postgres:16-alpine
+ env:
+ POSTGRES_USER: initium
+ POSTGRES_PASSWORD: initium
+ POSTGRES_DB: initium_test
+ ports:
+ - 15432:5432
+ options: >-
+ --health-cmd "pg_isready -U initium"
+ --health-interval 2s
+ --health-timeout 5s
+ --health-retries 10
+ mysql:
+ image: mysql:8.0
+ env:
+ MYSQL_ROOT_PASSWORD: rootpass
+ MYSQL_USER: initium
+ MYSQL_PASSWORD: initium
+ MYSQL_DATABASE: initium_test
+ ports:
+ - 13306:3306
+ options: >-
+ --health-cmd "mysqladmin ping -h localhost -u root -prootpass"
+ --health-interval 2s
+ --health-timeout 5s
+ --health-retries 15
+ http-server:
+ image: nginx:1-alpine
+ ports:
+ - 18080:80
+ options: >-
+ --health-cmd "wget --spider -q http://localhost:80/"
+ --health-interval 2s
+ --health-timeout 5s
+ --health-retries 5
+ steps:
+ - uses: actions/checkout@v4
+ - uses: dtolnay/rust-toolchain@stable
+ - uses: Swatinem/rust-cache@v2
+ - name: Install psql and mysql clients
+ run: |
+ sudo apt-get update -qq
+ sudo apt-get install -y -qq postgresql-client default-mysql-client
+ - name: Run integration tests
+ env:
+ INTEGRATION: "1"
+ run: cargo test --test integration_test -- --test-threads=1
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3f42f4c..f2eb6f9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
+- Integration tests with docker-compose for end-to-end testing against real Postgres 16, MySQL 8.0, and nginx services (`tests/integration_test.rs`): wait-for TCP/HTTP/timeout/multiple targets, render template, fetch HTTP, exec command, seed PostgreSQL and MySQL with cross-table reference verification, create database/schema, idempotency, and reset mode
+- Additional create-if-missing integration tests: 2 PostgreSQL and 2 MySQL tests using known non-existing database names (`initium_noexist_alpha`, `initium_noexist_beta`) to verify database creation, existence checks, and idempotent re-runs
+- `tests/docker-compose.yml` with Postgres, MySQL, and HTTP health-check server definitions
+- `tests/fixtures/` with seed spec files and template for integration tests
+- Separate GitHub Actions workflow (`.github/workflows/integration.yml`) for integration tests with service containers
- Helm chart unit tests using helm-unittest plugin (`charts/initium/tests/deployment_test.yaml`) covering deployment rendering, securityContext enforcement, disabled sampleDeployment, multiple initContainers, extraVolumes/extraVolumeMounts, image configuration, workdir mount, and labels
- `helm unittest` step added to CI helm-lint job with automatic plugin installation
- Duration unit support for all time parameters (`--timeout`, `--initial-delay`, `--max-delay`, seed phase `timeout`, seed wait-for `timeout`): accepts `ms`, `s`, `m`, `h` suffixes with decimal values (e.g. `1.5m`, `2.7s`) and combined units (e.g. `1m30s`, `2s700ms`, `18h36m4s200ms`); bare numbers default to seconds
diff --git a/src/seed/db.rs b/src/seed/db.rs
index 4d34d91..e8ba35d 100644
--- a/src/seed/db.rs
+++ b/src/seed/db.rs
@@ -8,6 +8,7 @@ pub trait Database: Send {
table: &str,
columns: &[String],
values: &[String],
+ auto_id_column: Option<&str>,
) -> Result