Skip to content

Missing tests for experiment_state, merge, merge_task #37

@SahilKumar75

Description

@SahilKumar75

Context

Three new modules were added with no test coverage:

Module Purpose
app/state/experiment_state.py SQLite-backed experiment run persistence
trainer/merge.py Merges a trained LoRA/QLoRA adapter into the base model
workers/merge_task.py Celery task wrapping the merge operation

Tasks

app/state/experiment_state.py

  • Test save_experiment_run() writes to and reads back from SQLite correctly
  • Test ExperimentState.load_runs() returns correct ExperimentRun objects
  • Test delete_run() removes from DB and from in-memory list
  • Test toggle_run_selection() adds and removes IDs correctly
  • Use a temporary DB path (via tmp_path fixture or EXPERIMENT_DB env var)

trainer/merge.py

  • Test merge_adapter() is callable with mocked model / PEFT dependencies
  • Test it raises with a clear error when the adapter path does not exist

workers/merge_task.py

  • Mock Celery and test the task body logic (similar to tests/test_workers.py pattern)
  • Test status updates are published correctly

Good first issue tips

See tests/test_workers.py and tests/test_api.py for the mocking patterns already in use. Run the suite with poetry run pytest.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions