You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BrowserDb::export_graph() documents that its output blob is "byte-for-bit compatible with native .graph files opened by the native binary" (src/browser/mod.rs:171). BrowserDb::import_graph() accepts a native-produced file.
This invariant is currently untested across the boundary. The only existing test (export_import_round_trip in src/browser/mod.rs) round-trips within the browser WASM environment; it does not verify interoperability with the native binary.
What to test
Native → Browser: produce a .graph file with the native binary (or MemoryBackend + PersistentFactStorage in a native test), serialise it to bytes, feed those bytes to BrowserDb::import_graph(), and assert queries return the expected results.
Browser → Native: call BrowserDb::export_graph() on a populated in-browser database, take the returned byte blob, load it via PersistentFactStorage::<MemoryBackend>::load() (or write it to a temp file and open with Minigraf::open()), and assert the facts are readable.
Suggested approach
A native integration test (in tests/) can exercise the native → browser direction by building the .graph bytes using the storage layer directly, then deserialising them using the same layer, confirming the format is self-consistent. This is already implicitly tested via migration tests but not labelled as a cross-platform compat test.
The browser → native direction requires a wasm-bindgen-test that exports a blob and a companion native test that reads the same fixed binary fixture. A checked-in binary fixture (a small known .graph file) could serve both directions.
Consider adding a fixture-based test: a small .graph file committed to tests/fixtures/ produced by the native binary, loaded by the browser WASM test suite via import_graph, and asserted to contain known facts.
Acceptance criteria
At least one test verifies native-produced bytes are readable by BrowserDb::import_graph()
At least one test verifies BrowserDb::export_graph() bytes are readable by the native storage layer
Tests run in CI (native tests in rust.yml; browser tests in wasm-browser.yml)
A format regression note is added to CHANGELOG.md / TEST_COVERAGE.md when the tests are added
Activity
test(compat): cross-platform .graph compatibility tests (issue #150)
chore(release): bump version to v0.20.0, doc-sync Phase 8.1 complete
chore(release): bump version to v0.20.0, doc-sync Phase 8.1 complete
chore(release): bump version to v0.20.0, doc-sync Phase 8.1 complete (#…