Context
Several farm/core/ modules are optional or UI-heavy (Tk, training loops, benchmarks) and are omitted from the coverage report in .coveragerc.
This issue tracks targeted coverage for that peripheral core surface without duplicating tests already present for environment, action, decision, etc.
Scope (paths)
farm/core/visualization.py (Tk + matplotlib; may need headless/Xvfb in CI or heavy mocking)
farm/core/cli.py
farm/core/simulation.py, farm/core/analysis.py, farm/core/interfaces.py
farm/core/device_utils.py, farm/core/observation_render.py, farm/core/senses.py
farm/core/services/factory.py
farm/core/decision/algorithms/ensemble.py, tianshou.py
farm/core/decision/feature_engineering.py
farm/core/decision/benchmark/runner.py
farm/core/decision/training/collector.py, trainer.py
Suggested approach
- Prefer small pure-function tests and mocked dependencies (torch, tkinter, gym spaces) over full GUI tests where possible.
- Align with existing
tests/decision/ patterns; skip or xfail only where upstream library bugs already block tests (see current skips in test_tianshou_wrapper.py).
Acceptance criteria
- Meaningful line coverage on the above modules or explicit decision to keep specific files omitted with rationale in
.coveragerc comments.
- If omit list shrinks, re-run
pytest --cov=farm --cov-config=.coveragerc --cov-fail-under=90.
Context
Several
farm/core/modules are optional or UI-heavy (Tk, training loops, benchmarks) and are omitted from the coverage report in.coveragerc.This issue tracks targeted coverage for that peripheral core surface without duplicating tests already present for
environment,action,decision, etc.Scope (paths)
farm/core/visualization.py(Tk + matplotlib; may need headless/Xvfb in CI or heavy mocking)farm/core/cli.pyfarm/core/simulation.py,farm/core/analysis.py,farm/core/interfaces.pyfarm/core/device_utils.py,farm/core/observation_render.py,farm/core/senses.pyfarm/core/services/factory.pyfarm/core/decision/algorithms/ensemble.py,tianshou.pyfarm/core/decision/feature_engineering.pyfarm/core/decision/benchmark/runner.pyfarm/core/decision/training/collector.py,trainer.pySuggested approach
tests/decision/patterns; skip or xfail only where upstream library bugs already block tests (see current skips intest_tianshou_wrapper.py).Acceptance criteria
.coveragerccomments.pytest --cov=farm --cov-config=.coveragerc --cov-fail-under=90.