Metadata-Version: 2.4
Name: snowflake-snowconvert-testing-orchestration
Version: 0.2.60
Summary: Capture and validate stored procedure baselines during database migrations to Snowflake
Project-URL: Source code, https://github.com/snowflake-eng/migrations-testing-orchestration/
Project-URL: Bug Tracker, https://github.com/snowflake-eng/migrations-testing-orchestration/issues
Author-email: "Snowflake, Inc." <snowflake-python-libraries-dl@snowflake.com>
License: Snowflake Conversion Software Terms
Keywords: Snowflake,database,migration,snowconvert,stored-procedures,testing,validation
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: SQL
Classifier: Topic :: Database
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.10
Requires-Dist: dependency-injector
Requires-Dist: duckdb>=0.10
Requires-Dist: jinja2>=3.1
Requires-Dist: pyyaml
Requires-Dist: snowflake-code-unit-registry==0.4.13
Requires-Dist: snowflake-data-validation[all]==1.3.6.dev131
Requires-Dist: tomli>=1.1.0; python_version < '3.11'
Provides-Extra: dev
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Description-Content-Type: text/markdown

# snowflake-snowconvert-testing-orchestration

Capture and validate stored procedure baselines during database migrations to Snowflake. Part of the [SnowConvert](https://www.snowflake.com/en/data-cloud/snowconvert/) migration toolchain.

## What it does

When migrating stored procedures from SQL Server, Oracle, or other platforms to Snowflake, this tool automates the verification process:

1. **Capture** -- Execute stored procedures on the source database and save their results as baseline files.
2. **Validate** -- Execute the same procedures on Snowflake and compare the results against the captured baselines.
3. **Report** -- Generate detailed validation reports covering schema, metrics, and row-level comparisons.

## Installation

```bash
pip install snowflake-snowconvert-testing-orchestration
```

## Quick start

### Capture baselines from source

```bash
test-runner capture --project-root /path/to/project
```

### Validate on Snowflake

```bash
test-runner validate --project-root /path/to/project -c my_snowflake_connection
```

## Configuration

Create a `settings/test_config.yaml` in your project directory:

```yaml
source_platform: sqlserver
target_platform: snowflake

validation_configuration:
  schema_validation: true
  metrics_validation: true
  row_validation: true
```

Connections are resolved at runtime from TOML files (`~/.snowflake/snowct/<dialect>.toml` for source, `~/.snowflake/config.toml` for target) or via CLI flags (`--source-connection`, `--connection`).

Define test cases for each procedure in `artifacts/<database>/<schema>/procedure/<Name>/test/<name>.yml`:

```yaml
validation:
  source:
    steps:
      run: |-
        EXECUTE testdb.dbo.GetAllProducts
  target:
    steps:
      run: |-
        CALL TESTDB.DBO.GETALLPRODUCTS()
  test_cases:
    - []
```

## Library usage

```python
from test_runner import create_container, run_capture, run_validate

container = create_container("my_project")
config = container.config()
registry = container.factory_registry()

capture_stats = run_capture(config=config, factory_registry=registry, project_root="my_project")
validate_stats = run_validate(config=config, factory_registry=registry, project_root="my_project")
```

## Requirements

- Python >= 3.10
- Access to a source database (SQL Server, Oracle, etc.)
- A Snowflake account with SnowSQL or connector configuration

## Related packages

- [snowflake-data-validation](https://pypi.org/project/snowflake-data-validation/) -- Data validation framework for Snowflake migrations

## License

Snowflake Conversion Software Terms
