Skip to content

test(storage-boundary): add write-side WIT boundary test#1

Open
zacharywhitley wants to merge 1 commit into
mainfrom
feat/write-boundary-test
Open

test(storage-boundary): add write-side WIT boundary test#1
zacharywhitley wants to merge 1 commit into
mainfrom
feat/write-boundary-test

Conversation

@zacharywhitley

Copy link
Copy Markdown
Contributor

Summary

Adds crates/storage-boundary-test/tests/write_boundary.rs and the companion wit-write/ tree (256 + 242 LOC). This is the mirror-image counterpart to the read-side tests/boundary.rs: it loads the synthetic ducklink writer bridge and drives the exported duckdb:extension/storage-write-dispatch@2.0.0 interface end-to-end across the WIT component boundary via wasmtime, covering begin-transaction, create-table, insert-rows, update-rows, delete-rows, commit-transaction, and the rollback path.

The write world is duckdb:extension@2.0.0; the pre-existing wit/ tree uses the unversioned duckdb:extension package. Rather than version-mix, the write-side WIT lives in a sibling wit-write/ dir with its own duckdb:extension@2.0.0 dependency, keeping the two bindgen! invocations independent.

Cherry-picked as a single commit from feat/python-sdk-authoring-api (which carries unrelated Python-SDK authoring work) onto a fresh branch off main so the review scope is just the write-boundary test.

Related work

Motivating commits on the sqlink side (writer symmetry):

  • tegmentum/sqlink@5cfc37dc -- iVersion fix
  • tegmentum/sqlink@6ec38652 -- read/write unify

Companion smoke-fixture repos:

  • tegmentum/synthetic-mutating-vtab-bridge (sqlink side)
  • tegmentum/synthetic-mutating-vtab-ducklink-bridge (ducklink side; provides the writer wasm this test loads)

Companion PR:

  • tegmentum/ducklink-extension feat/storage-write-dispatch-2.1 -- adds the runtime trampolines + storage-write-dispatch@2.0.0 WIT on the extension-runtime side that this test exercises.

Test plan

  • Build the ducklink writer bridge from tegmentum/synthetic-mutating-vtab-ducklink-bridge and point DUCKLINK_WRITER_BRIDGE_WASM at the artifact (or stage it at ../../artifacts/extensions/synthetic_mutating_ducklink.wasm).
  • cargo test -p storage-boundary-test --test write_boundary -- confirm all boundary phases (begin, create-table, insert, update, delete, commit, rollback) pass.
  • Confirm the pre-existing read-side tests/boundary.rs still passes (no shared WIT/bindgen regressions).

Adds `tests/write_boundary.rs` -- the mirror-image counterpart to the
read-side `tests/boundary.rs`. Loads the synthetic ducklink writer
bridge (companion to sqlink's `synthetic-mutating-vtab-bridge`) and
drives its exported `duckdb:extension/storage-write-dispatch@2.0.0`
interface end-to-end across the WIT component boundary via wasmtime,
covering the full mutating path: begin-transaction, create-table,
insert-rows, update-rows, delete-rows, commit-transaction, and the
rollback path.

The write world is `duckdb:extension@2.0.0`; the pre-existing wit/
tree uses the unversioned `duckdb:extension` package. Rather than
version-mix, the write-side WIT lives in a sibling `wit-write/` dir
with its own duckdb:extension@2.0.0 dependency, keeping the two
bindgen! invocations independent.

Bridge wasm is located via (1) $DUCKLINK_WRITER_BRIDGE_WASM,
(2) `../../artifacts/extensions/synthetic_mutating_ducklink.wasm`
(the staged copy convention), or (3) the sibling checkout at
`~/git/synthetic-mutating-vtab-ducklink-bridge/target/wasm32-wasip2/
release/synthetic_mutating_ducklink_bridge_dynlink.wasm`. Test
panics with a clear build-me message if none of those exist.
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