mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 13:52:15 +01:00
A coverage env (the native env with gcov counters) runs the native tests in CI; gcovr writes the HTML report and a table on the run's summary page. The web UI tests report coverage with Node's built-in coverage, and genhtml turns its lcov into HTML. Both reports are run artifacts, and pushes to main publish them to GitHub Pages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1.2 KiB
1.2 KiB
Testing instructions
- Fix any test or type errors until the whole suite is green.
- Add or update tests for the code you change, even if nobody asked.
- to test run
pio test -e native - the web UI's protocol 2 client (
data-src/js/):node --test "test/js/*.test.js". The minify step joins those files intoindex.js, so each one ends with amodule.exportsfooter for Node and adds nothing global but its classes. - coverage of the native tests:
pio test -e coverage, thengcovr(pip install gcovr), which readsgcovr.cfgand writescoverage/coverage_details.html. Files the native env doesn't build aren't in it. CI publishes the coverage ofmainto the repo's GitHub Pages. - coverage of the web UI tests: add
--experimental-test-coverage --test-coverage-include="data-src/js/**"to thenode --testcommand.
Building
- Firmware builds need pioarduino's Core (
pip install pioarduino, or the pioarduino IDE extension). Stock PlatformIO Core refuses the pinned platform, see ADR 0003. - The platform installs its Python packages into
~/.platformio/penvand fails on Windows whilepio.exefrom that env is running. Run builds aspython -m platformiofrom that env's Python.