This page is a developer-focused guide to OpenTestability testing strategy, execution, and debugging.
1. Test suite goals
- protect metric correctness across COP, SCOAP, reconvergence, and TPI paths
- prevent regressions across both
--genusand--yosysmodes - keep quick confidence checks available for daily development
- provide deeper end-to-end validation before major merges
2. Test directory layout
tests/
|-- conftest.py
|-- fixtures/
|-- unit/
| |-- core/
| |-- yosys/
| `-- utils/
|-- integration/
| |-- genus_mode/
| `-- yosys_mode/
`-- system/
Typical intent:
unit/: fast isolated checks for functions and small modulesintegration/: behavior across module boundaries and mode workflowssystem/: full end-to-end flows against known benchmark designs
3. Marker map
| Marker | Purpose | Typical command |
|---|---|---|
smoke |
fastest confidence checks | pytest tests/ -m smoke -v |
unit |
isolated module logic | pytest tests/ -m unit -v |
integration |
cross-module behavior | pytest tests/ -m integration -v |
system |
end-to-end flow validation | pytest tests/ -m system -v |
genus |
genus mode specific tests | pytest tests/ -m genus -v |
yosys |
yosys mode specific tests | pytest tests/ -m yosys -v |
4. Running tests locally
WSL/Linux workflow:
cd /mnt/c/Users/Potato/Desktop/OpenTestability
source venv/bin/activate
# All tests
pytest tests/ -v
# Fast loop during development
pytest tests/ -m smoke -v
pytest tests/ -m unit -v
# Mode-specific validation
pytest tests/ -m genus -v
pytest tests/ -m yosys -v
Useful targeted runs:
pytest tests/unit/utils/test_logging_config.py -v
pytest tests/unit/utils/test_session_manager.py -v
pytest tests/integration/test_verbose_logging.py -v
pytest tests/system/test_s27.py -v
5. Recommended workflow for new changes
- add or update unit tests close to changed logic
- add at least one integration test for the affected flow (
--genusor--yosys) - run marker subsets first (
smoke,unit) - run full affected marker class (
integrationorsystem) before merge - confirm no mode-specific regressions by running both
genusandyosysmarkers when touching shared code
6. Fixtures and shared setup
tests/conftest.pyholds shared fixtures and common setup hookstests/fixtures/stores reusable test data and helpers- keep fixtures deterministic and small so CI and local runs stay stable
7. Reports and artifacts during testing
Depending on test type and verbosity:
- pytest summary is printed to terminal
.pytest_cache/stores local test cache metadata- verbose OpenTest runs can generate logs in
results/log/ - verbose OpenTest runs can generate reports in
results/reports/ - metrics or generated netlists may appear in
data/results/,data/TPI/, oroutput/
When writing tests, prefer temporary paths/fixtures to avoid polluting shared output directories.
8. Common failure patterns
- mode mismatch: input format does not match active mode (
--genusvs--yosys) - missing environment setup: virtualenv not activated or dependency missing
- path assumptions: hardcoded paths instead of project utilities
- flaky output comparisons: assertions tied to non-deterministic ordering or timestamps
9. Developer PR checklist
- tests added/updated for changed behavior
- relevant marker subsets pass locally
- no regressions in both modes for shared-code changes
- docs updated for user-visible behavior changes
- generated artifacts are either ignored or intentionally tracked