Skip to content

feat: integration test suite - #76

Merged
kacy merged 4 commits into
mainfrom
feat/integration-tests
Feb 10, 2026
Merged

feat: integration test suite#76
kacy merged 4 commits into
mainfrom
feat/integration-tests

Conversation

@kacy

@kacy kacy commented Feb 10, 2026

Copy link
Copy Markdown
Owner

summary

adds an integration test crate that spawns a real ember-server as a subprocess, connects via TCP, and exercises the full request/response cycle over RESP3. 45 tests across five modules:

  • basic_operations (20 tests) — PING, SET/GET, NX/XX/EX/PX, DEL, EXISTS, UNLINK, INCR/DECR, EXPIRE/TTL/PERSIST, MGET/MSET, TYPE, RENAME, STRLEN/APPEND, DBSIZE, FLUSHDB, KEYS, SCAN, INFO, unknown command errors
  • data_types (11 tests) — lists (LPUSH/RPUSH/LPOP/RPOP/LRANGE/LLEN), hashes (HSET/HGET/HGETALL/HDEL/HEXISTS/HLEN/HINCRBY/HKEYS/HVALS/HMGET), sets (SADD/SREM/SMEMBERS/SISMEMBER/SCARD), sorted sets (ZADD/ZREM/ZSCORE/ZRANK/ZRANGE/ZCARD)
  • persistence (2 tests) — BGSAVE + restart recovery, AOF replay recovery
  • auth (2 tests) — requirepass rejection, AUTH success/failure, PING allowed without auth
  • pubsub (3 tests) — SUBSCRIBE + message delivery, PSUBSCRIBE pattern matching, PUBLISH subscriber count

the test harness (TestServer/TestClient) handles port allocation, server lifecycle, and RESP3 serialization/parsing. each test gets an isolated server instance.

what was tested

  • cargo test --test integration — 45/45 pass
  • cargo clippy --tests --workspace -- -D warnings — clean
  • cargo test --workspace — 798 tests pass (no regressions)

design considerations

  • tests spawn the ember-server binary as a child process rather than linking against library code, ensuring we test the actual server behavior end-to-end
  • ServerOptions supports both owned TempDir (auto-cleanup) and borrowed PathBuf (for persistence restart tests that need the same directory across server instances)
  • TestClient::read_frame() enables pub/sub tests by reading pushed messages without sending commands

kacy added 4 commits February 9, 2026 21:14
adds a test harness that spawns a real ember-server, connects via TCP,
sends RESP3 commands, and asserts responses. covers 45 tests across:

- basic operations (SET/GET, DEL, INCR, EXPIRE, MGET, SCAN, etc.)
- data types (lists, hashes, sets, sorted sets)
- persistence (BGSAVE snapshot recovery, AOF replay)
- authentication (requirepass, AUTH command)
- pub/sub (SUBSCRIBE, PSUBSCRIBE, PUBLISH)
- add build step before test in ci so the ember-server binary is
  available for integration tests that spawn it as a subprocess
- remove tests/ from .dockerignore so the workspace member resolves
  during docker builds
@kacy
kacy force-pushed the feat/integration-tests branch from 04be78f to 7043161 Compare February 10, 2026 02:15
@kacy
kacy merged commit e461bdc into main Feb 10, 2026
7 checks passed
@kacy
kacy deleted the feat/integration-tests branch February 10, 2026 02:15
kacy added a commit that referenced this pull request Feb 11, 2026
* feat: add integration test suite

adds a test harness that spawns a real ember-server, connects via TCP,
sends RESP3 commands, and asserts responses. covers 45 tests across:

- basic operations (SET/GET, DEL, INCR, EXPIRE, MGET, SCAN, etc.)
- data types (lists, hashes, sets, sorted sets)
- persistence (BGSAVE snapshot recovery, AOF replay)
- authentication (requirepass, AUTH command)
- pub/sub (SUBSCRIBE, PSUBSCRIBE, PUBLISH)

* style: cargo fmt integration tests

* fix: ci and docker compatibility for integration tests

- add build step before test in ci so the ember-server binary is
  available for integration tests that spawn it as a subprocess
- remove tests/ from .dockerignore so the workspace member resolves
  during docker builds

* style: cargo fmt workspace
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