Testing
The test suite covers unit behavior, CLI workflows, and local git fixtures.
Required Checks
Run these before opening a pull request:
cargo fmt --check
cargo clippy --all-targets -- -D warnings
cargo test --all-targets
python3 scripts/check_docs.py
python3 scripts/speckit_sync_issues.py --feature-dir tests/fixtures/speckit-sync-feature --dry-run
python3 scripts/generate_release_docs.py v0.0.0 --output-dir target/release-docs-test
PYTHONDONTWRITEBYTECODE=1 python3 scripts/test_automation.pyUnit and Integration Tests
cargo test --all-targetsIntegration tests create local temporary git repositories. They do not require network access.
Coverage
CI runs cargo tarpaulin --fail-under 95 as the coverage gate. To run it locally:
cargo install cargo-tarpaulin
cargo tarpaulin --fail-under 95Generate an HTML report:
cargo tarpaulin --out HtmlDocumentation Checks
python3 scripts/check_docs.pyThe docs check validates:
- Root and
docs/Markdown links. - JSON fenced code blocks.
- Documented
ktcommand examples. - Stale links to old repository names or generated spec quickstarts.
Release Script Checks
python3 scripts/generate_release_docs.py v0.0.0 --output-dir target/release-docs-testThis verifies the release-note generator can handle a first-release style tag when no previous tag exists.
Automation Helper Tests
PYTHONDONTWRITEBYTECODE=1 python3 scripts/test_automation.pyThese tests cover Speckit task parsing, safe checkbox pull behavior, GitHub Project ambiguity handling, release asset tables, installer dry-run decisions, and workflow expectations.