QTZPOC-20: Implement .sientia model bundle import workflow Introduces a new Temporal workflow and activities to import .sientia model bundles. This enables: - Secure decryption and validation of bundles through a seven-gate process. - Provisioning imported models in MLflow and updating the MongoDB model listing. - Comprehensive status tracking in the public.experiment_run table with new IMPORT_SUCCESS/IMPORT_ERROR states. - Dedicated metrics, robust error handling, and configurable settings. - Includes updated e2e database fixtures and extensive unit/integration tests for bundle format, reader, and overall workflow.
35 lines
970 B
Python
35 lines
970 B
Python
"""Shared fixtures for the `.sientia` bundle tests."""
|
|
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
FIXTURE_DIR = Path(__file__).resolve().parents[3] / 'fixtures' / 'bundle'
|
|
GOLDEN_BUNDLE = FIXTURE_DIR / 'golden_model_v3.sientia'
|
|
GOLDEN_METADATA = FIXTURE_DIR / 'golden_model_v3.metadata.json'
|
|
# Recorded in tests/fixtures/bundle/README.md; the fixture protects nothing.
|
|
GOLDEN_PASSWORD = 'Import1Model!Fixture'
|
|
|
|
|
|
@pytest.fixture
|
|
def golden_bundle() -> Path:
|
|
"""The `.sientia` file the real producer emitted."""
|
|
assert GOLDEN_BUNDLE.is_file(), (
|
|
f'golden fixture missing: {GOLDEN_BUNDLE} — regenerate it with '
|
|
'tests/fixtures/bundle/regenerate.py'
|
|
)
|
|
return GOLDEN_BUNDLE
|
|
|
|
|
|
@pytest.fixture
|
|
def golden_password() -> str:
|
|
return GOLDEN_PASSWORD
|
|
|
|
|
|
@pytest.fixture
|
|
def work_dir(tmp_path: Path) -> Path:
|
|
"""A per-test stand-in for `IMPORT_WORK_DIR/<workflow_id>`."""
|
|
root = tmp_path / 'workflow-id'
|
|
root.mkdir()
|
|
return root
|