PlexSpaces has comprehensive test coverage including unit tests, integration tests, and example tests. All tests are designed to run offline without requiring external services (except where explicitly noted).
# Full verification: Cargo workspace + polyglot SDK tests (recommended before commit)
make test
# Fast local Rust test loop (prefers cargo-nextest when installed)
# Note: Rust crates only (does not run Python / TypeScript / Go SDK tests)
make test-fast
# Fast local compile verification without full linking/test execution
make checkWhat make test runs:
- Rust workspace —
cargo nextestwhen installed, otherwisecargo test:--liband--testsfor workspace members except embedded comparison crates listed inCARGO_EXCLUDE_EXAMPLESin theMakefile(currentlytemporal-comparison,skypilot-comparisonunderexamples/rust/embedded/). Core crates andplexspaces-sdk/plexspaces-sdk-macrosare included (--all-features), with ignored tests included (--run-ignored all/--include-ignored). Tuplespace and selected services integration tests use reduced parallelism vianextest.toml. To run tests for an excluded crate:cargo test -p temporal-comparison. - Polyglot SDKs (not Cargo packages):
sdks/go:go test ./...sdks/typescript:npm test(installs dependencies if needed)sdks/python:pytestinVENV_PATH(default~/venv) when that venv exists, else systempython3 -m pytestif pytest is importable; otherwise prints a skip warning
For Python SDK tests, install dev dependencies (e.g. pip install -e sdks/python[dev] or make proto-install-deps for the default venv).
# Fastest repo-level compile pass
make build-fast
# Run only library unit tests (fastest)
cargo test --lib --all-features --workspace
# Run tests for specific package
cargo test --lib -p plexspaces-wasm-runtimeThe repository uses a single shared top-level target/ directory for workspace crates, examples, and scripts. Local development paths also enable incremental compilation by default.
make build,make test,make build-fast, andmake test-fastall reuse the sharedtarget/cargo-nextestis used automatically when installed for faster test schedulingsccacheis used automatically when installed for compiler artifact cachingCARGO_BUILD_JOBScontrols build parallelism andCARGO_TEST_JOBScan be set separately for test runs
All WASM integration tests run offline using in-memory services:
# Run all WASM integration tests
cargo test --package plexspaces-wasm-runtime --test '*integration*' --no-fail-fast
# Run specific integration test suite
cargo test --package plexspaces-wasm-runtime --test blob_host_functions_integration
cargo test --package plexspaces-wasm-runtime --test new_host_functions_integration
cargo test --package plexspaces-wasm-runtime --test durability_host_functions_integration
cargo test --package plexspaces-wasm-runtime --test messaging_host_functions_integration
cargo test --package plexspaces-wasm-runtime --test wasm_component_integration
cargo test --package plexspaces-wasm-runtime --test integration_tests
cargo test --package plexspaces-wasm-runtime --test grpc_integration# Run integration tests that may require external services
make test-integration
# Note: Some integration tests require:
# - Embedded object store / S3-compatible endpoint (for blob storage tests)
# - Redis (for distributed tests)
# - Kafka (for messaging tests)
# Workspace `make test` includes integration test binaries; tests that need live services usually skip until those services are up (see Test Guards below).# Run all example tests
make test-examples
# Run WASM example tests
make test-wasmExamples and HTTP/gRPC APIs should be tested both with auth disabled and with auth enabled to ensure tenant/namespace handling is correct.
- Auth disabled (e.g.
PLEXSPACES_DISABLE_AUTH=1): tests may providetenant_idout of band andnamespacein the request. No JWT required. - Auth enabled:
tenant_idis required (from JWT or request);namespaceis optional. RequestContext validation rejects emptytenant_idwhen auth is enabled.
Run the server with auth disabled for local/testing, then run example scripts (e.g. registry, task-queue). Run again with auth enabled and valid JWT to verify API behavior.
# Show test output (useful for debugging)
cargo test --package plexspaces-wasm-runtime --test blob_host_functions_integration -- --nocapture
# Run specific test
cargo test --package plexspaces-wasm-runtime --test blob_host_functions_integration test_blob_upload -- --nocaptureUnit tests are in src/ directories with #[cfg(test)] modules:
- Fast execution
- No external dependencies
- Test individual functions and modules
Integration tests are in tests/ directories:
- Test complete workflows
- Use in-memory services when possible
- May require external services (clearly documented)
Located in crates/wasm-runtime/tests/:
-
blob_host_functions_integration.rs- Blob storage operations- Tests all 7 WIT blob methods: upload, download, delete, exists, list, metadata, copy
- Uses LocalFileSystem (offline)
-
new_host_functions_integration.rs- KeyValue, ProcessGroups, Locks, Registry- Uses InMemoryKVStore, MemoryLockManager (offline)
-
durability_host_functions_integration.rs- Journaling/durability- Uses MemoryJournalStorage (offline)
-
messaging_host_functions_integration.rs- Messaging operations- Uses MockMessageSender (offline)
-
wasm_component_integration.rs- Component model- Tests component loading and instantiation
-
integration_tests.rs- Behavior routing and channels- Uses MockChannelService (offline)
-
grpc_integration.rs- gRPC deployment service- Uses localhost only (offline)
All WASM integration tests are designed to run offline:
- ✅ No network access required
- ✅ No SSL certificates required
- ✅ No external services required
- ✅ Uses in-memory services (LocalFileSystem, SQLite in-memory, etc.)
Tests use in-memory implementations:
- Blob Storage:
LocalFileSystemwith temp directories - KeyValue:
InMemoryKVStore - Locks:
MemoryLockManager - Journaling:
MemoryJournalStorage - Messaging:
MockMessageSender - Channels:
MockChannelService
Integration tests that require external services use automatic guard checks that skip
tests gracefully if the service is not available. This allows make test to run all
tests without failures, while still supporting integration testing when services are running.
Available Guard Functions (plexspaces_common::test_helpers):
redis_available()- Redis (localhost:6379)nats_available()- NATS (localhost:4222)kafka_available()- Kafka (localhost:9092)postgres_available()- PostgreSQL (localhost:5432)dynamodb_local_available()- DynamoDB Local (localhost:8000)localstack_available()/sqs_simulator_available()- LocalStack (localhost:4566)object_store_available()- S3-compatible object store endpoint (BLOB_ENDPOINTor localhost:9000)firecracker_available()- Firecracker binary + kernel + rootfs
Usage in Tests:
use plexspaces_common::skip_if_unavailable;
use plexspaces_common::test_helpers::redis_available;
#[tokio::test]
async fn test_with_redis() {
skip_if_unavailable!(redis_available().await, "Redis");
// ... test code that requires Redis
}Running with Services:
# Start services (e.g., with docker-compose)
docker-compose up -d redis nats kafka
# Run tests - integration tests will now execute
make testThe following tests require external services but now skip gracefully:
- AWS/S3-compatible blob storage tests (require embedded object store or S3 endpoint running)
- Distributed tests (require Redis/Kafka/NATS)
- Firecracker tests (require Firecracker binary + kernel + rootfs)
- Network-based tests (require external endpoints)
All tests can be run with make test - tests that require unavailable services
will be skipped with an informational message.
All WASM host functions are tested:
- ✅ Blob: upload, download, delete, exists, list, metadata, copy
- ✅ KeyValue: get, put, delete, exists, list-keys, increment, compare-and-swap
- ✅ ProcessGroups: create_group, join_group, leave_group, get_members, publish_to_group
- ✅ Locks: acquire, renew, release, try_acquire, get_lock
- ✅ Registry: register, unregister, lookup, discover, heartbeat
- ✅ Durability: persist, persist_batch, checkpoint, get_sequence, is_replaying, read_journal, compact
- ✅ Messaging: link, unlink, monitor, demonitor
- ✅ Channels: send_to_queue, receive_from_queue, publish_to_topic
- ✅ TupleSpace: write, read, take, watch
Cause: Cargo trying to download dependencies
Solution:
# Configure SSL certificates (see docs/SSL_CERTIFICATE_FIX.md)
# Or use offline mode if dependencies are cached
cargo test --offlineCause: Test trying to use service that wasn't set up
Solution: Check test setup - all integration tests include proper service initialization
Cause: Dependencies not cached
Solution:
# Build first to cache dependencies
cargo build
# Then run tests
cargo testCause: Some integration tests need an S3-compatible object store, Redis, or Kafka
Solution:
- Use
make testwhich excludes these tests - Or start required services and run
make test-integration
- Run
make testbefore committing - Ensures all offline tests pass - Use
--nocapturefor debugging - See test output when debugging failures - Run specific test suites - Faster feedback during development
- Check test coverage - Use
make test-coverageto verify coverage requirements
crates/wasm-runtime/tests/README.md- WASM test detailsdocs/SSL_CERTIFICATE_FIX.md- SSL certificate configurationMakefile- Test targets and commands