Config-driven pytest framework for data migration validation and environment promotion validation.
- Session-scoped source/target connections (prevents repeated Snowflake Okta browser prompts).
- Dynamic metadata discovery for tables, columns, and primary keys.
- Flow-based execution: migration (
SQL Server -> Snowflake) and promotion (env -> env). - Global check profiles + app-specific overrides.
- App-specific ETL/business rules per flow.
- JSON report artifact per run.
configs/
shared/
check_profiles.yaml
apps/
<app>.yaml
- Install dependencies:
cd migration_test_framework
python3 -m venv .venv
source .venv/bin/activate
pip install -e .- Copy sample app config and update placeholders:
cp configs/apps/sample_app.yaml configs/apps/<your_app>.yaml- Run migration flow (single env):
pytest --app <your_app> --flow migrate_sql_to_snowflake --env dev- Run promotion flow (env to env):
pytest --app <your_app> --flow promote_snowflake --left-env dev --right-env test- Migration smoke run over small subset:
pytest --app <your_app> --flow migrate_sql_to_snowflake --env dev --max-tables 10 -m smoke- Promotion quick validation test -> stg:
pytest --app <your_app> --flow promote_snowflake --left-env test --right-env stg- Override check profile at runtime:
pytest --app <your_app> --flow promote_snowflake --left-env stg --right-env prod --check-profile promotion_quickKeep global test behavior for migration/promotion here.
Each app file defines:
flows: how left/right systems are pairedenvironments: endpoint details per env (dev/test/stg/prod)table_selection: include/exclude/mappingsrulesets: app-specific ETL/business validations- optional
check_profiles: app override of shared defaults
- Use
authenticator: externalbrowserin Snowflake connections. - Connections are
pytestsession-scoped, so browser auth happens once per run. - If using
pytest -n N, each worker process may open its own auth session.
Each run writes JSON report to:
reports/<app>_<flow>_<left_env>_to_<right_env>_migration_report.json
A FastAPI-based browser UI for searching docs, generating app configs, and running tests.
- Install playground dependencies:
cd migration_test_framework
source .venv/bin/activate
pip install -r mcp/requirements.txt- Install playground dependencies:
cd migration_test_framework
py -3.12 -m pip install -r mcp/requirements.txtmacOS:
python3.12 mcp/playground.pyWindows:
py -3.12 mcp/playground.pyThen open: http://localhost:8000
- Go to Index & Search tab → click Index Docs
- Expected:
Indexed XXXX chunks from X files [sentence-transformers] - Model (~90MB) downloads automatically and caches at
~/.cache/huggingface/hub/— no re-download on subsequent runs
- Python 3.12 required
- Semantic search uses
sentence-transformers/all-MiniLM-L6-v2(understands meaning, not just keywords)
- Do not commit real credentials in
configs/apps/*.yaml. - Keep real secrets in local-only files like
configs/apps/<app>_local.yaml(already gitignored). - Keep generated reports local (
reports/is gitignored). - Prefer Snowflake
externalbrowserlocally until CI service auth is available.