Skip to content

Testing - Expand unit & integration test suite #10

Description

@Codex-Crusader

Summary

Expand the tests/ folder with more unit and integration tests focused on MCTS, model forward pass, self-play, and training pipeline edge cases.

Motivation

More tests increase confidence, make refactors safe, and help new contributors understand expected behavior.

Acceptance criteria / Definition of Done

  • Add unit tests for:
    • board_to_tensor and tensor shape/value expectations.
    • MCTS selection step: given a small deterministic board, ensure selected moves are legal.
    • Legal-moves cache behavior if implemented (or ensure legal moves list matches board.legal_moves).
  • Add integration tests:
    • Small self-play episode runs end-to-end with mocked model (e.g., deterministic policy) and completes without exceptions.
    • Training loop runs a single update step on synthetic data (mock or tiny buffer).
  • Tests run in CI (pytest) and do not require GPU.
  • Add instructions in CONTRIBUTING.md for running tests locally.

Implementation notes

  • Use fixtures to create small boards and a tiny dummy model (so tests are fast).
  • Mark heavier tests with pytest markers (e.g., @pytest.mark.slow) and exclude them from default CI.

Complexity

Low–Medium. Add a couple of “good first issue” tests and one integration test to start.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions