Docs / Developer Test Suite

This page is a developer-focused guide to OpenTestability testing strategy, execution, and debugging.

1. Test suite goals

2. Test directory layout

tests/
|-- conftest.py
|-- fixtures/
|-- unit/
|   |-- core/
|   |-- parsers/
|   |-- testpoint/
|   |-- utils/
|   `-- yosys/
|-- integration/
|   `-- yosys_mode/
|-- system/
`-- benchmark/

Typical intent:

3. Marker map

Marker Purpose Typical command
smoke fastest confidence checks pytest tests/ -m smoke -v
slow large-design tests (>30s); excluded by default via addopts in pytest.ini pytest tests/ -m slow -v
integration cross-module behavior pytest tests/ -m integration -v
system end-to-end flow validation pytest tests/ -m system -v
yosys yosys mode specific tests pytest tests/ -m yosys -v

There is no unit marker: pytest tests/ -m unit -v silently selects zero tests. Unit tests are selected by path instead: pytest tests/unit/ -v.

4. Running tests locally

Linux/macOS workflow (on Windows, use WSL; or nix develop for a one-command shell):

cd <path-to>/OpenTestability
source venv/bin/activate

# All tests
pytest tests/ -v

# Fast loop during development
pytest tests/ -m smoke -v
pytest tests/unit/ -v

# Yosys-mode validation
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/unit/testpoint/ -v
pytest tests/integration/test_verbose_logging.py -v
pytest tests/system/test_s27.py -v
pytest tests/system/test_tpi_quality.py -v
  1. add or update unit tests close to changed logic
  2. add at least one integration test for the affected flow
  3. run the smoke marker and tests/unit/ first
  4. run full affected marker class (integration or system) before merge
  5. run the full integration suite when touching shared code

6. Fixtures and shared setup

7. Reports and artifacts during testing

Depending on test type and verbosity:

When writing tests, prefer temporary paths/fixtures to avoid polluting shared output directories.

8. Common failure patterns

9. Developer PR checklist