Skip to content

Test coverage: optional core (GUI, training, tianshou, benchmarks) #564

@cursor

Description

@cursor

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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions