Extract public-API tests from omnigraph.rs to integration tests#40
Merged
Conversation
The inline `mod tests` in crates/omnigraph/src/db/omnigraph.rs had grown to ~620 lines, mixing tests that need crate-private access with tests that only exercise the public API. Splits the latter out. - tests/lifecycle.rs: 10 init/open/snapshot/drift tests - tests/schema_apply.rs: 5 plan/apply tests - omnigraph.rs: 10 tests remain inline because they use db.coordinator, db.table_store(), ManifestCoordinator, SCHEMA_APPLY_LOCK_BRANCH, or is_internal_run_branch — all crate-private and intentionally kept so. No behavior change. Zero semantic edits to the tests themselves beyond replacing db.snapshot() (pub(crate)) with snapshot_main helper at integration-test boundaries. Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Summary
mod testsincrates/omnigraph/src/db/omnigraph.rsinto two new integration test files.tests/lifecycle.rs— 10 tests covering init/open/snapshot/drift behaviors.tests/schema_apply.rs— 5 tests covering plan/apply via the public API.db.coordinator,db.table_store(),ManifestCoordinator,SCHEMA_APPLY_LOCK_BRANCH,is_internal_run_branch).No behavior change: the only semantic edit is swapping
db.snapshot()(which ispub(crate)) for the existingsnapshot_mainhelper at integration-test boundaries.omnigraph.rsdrops 268 lines; 288 lines are added across the two new test files (slightly more because the extracted tests no longer share the inlineTEST_SCHEMAconstant and use the fixture-backed helper).Test plan
cargo test -p omnigraph-engine --test lifecycle --test schema_apply— all 15 passcargo test -p omnigraph-engine --lib db::omnigraph::tests— remaining 10 inline tests passcargo test -p omnigraph-engine— full engine suite green (lib + all integration files)🤖 Generated with Claude Code