Problem
This repo has no CI. Getting it there is not one fix — the suite fails in five
independent layers, and each one hides the next. They are listed here in the
order they must be peeled, with what was measured at each step.
Why it matters now: app.MPPT depends on this repo from git, tracking
main (RIAPS/app.MPPT#127). A break here reaches the application on its next
lock refresh with nothing in between to catch it.
Layer 1 — conftest.py aborts all collection
tests/conftest.py, line 1:
from riaps.test_suite.fixtures.pytest_logger import testslogger
riaps.test_suite is not in this repo, and not in any sibling repo
(riaps-pycom, riaps-integration, app.MPPT, ...). It ships in the RIAPS
platform .deb on the dev VM. A conftest.py import failure aborts collection
of the entire suite, so nothing runs at all:
$ pip install -e ".[dev]" && pytest
ImportError while loading conftest '.../tests/conftest.py'
E ModuleNotFoundError: No module named 'riaps.test_suite'
Fix: guard the import and fall back to a plain fixture, or move it into a
conftest.py scoped to only the tests that need it.
Layer 2 — hardcoded absolute paths
Nine of them, all pointing at one machine's layout:
tests/test_interface.py:22 /home/riaps/projects/RIAPS/interface.modbus.libs/example/Minimal/cfg/Test_NEC-BESS1.yaml
tests/test_interface.py:28 .../example/Minimal/cfg/GEN1-Banshee.yaml
tests/test_interface.py:34 .../example/Minimal/cfg/F1PCC.yaml
tests/test_interface.py:40 .../example/simulator/modbus_cfg.yaml
tests/test_interface.py:41 .../example/simulator/device_cfg.yaml
tests/test_app.py:19 .../example/simulator/modbus_cfg.yaml
tests/test_app.py:20 .../example/simulator/device_cfg.yaml
tests/test_app.py:56 /home/riaps/projects/RIAPS/riaps-pycom/src/scripts
tests/test_app.py:62 .../example/Minimal
Every one of those files is in the repo — only the path is wrong. Making
them relative to __file__ is mechanical. (example/opal-single-feeder/read_opal.py:14
has the same problem, outside the test suite.)
With layers 1 and 2 neutralised, test_interface.py goes from 6 collection
errors to:
4 failed, 3 passed, 1 skipped
which exposes the next layer.
Layer 3 — the tests describe an older ModbusInterface API
This is the real work. Four failures, and they are not environmental:
FAILED test_create_interface - AttributeError: 'ModbusInterface' object has no attribute ...
FAILED test_create_slave - AssertionError: Slave not ...
FAILED test_write_read - KeyError: 'values'
FAILED test_opal_read - KeyError: 'values'
KeyError: 'values' twice suggests a changed return shape. Someone has to
decide whether the tests or the code are right — the tests have not run against
this code in a long time, so they are not automatically the source of truth.
test_interface.py:84 is also an unconditional skip with no reason given;
worth finding out whether it should be deleted or repaired.
Layer 4 — test_app.py needs the platform
from riaps.ctrl.ctrl import Controller
Platform-only, like layer 1. Skip-guard it behind an env var the way app.MPPT
guards its CET hardware tests (RUN_CET_HARDWARE) — off by default so the suite
is green on a runner, still runnable on the VM.
Layer 5 — test_modbustk.py times out
FAILED test_modbustk_execute - TimeoutError: timed out
Reaches something over the network that is not there. Needs either a local
simulator started by the test, or the same opt-in guard as layer 4.
Then, and only then
Add .github/workflows/tests.yml matching RIAPS/interface.mqtt#3 —
concurrency with cancel-in-progress and timeout-minutes to keep Actions
cost down.
Acceptance criteria
Not part of this
#4 (merged) declared the three missing runtime deps
(pyyaml, pyserial, pyzmq). Re-measured after that merge: it does not
change any layer above.
Context
Problem
This repo has no CI. Getting it there is not one fix — the suite fails in five
independent layers, and each one hides the next. They are listed here in the
order they must be peeled, with what was measured at each step.
Why it matters now:
app.MPPTdepends on this repo from git, trackingmain(RIAPS/app.MPPT#127). A break here reaches the application on its nextlock refresh with nothing in between to catch it.
Layer 1 —
conftest.pyaborts all collectiontests/conftest.py, line 1:riaps.test_suiteis not in this repo, and not in any sibling repo(
riaps-pycom,riaps-integration,app.MPPT, ...). It ships in the RIAPSplatform
.debon the dev VM. Aconftest.pyimport failure aborts collectionof the entire suite, so nothing runs at all:
Fix: guard the import and fall back to a plain fixture, or move it into a
conftest.pyscoped to only the tests that need it.Layer 2 — hardcoded absolute paths
Nine of them, all pointing at one machine's layout:
Every one of those files is in the repo — only the path is wrong. Making
them relative to
__file__is mechanical. (example/opal-single-feeder/read_opal.py:14has the same problem, outside the test suite.)
With layers 1 and 2 neutralised,
test_interface.pygoes from 6 collectionerrors to:
which exposes the next layer.
Layer 3 — the tests describe an older ModbusInterface API
This is the real work. Four failures, and they are not environmental:
KeyError: 'values'twice suggests a changed return shape. Someone has todecide whether the tests or the code are right — the tests have not run against
this code in a long time, so they are not automatically the source of truth.
test_interface.py:84is also an unconditionalskipwith no reason given;worth finding out whether it should be deleted or repaired.
Layer 4 —
test_app.pyneeds the platformPlatform-only, like layer 1. Skip-guard it behind an env var the way
app.MPPTguards its CET hardware tests (
RUN_CET_HARDWARE) — off by default so the suiteis green on a runner, still runnable on the VM.
Layer 5 —
test_modbustk.pytimes outReaches something over the network that is not there. Needs either a local
simulator started by the test, or the same opt-in guard as layer 4.
Then, and only then
Add
.github/workflows/tests.ymlmatching RIAPS/interface.mqtt#3 —concurrencywithcancel-in-progressandtimeout-minutesto keep Actionscost down.
Acceptance criteria
pytestcollects and runs on a clean machine with no RIAPS platformtests/or the code was wrong in each case
on the VM when explicitly enabled
main, and is greenNot part of this
#4 (merged) declared the three missing runtime deps
(
pyyaml,pyserial,pyzmq). Re-measured after that merge: it does notchange any layer above.
Context
stood in the way