Repository navigation
feat(testserver): build the testing server as a WASI module - #3443
Open
josephschorr wants to merge 1 commit into
Open
josephschorr wants to merge 1 commit into
josephschorr wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Adds a WASI (wasip1) reactor build of the testing server run by `serve-testing`, so test doubles in client libraries for any language can evaluate checks, lookups and writes with SpiceDB itself instead of reimplementing schema evaluation. The module serves the authzed.api.v1 PermissionsService, SchemaService and ExperimentalService through a small bytes-in, bytes-out ABI over the public protobufs, with an isolated datastore per session and the same configuration, limits and errors as `serve-testing`. It is built by `mage build:wasi` and attached to releases. The configuration shared with `serve-testing` moves to internal/testingserver, and a lean in-process server in pkg/cmd/testserver/inprocess backs the module without pulling in the datastore drivers. A parity test compares it with `serve-testing`, and the module itself is tested under wazero in CI.
josephschorr
force-pushed
the
wasi-evaluator
branch
from
October 29, 2026 23:02
a97fbaa to
1c1a1b4
Compare
This branch has not been deployed
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
Test doubles in our non-Go client libraries can't evaluate schemas, so tests of real permission logic either hand-write resolvers that drift from the schema or need a running SpiceDB. This PR builds the testing server (the one behind
serve-testing) as a WASI module that any language with a WebAssembly runtime can embed, so doubles can answer checks, lookups and writes with SpiceDB itself.pkg/cmd/testserver/wasi): awasip1reactor exposing a small bytes-in, bytes-out ABI over the publicauthzed.api.v1protobufs. It serves PermissionsService, SchemaService and ExperimentalService, with an isolated datastore per session and the same configuration, limits and errors asserve-testing. The README documents the ABI, and a Python (wasmtime) example host is included.pkg/cmd/testserver/inprocess): a lean server over an in-memory connection that backs the module, also usable directly from Go. It avoidspkg/cmd/server, which keeps the datastore drivers and telemetry exporters out of the build.internal/testingserver): the services, limits and dispatcher setup now shared byserve-testingand the in-process server, so the two can't drift.mage build:wasiproducesdist/spicedb-testserver.wasm, and the release workflow now attaches it alongside the existing WASM bundle.Testing
serve-testing, and requires identical responses and errors.mage test:wasihosts the built module in wazero and exercises schema writes, checks, lookups, errors and sessions. It runs in the existing WASM CI job.spicedb serve-testing. It covers union, intersection, exclusion, arrows, wildcards, nested groups, caveats, expiration, depth limits and error cases, and all results were identical.