This project has unit tests for the hub backend, firmware, and (in the future) UI.
Below is a quick reference table of the main documentation pages.
| Page | Description |
|---|---|
| What Sets it Apart | Why you should just do it yourself and the cost |
| MVP | High level project goals and summary |
| Status Tracker | Feature progress table |
| Unit Testing | Test and coverage instructions |
| Build It Yourself | Clone & Docker setup guide |
| Firmware | Firmware API reference |
| Hub Guide | Hub API reference |
| Communication Methods | Communication and architecture |
config_set_* and config_load helpers.usb_init() interface.jsdom environment with the Vue plugin loaded.ui/src/__tests__/setup.ts.ui/src/__tests__/CounterComponent.spec.ts.npm run test for a single pass.npm run test:watch while developing.# hub
cd pi
pip install -r requirements.txt
pytest --cov=pi --cov-report=term-missing --cov-report=html
# firmware
cd ../esp/esp32-cammycam
bash ../../tools/pio_coverage.sh
# ui
cd ../../ui
npm ci
npm run test
npm run test:coverage
The goal is to maintain at least 69.42% overall coverage across the project.
After running the commands above each component will generate an HTML report:
pi/htmlcov/index.html to see the coverage summary. The
settings for the Python collector live in coverage.ini.tools/pio_coverage.sh writes results to
esp/esp32-cammycam/coverage-report/index.html.ui/coverage/index.html.Keep the overall score above 69.42% to match the badge in the project README.
requirementDiagram
requirement Hub {
id: HUB_TESTS
text: pytest with coverage
risk: medium
verify: test
}
requirement Firmware {
id: FW_TESTS
text: PlatformIO unit tests
risk: medium
verify: test
}
requirement UI {
id: UI_TESTS
text: Vitest suite
risk: low
verify: test
}
testSuite overall {
requirement Hub
requirement Firmware
requirement UI
}