Phase 2: Fragment Migration - Migrated 42 ingredients to 54 fine-grained fragments - Replaced %include with %ksappend syntax - Created organized fragment structure (platform/generic-43, platform/generic-rawhide, shared/) - Updated generator to use fragment paths - All 16 manifest variants generate successfully Phase 3: Testing Infrastructure - Created containerized test runner (tests/container/) - Added integration test suite (tests/integration/) - Created golden master fixtures (tests/fixtures/expected_recipes/) - 41 tests passing (36 unit + 5 integration) - 54 fragments, 16 recipes validated Phase 4: CI/CD Integration - 5 new workflows: validate-recipes, validate-fragments, test-generation, container-tests, build-iso - Added validation gates before ISO builds - Works with existing fedora-runner-image - Local testing support via act_runner
52 lines
1.3 KiB
Python
52 lines
1.3 KiB
Python
"""Pytest fixtures and shared utilities for Phyllome OS integration tests."""
|
|
|
|
import pytest
|
|
from pathlib import Path
|
|
import sys
|
|
|
|
# Find project root (3 levels up from integration tests)
|
|
PROJECT_ROOT = Path(__file__).resolve().parent.parent.parent
|
|
SCRIPTS_DIR = PROJECT_ROOT / 'scripts'
|
|
sys.path.insert(0, str(SCRIPTS_DIR))
|
|
|
|
|
|
@pytest.fixture
|
|
def generator():
|
|
"""Create RecipeGenerator instance."""
|
|
from generate_recipe import RecipeGenerator
|
|
|
|
ingredients_dir = PROJECT_ROOT / 'ingredients'
|
|
templates_file = PROJECT_ROOT / 'scripts' / 'recipe_templates.yaml'
|
|
|
|
return RecipeGenerator(ingredients_dir, templates_file)
|
|
|
|
|
|
@pytest.fixture
|
|
def project_root():
|
|
"""Return project root directory."""
|
|
return PROJECT_ROOT
|
|
|
|
|
|
@pytest.fixture
|
|
def fragments_dir(project_root):
|
|
"""Return fragments directory."""
|
|
return project_root / 'fragments'
|
|
|
|
|
|
@pytest.fixture
|
|
def recipes_dir(project_root):
|
|
"""Return recipes directory."""
|
|
return project_root / 'recipes'
|
|
|
|
|
|
@pytest.fixture
|
|
def fragments(fragments_dir):
|
|
"""List all .ks fragment files."""
|
|
return list(fragments_dir.glob('**/*.ks'))
|
|
|
|
|
|
@pytest.fixture
|
|
def expected_recipes_dir(project_root):
|
|
"""Return expected recipes directory for golden masters."""
|
|
return project_root / 'tests' / 'fixtures' / 'expected_recipes'
|