Skip to content

refactor: speed up unit tests and trim redundancy#98

Merged
xavierlyu merged 1 commit into
mainfrom
refactor/speed-up-unit-tests
Jun 14, 2026
Merged

refactor: speed up unit tests and trim redundancy#98
xavierlyu merged 1 commit into
mainfrom
refactor/speed-up-unit-tests

Conversation

@xavierlyu

@xavierlyu xavierlyu commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Mock _tokenize in the run_baseline test to remove a ~300s accidental network wait
  • Remove ~44 redundant unit tests (dead schema, constant assertions, duplicate scenarios, low-value defensive cases)
  • Add pytestmark = pytest.mark.unit to GPU orchestration and cacheon_db loaders tests so CI runs them

Note

Low Risk
Changes are confined to the test suite; no production behavior is modified, only coverage breadth is reduced in a few edge-case areas.

Overview
Test-only PR that shortens CI runtime and reduces duplicate or low-value coverage; production code is unchanged.

The largest fix is in test_docker_eval: run_baseline error-path tests now @patch validator.docker_eval._tokenize, avoiding real HTTP to vLLM’s /tokenize (previously could hang for minutes).

Several modules shed redundant cases: BaselinePromptResult / BaselineCache round-trips in test_baseline; EvaluationJob / EvaluationResult and many schema default tests in test_validator_eval_schema; constant and alias assertions in test_prompts; duplicate digest and _effective_overtake_threshold tests in test_validator_state; “never raises” Docker/GPU cleanup tests in test_docker_eval; eval-progress no-file / bad-index / OSError swallow tests in test_eval_progress; and similar overlap elsewhere. test_cpu_validator merges dry-run vs live weight-setting into one @pytest.mark.parametrize test.

pytestmark = pytest.mark.unit is added to GPU orchestration, GPU session, GPU SSH, and test_cacheon_db_loaders so those files run in the unit CI job.

Reviewed by Cursor Bugbot for commit 241dc37. Bugbot is set up for automated code reviews on this repo. Configure here.

@xavierlyu xavierlyu merged commit 0d82b11 into main Jun 14, 2026
8 checks passed
@xavierlyu xavierlyu deleted the refactor/speed-up-unit-tests branch June 14, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant