refactor(server): modularize the test monolith and lib.rs — pure code movement#192
Merged
Conversation
tests/server.rs (6,517 lines, 110 tests) becomes seven area files — auth_policy, data_routes, schema_routes, stored_queries, multi_graph, boot_settings, s3 — with shared helpers in tests/support/mod.rs. Verbatim moves + visibility bumps (pub on helpers, pub(super)->pub inside the matrix harness); cargo fix stripped the per-file unused imports. All 110 tests pass in their new homes (289 across the crate including lib and openapi). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Verbatim moves: route handlers + bearer-auth middleware + per-request authorization + the cluster-prefix OpenAPI rewrite go to handlers.rs; settings resolution (omnigraph.yaml/CLI/env, mode inference, bearer-token sources, runtime-state classification) and its in-source test mod go to settings.rs. lib.rs (1,158 lines) keeps the public types, app/router assembly, and serve(). The ApiDoc derive references handlers::-qualified paths; the one multi-line utoipa attribute the cut orphaned was relocated with its handler. 289 crate tests green, OpenAPI drift check included. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
aaltshuler has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
The test-split renamed tests/server.rs away; the job now targets --test s3. Also fixes a stale name filter (s3_repo vs the actual s3_graph test): a substring filter matching nothing passes vacuously, so this step had been running zero tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
aaltshuler has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
aaltshuler
added a commit
that referenced
this pull request
Jun 12, 2026
Lands an orphaned-but-accurate working-tree edit (the engine table rows for forbidden_apis.rs, lance_surface_guards.rs, traversal_indexed, proptest_equivalence, ordering, literal_filters, policy_engine_chassis — all real files; 21 -> 28 count) and replaces the stale pre-modularization crate rows: the CLI and server entries now describe the per-area suites (#192/#193 splits) plus this cycle's additions (RFC-008 deprecation coverage, keyed-credential auth, hermetic OMNIGRAPH_HOME harness, the bucket-gated s3 suites). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
aaltshuler
added a commit
that referenced
this pull request
Jun 12, 2026
Lands an orphaned-but-accurate working-tree edit (the engine table rows for forbidden_apis.rs, lance_surface_guards.rs, traversal_indexed, proptest_equivalence, ordering, literal_filters, policy_engine_chassis — all real files; 21 -> 28 count) and replaces the stale pre-modularization crate rows: the CLI and server entries now describe the per-area suites (#192/#193 splits) plus this cycle's additions (RFC-008 deprecation coverage, keyed-credential auth, hermetic OMNIGRAPH_HOME harness, the bucket-gated s3 suites). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second modularization PR (same pattern as #188): verbatim moves + visibility bumps, zero behavior change, suite green per commit. Prepares the server for PR 3 of the object-storage arc (bucket-backed
--clusterserving), which lands as focused diffs againstsettings.rs/handlers.rsinstead of a 3.8k-line monolith.tests/server.rs (6,517 lines, 110 tests) → seven area suites
data_routes.rsboot_settings.rsmulti_graph_startupmod)auth_policy.rsschema_routes.rsstored_queries.rsmulti_graph.rss3.rsShared helpers (app builders, policy YAML fixtures, the matrix harness, EnvGuard) live in
tests/support/mod.rs.src/lib.rs (3,793) → lib 1,158 + handlers 1,666 + settings 988
handlers.rs: route handlers, auth middleware, per-request authorization, the cluster-prefix OpenAPI rewrite.settings.rs: omnigraph.yaml/CLI/env resolution, mode inference, bearer-token sources, runtime-state classification + its in-source tests.lib.rskeeps public types, router assembly,serve(). Public API unchanged (pub usere-exports preserved).Guarantees
289 crate tests green (including the OpenAPI drift check — no spec change); full
cargo test --workspace --lockedgreen (52 suites). One-timegit blamediscontinuity, as with #188.🤖 Generated with Claude Code