Skip to content

Commit 7cf446e

Browse files
refactor: remove placeholder seed_sets from test specs and move inline seed specs to files
1 parent 20809e4 commit 7cf446e

12 files changed

Lines changed: 112 additions & 73 deletions

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
- Removed placeholder `seed_sets` from create-if-missing integration test YAML files; phases with only `create_if_missing` no longer need empty seed sets (`seed_sets` was already optional via `#[serde(default)]`)
12+
1013
### Added
1114
- 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
1215
- 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
1316
- `tests/docker-compose.yml` with Postgres, MySQL, and HTTP health-check server definitions
14-
- `tests/fixtures/` with seed spec files and template for integration tests
17+
- `tests/input/` with seed spec files and template for integration tests
1518
- Separate GitHub Actions workflow (`.github/workflows/integration.yml`) for integration tests with service containers
1619
- 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
1720
- `helm unittest` step added to CI helm-lint job with automatic plugin installation

tests/input/create-db-mysql.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
database:
2+
driver: mysql
3+
url_env: MYSQL_URL
4+
tracking_table: initium_seed
5+
6+
phases:
7+
- name: create_db
8+
order: 1
9+
database: initium_created_db
10+
create_if_missing: true
11+
seed_sets:
12+
- name: placeholder
13+
tables:
14+
- table: products
15+
rows: []
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
database:
2+
driver: postgres
3+
url_env: POSTGRES_URL
4+
tracking_table: initium_seed
5+
6+
phases:
7+
- name: create_db
8+
order: 1
9+
database: initium_created_db
10+
create_if_missing: true
11+
seed_sets:
12+
- name: placeholder
13+
tables:
14+
- table: departments
15+
rows: []
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
database:
2+
driver: mysql
3+
url_env: MYSQL_URL
4+
tracking_table: initium_seed
5+
6+
phases:
7+
- name: create_alpha
8+
order: 1
9+
database: initium_noexist_alpha
10+
create_if_missing: true
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
database:
2+
driver: postgres
3+
url_env: POSTGRES_URL
4+
tracking_table: initium_seed
5+
6+
phases:
7+
- name: create_alpha
8+
order: 1
9+
database: initium_noexist_alpha
10+
create_if_missing: true
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
database:
2+
driver: mysql
3+
url_env: MYSQL_URL
4+
tracking_table: initium_seed
5+
6+
phases:
7+
- name: create_beta
8+
order: 1
9+
database: initium_noexist_beta
10+
create_if_missing: true
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
database:
2+
driver: postgres
3+
url_env: POSTGRES_URL
4+
tracking_table: initium_seed
5+
6+
phases:
7+
- name: create_beta
8+
order: 1
9+
database: initium_noexist_beta
10+
create_if_missing: true
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
database:
2+
driver: postgres
3+
url_env: POSTGRES_URL
4+
tracking_table: initium_seed
5+
6+
phases:
7+
- name: create_schema
8+
order: 1
9+
schema: test_analytics
10+
create_if_missing: true
11+
seed_sets:
12+
- name: placeholder
13+
tables:
14+
- table: departments
15+
rows: []

0 commit comments

Comments
 (0)