Skip to content

test(server): unify pytest and CTest execution - #805

Merged
davide221 merged 1 commit into
Luce-Org:mainfrom
Graffioh:refactor/pytest-consolidation
Oct 4, 2026
Merged

davide221 merged 1 commit into
Luce-Org:mainfrom
Graffioh:refactor/pytest-consolidation

Conversation

@Graffioh

@Graffioh Graffioh commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Python tests used incompatible runners, some scripts exited during pytest collection, and CI selected C++ tests through duplicated build lists and regexes. Consolidate the suites so pytest collects the Python tests and check-cpu builds and runs the labeled C++ subset.

  • Move server tests under server/test/{python,unit,smoke,bench,fixtures} and update source, helper, and fixture references. Convert script-style Python checks to pytest fixtures, parametrization, and assertions.
  • Share one urllib HTTP client and server-launch factory. Every spawned server belongs to its test module and is stopped on teardown, including after failures, so a --launch server cannot remain loaded while a later cache module starts another model.
  • Validate concurrency options, including an explicit zero, resolve relative binary paths, and support Windows binary naming and process shutdown. Add subprocess regressions for option precedence, cleanup, paths, and startup diagnostics.
  • Propagate cpu labels through CTest discovery, restore the DS4 MIX fitter test, and use check-cpu in hosted CI. Skip the HIP replay subcase when no GPU backend is available, matching the surrounding cases.
  • Fix Windows test selection: cmd.exe passed the doubled backslash in the original regex literally, selecting zero tests. ^test_platform_compat[.] selects the discovered platform case while keeping --no-tests=error.

Validation:

  • Python unit subset with lockfile-pinned pytest/dependencies: 129 passed, 152 deselected.
  • Default pytest run: 129 passed, 152 prerequisite skips; no collection errors.
  • Fixture regressions: 11 passed; five fail against the original PR fixtures.
  • HIP Release check-cpu, with all GPUs hidden: 660 passed, 6 skipped, 0 failures across 666 selected CTest cases.
  • Corrected platform regex runs the real discovered test; the previous regex reproduces the empty-selection failure.
  • Ruff on CI-covered repository paths, diff whitespace checks, and commit-style validation pass.

Real model/server Python tests remain opt-in and were not run against model weights during this review. The CI workflow passed on this commit: Python/workspace, Linux/CUDA build and CPU tests, Windows build and platform smoke test, NVIDIA/DGX, Strix Halo, and R9700.

The original commits and review fixes are folded into one commit on the updated upstream main.

@Graffioh
Graffioh force-pushed the refactor/pytest-consolidation branch from 1c4c9df to 7972b05 Compare October 2, 2026 13:11
@Graffioh Graffioh changed the title test(server): consolidate python tests under pytest test: consolidate Python tests under pytest and label the C++ CPU-safe subset Oct 2, 2026
@Graffioh
Graffioh force-pushed the refactor/pytest-consolidation branch 2 times, most recently from db0cac2 to d31bb63 Compare October 4, 2026 10:48
@Graffioh Graffioh changed the title test: consolidate Python tests under pytest and label the C++ CPU-safe subset test(server): unify pytest and CTest execution Oct 4, 2026
Consolidate server Python tests under pytest with shared HTTP and server
fixtures, explicit server/model/slow tiers, and module-owned process cleanup.
Validate concurrency options without losing an explicit zero, resolve local
binary paths, and use supported Windows process shutdown.

Group C++ sources under unit, smoke, and bench directories; propagate cpu
labels through discovery and build the hosted subset through check-cpu.
Restore the DS4 MIX fitter test, fix Windows CTest selection under cmd.exe,
and skip the HIP replay subcase when no GPU backend is available.

Cover fixture validation, process cleanup on success and failure, relative
binary paths, and startup diagnostics with subprocess regressions.

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Graffioh
Graffioh force-pushed the refactor/pytest-consolidation branch from d31bb63 to 3b8e103 Compare October 4, 2026 10:52
@Graffioh
Graffioh marked this pull request as ready for review October 4, 2026 11:37
@davide221
davide221 merged commit 29f9fa4 into Luce-Org:main Oct 4, 2026
11 checks passed
dusterbloom added a commit to dusterbloom/lucebox-hub that referenced this pull request Oct 5, 2026
…4exp-strix-halo

Upstream moved the tests into test/unit and test/smoke; move this PR's new
tests the same way and point CMake at the new paths.
dusterbloom added a commit to dusterbloom/lucebox-hub that referenced this pull request Oct 5, 2026
…to feat/qwen4exp-mtp

Move the MTP unit tests into test/unit like the rest.
dusterbloom added a commit to dusterbloom/lucebox-hub that referenced this pull request Oct 5, 2026
…prefix cache

Move the prefix-cache unit test into test/unit like the rest.
dusterbloom added a commit to dusterbloom/lucebox-hub that referenced this pull request Oct 5, 2026
…g#774 + MTP + prefix cache)

- One max_concurrency config field; auto chunk sized for all slots, capped at 4096 rows.
- --max-concurrency > 1 switches MTP off; explicit --draft/--verify-width is refused.
- The seq-engine worker replaces the serial loop, so prefix snapshots stay single-slot.
- New tests follow the Luce-Org#805 layout (test/smoke, test/unit).
- Test state follows the Luce-Org#774 stable-QSA cache contract: finite poison, and the
  permanent indexer scratch row is exempt from the stray-write check.
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.

2 participants