Testing
Testing Reflow
Build confidence from one affected contract to the complete release-workflow suite.
python -m pytestCategory
Quick Command
python -m pytest [PATH] [OPTIONS]Overviewโ
The default pytest run enables strict configuration, coverage for app, short
tracebacks, and missing-line reporting. Tests must not depend on a contributor's
.config/reflow/config.toml, Git remotes, credentials, Docker registry, or
production repository.
Test Layers
Where Reflow Behavior Is Exercised
CLI
Configuration
Core Workflows
Developer Workflows
Focused Validation
# Repository targeting and configuration
python -m pytest tests/cli/test_repository_targeting.py
# Tag replacement behavior
python -m pytest tests/core/reflow/test_tag_replacement.py
# Dry-run boundaries
python -m pytest tests/core/dry_run
# One regression by node ID
python -m pytest tests/cli/test_error_handling.py::test_dockerize_total_failure_is_concise_and_unsuccessfulOn Windows, use a repository-local --basetemp when the system temporary
directory has inherited ACL problems.
What to Test
Before You Begin
- Repository targetRequired
Cover explicit CLI targets, configured targets, current-directory fallback, and path/URL conflicts.
- Mutation boundaryRequired
Prove dry-run performs no persistent local, remote, or registry mutation.
- Conversion planRequired
Cover both formats, collisions, signed tags, metadata preservation, confirmation, and atomic replacement.
- External failureRequired
Mock Git, GitHub CLI, Docker, and subprocess failures and assert concise remediation and nonzero exits.
- Configuration independenceRequired
Provide deterministic test configuration instead of reading a contributor-managed config file.
Pre-Commit Quality Gates
make pre-commit-validate
make pre-commit-run-staged
make pre-commit-runRepository-level exclusions and matching Ruff and Black exclusions protect archived, copied, deprecated, development, and temporary Python reference files even when tools receive explicit paths.
Complete Validation
# Complete tests and configured coverage
python -m pytest
# Black check, Ruff lint, then tests
make checkUse applicable Docker, Compose, package, documentation, or CLI --help checks
when the changed contract reaches those workflows. Do not push images, tags, or
releases as part of ordinary testing.