feat: add MySQL and Redis Wasm integration tests (US-117)#102
Merged
tervezo-ai[bot] merged 4 commits intomainfrom Mar 13, 2026
Merged
Conversation
Add [features] section with integration = [] to warpgrid-host Cargo.toml for gating MySQL and Redis integration tests. Also fix pre-existing missing `wat` workspace dependency in root Cargo.toml. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Create wit/test.wit, wit/deps/shim/database-proxy.wit, and wit/deps/shim/dns.wit for the existing US-703 guest fixture that was missing its WIT directory. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Create tests/fixtures/rust-mysql-redis-integration-guest/ with: - Cargo.toml (cdylib, wit-bindgen 0.42, dlmalloc) - WIT world definition with 4 exported test functions - Full lib.rs implementing MySQL wire protocol helpers (handshake, COM_QUERY, OK/ERR/EOF parsing, length-encoded strings) and Redis RESP helpers (command builder, bulk string parser) Exports: test-mysql-crud, test-redis-crud, test-mysql-pool-reuse, test-redis-pool-reuse — all exercising raw protocol bytes through the database-proxy WIT interface. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement end-to-end integration tests proving Wasm guest components can communicate with MySQL and Redis through WarpGrid's database proxy. New test file: integration_wasm_mysql_redis.rs (gated behind cfg(feature = "integration")) with 6 tests: - test_mysql_crud_via_wasm: CREATE TABLE → INSERT → SELECT → DROP TABLE - test_redis_crud_via_wasm: SET → GET → DEL - test_mysql_pool_reuse_via_wasm: connect → query → close → reconnect → query - test_redis_pool_reuse_via_wasm: connect → SET → close → reconnect → GET - test_mysql_health_check_removes_dead: COM_PING detects dead connections - test_redis_health_check_removes_dead: PING detects dead connections Includes StatefulMockMysqlServer (SQL-aware query dispatch with state tracking) and StatefulMockRedisServer (RESP protocol with HashMap key-value state). All clippy warnings resolved. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tervezo-ai bot
pushed a commit
that referenced
this pull request
Mar 13, 2026
Reviewed and merged 6 PRs, closed 1 as superseded: - PR #103: fix schedule script URL prefix and non-JSON responses - PR #1: wasmtime 41.0.3 → 41.0.4 security bump - PR #99: Postgres database proxy integration tests (US-114) - PR #101: signal handling integration tests (US-110) - PR #104: threading model declaration host function (US-118) - PR #102: MySQL and Redis Wasm integration tests (US-117) - PR #100: closed as superseded by #103 Co-Authored-By: Claude Opus 4.6 <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
tests/fixtures/rust-mysql-redis-integration-guest/):#![no_std]cdylib that exercises MySQL wire protocol (handshake, COM_QUERY, OK/ERR/EOF parsing) and Redis RESP (SET/GET/DEL) through the genericdatabase-proxyWIT interfacecrates/warpgrid-host/tests/integration_wasm_mysql_redis.rs): 6 tests gated behindcfg(feature = "integration"):test_mysql_crud_via_wasm— CREATE TABLE → INSERT → SELECT → DROP TABLEtest_redis_crud_via_wasm— SET → GET → DELtest_mysql_pool_reuse_via_wasm— connect, query, close, reconnect, query (proves pool reuse)test_redis_pool_reuse_via_wasm— connect, SET, close, reconnect, GET (proves pool reuse)test_mysql_health_check_removes_dead— COM_PING detects dead MySQL connectionstest_redis_health_check_removes_dead— PING detects dead Redis connectionsintegration = []incrates/warpgrid-host/Cargo.tomlrust-http-redis-postgres-guestfixture (US-703)watworkspace dependency in rootCargo.tomlTest plan
cargo check -p warpgrid-hostpassescargo test -p warpgrid-host --test integration_mysql --test integration_redis— 22 existing tests passcargo test -p warpgrid-host --test integration_wasm_mysql_redis— 0 tests (correctly gated)cargo test -p warpgrid-host --features integration --test integration_wasm_mysql_redis— all 6 passcargo clippy -p warpgrid-host --features integration --test integration_wasm_mysql_redis— 0 warnings🤖 Generated with Claude Code
View implementation in Tervezo