This directory contains comprehensive test suites for the Symphonic-Joules project.
The test suite validates GitHub Actions workflows and project configuration files with comprehensive coverage of structure, security, and best practices.
tests/workflows/test_blank_workflow.py - CI workflow validation (43 tests, 9 test classes)tests/workflows/test_jekyll_workflow.py - Jekyll/GitHub Pages deployment validation (72 tests, 15 test classes)tests/workflows/test_static_workflow.py - Static content deployment validation (75 tests, 16 test classes)tests/__init__.py - Test package initializationpytest.ini - Root-level test configurationtests/pytest.ini - Test-specific configuration with markerstests/requirements.txt - Test dependenciesTotal Tests: 190 across 40 test classes
Tests for .github/workflows/blank.yml - CI workflow
Validates YAML syntax and basic structure
Tests workflow name and trigger configuration
Critical: Validates ‘main’ branch configuration
Validates job definitions and runner configuration
Validates individual workflow steps and actions
Validates documentation and badge references
Tests YAML formatting and consistency
Validates security best practices
Tests file location and permissions
Tests for .github/workflows/jekyll-gh-pages.yml - Jekyll site deployment
Validates YAML syntax, structure, and GitHub Pages-specific sections
Tests workflow naming conventions for Jekyll deployment
Validates push and workflow_dispatch triggers
Tests OIDC permissions for secure GitHub Pages deployment
Validates concurrency control for production deployments
Tests build and deploy job definitions
Comprehensive validation of Jekyll build process
Tests deployment job configuration and dependencies
Validates OIDC authentication and security best practices
Tests YAML formatting and edge cases
Validates documentation quality
Tests for .github/workflows/static.yml - Static content deployment
Validates YAML syntax and GitHub Pages sections
Tests descriptive workflow naming
Validates trigger configuration (push, workflow_dispatch)
Tests minimal permissions following least privilege principle
Validates production deployment concurrency control
Tests single deploy job architecture
Tests deploy job environment and configuration
Comprehensive validation of deployment steps
Validates OIDC, minimal permissions, and injection prevention
Tests YAML formatting, empty steps, and consistency
Validates documentation and clarity
Validates appropriate differences from Jekyll workflow
# Run all tests with verbose output
python3 -m pytest tests/ -v
# Run with coverage report
python3 -m pytest tests/ -v --cov=.github/workflows --cov-report=html
# Run blank workflow tests
python3 -m pytest tests/workflows/test_blank_workflow.py -v
# Run Jekyll workflow tests
python3 -m pytest tests/workflows/test_jekyll_workflow.py -v
# Run static workflow tests
python3 -m pytest tests/workflows/test_static_workflow.py -v
# Run branch configuration tests (blank workflow)
python3 -m pytest tests/workflows/test_blank_workflow.py::TestBranchConfiguration -v
# Run security tests (Jekyll workflow)
python3 -m pytest tests/workflows/test_jekyll_workflow.py::TestWorkflowSecurity -v
# Run permissions tests (static workflow)
python3 -m pytest tests/workflows/test_static_workflow.py::TestPermissionsConfiguration -v
# Run only workflow tests
python3 -m pytest -m workflows -v
# Run only unit tests
python3 -m pytest -m unit -v
# Run integration tests
python3 -m pytest -m integration -v
# Run all security-related tests
python3 -m pytest -k security -v
# Run all permission-related tests
python3 -m pytest -k permission -v
# Run all edge case tests
python3 -m pytest -k edge -v
The following pytest markers are available:
@pytest.mark.workflows - Marks tests as workflow tests@pytest.mark.integration - Marks tests as integration tests@pytest.mark.unit - Marks tests as unit testsInstall test dependencies with:
pip install -r tests/requirements.txt
Required packages:
All test suites use module-scoped fixtures to cache expensive operations:
This improves test performance significantly (single parse per module vs. per test).
Tests cover:
test_<what>_<expected_behavior>These tests are designed to run in CI/CD pipelines:
# Example GitHub Actions workflow step
- name: Run Tests
run: |
pip install -r tests/requirements.txt
pytest tests/ -v --tb=short
All 190 tests pass successfully, validating:
When adding new tests:
Planned additions: