Skip to content

refactor(test): organize component suites and replace simulated coverage - #709

Open
Graffioh wants to merge 1 commit into
Luce-Org:mainfrom
Graffioh:codex/unit-test-refactor
Open

Graffioh wants to merge 1 commit into
Luce-Org:mainfrom
Graffioh:codex/unit-test-refactor

Conversation

@Graffioh

@Graffioh Graffioh commented Sep 5, 2026 •

Copy link
Copy Markdown
Collaborator

The server unit suite mixed unrelated components in a 7,222-line source file, while several regression tests checked copied formulas, simulated allocations, or JSON constructed inside the test. Organize the model-free suite by component, preserving existing coverage verbatim in the new layout.

  • Split the catch-all source into component sources. Group tests under server/test/server/, common/, moe/, qwen3/, qwen35/, deepseek4/, kvflash/, placement/, draft/, and kernels/; shared fixtures live in support/. Move the DS4/Qwen/MoE standalone sources into the same component layout, preserve their targets, and document the layout in server/test/README.md.
  • Preserve the test_server_unit target and historical selectors for retained cases. Separate session-container tests from the adaptive controller. Expose all 23 standalone feature-gate rule groups as individual CTest cases.
  • Remove the obsolete RED-formula target, simulated allocation checks, duplicated score-range coverage, assignment-only tests, copied HTTP policy formulas, and hand-built telemetry responses.
  • Relocate all remaining upstream coverage unchanged, including the tests added on main since the original branch point.

No production APIs or runtime state change. GPU/model test sources retain their existing targets and hardware requirements. The README identifies HTTP policy/telemetry integration coverage that the removed simulations never established.

New and strengthened coverage is mostly split into a stacked follow-up so this PR stays close to a pure reorganization; the exceptions shipping here are the session LRU eviction-bounds and EMA read-back cases (lru_eviction_bounds_map_size, get_ema_reflects_post_update_value).

Test plan

  • Fresh HIP build in an isolated worktree: test_server_unit discovers 543 cases; ctest passes 541/543 — the only 2 failures are upstream-verbatim MixedMmqPolicy cases segfaulting inside libamdhip64/ggml HIP kernels on this gfx1201+gfx1151 box (pre-existing environment issue, unchanged by this PR).
  • Test-declaration comparison confirms no existing cases were lost in the split. git diff --check clean.

Generated with Devin

@Graffioh Graffioh changed the title test: replace simulated drafter checks with production-helper coverage test: organize component suites and replace simulated coverage Sep 5, 2026
@Graffioh Graffioh changed the title test: organize component suites and replace simulated coverage refactor: organize component tests and replace simulated coverage Sep 5, 2026
@Graffioh Graffioh changed the title refactor: organize component tests and replace simulated coverage refactor(test): organize component suites and replace simulated coverage Sep 5, 2026
@Graffioh
Graffioh force-pushed the codex/unit-test-refactor branch 3 times, most recently from b908255 to 4a0746e Compare September 5, 2026 12:42
@Graffioh
Graffioh marked this pull request as ready for review September 5, 2026 12:49

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 81 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread server/src/qwen3/qwen3_drafter.cpp
Comment thread server/CMakeLists.txt Outdated
Comment thread server/test/server/test_disk_prefix_cache.cpp Outdated
Comment thread server/test/server/test_disk_prefix_cache.cpp Outdated
Comment thread server/src/server/http_server.cpp
Comment thread server/test/support/streaming.h Outdated
Comment thread server/test/server/test_text.cpp
Comment thread server/test/qwen3/test_gguf_loader.cpp Outdated
Comment thread server/test/common/test_backend_ipc.cpp Outdated
Comment thread server/test/support/mock_backend.h Outdated
@Graffioh

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@Graffioh I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 75 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread server/test/server/test_disk_prefix_cache.cpp Outdated
Comment thread server/CMakeLists.txt
Comment thread server/test/server/test_disk_prefix_cache.cpp Outdated
Comment thread server/test/support/streaming.h
Comment thread server/test/server/test_http_sessions.cpp
Comment thread server/test/server/test_prefix_cache.cpp
Comment thread server/test/server/test_prefix_cache.cpp
Comment thread server/test/support/environment.h Outdated
Comment thread server/test/server/test_model_card.cpp
Comment thread server/test/server/test_model_card.cpp Outdated
@Graffioh
Graffioh force-pushed the codex/unit-test-refactor branch from 04102c6 to 565bc01 Compare September 15, 2026 09:05
Split the 7k-line server/test/test_server_unit.cpp monolith into
component-oriented files under server/test/{common,deepseek4,draft,kernels,
kvflash,moe,placement,qwen3,qwen35,server} matching the production layout,
with shared fixtures/mocks under server/test/support/.

Removes low-value coverage (formula-copying, assignment-only, simulated
allocation, and suite-in-suite tests) and converts the feature-gate suite to
per-case TEST_CASEs. Relocates all remaining upstream coverage verbatim,
including the tests added on main since the original branch point.
@Graffioh
Graffioh force-pushed the codex/unit-test-refactor branch from 565bc01 to 72e9851 Compare September 15, 2026 09:24
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