test

Run the complete test suite for connectrpc-axum. Use when the user asks to run tests, verify changes, or check if the code works.

$ Installer

git clone https://github.com/washanhanzi/connectrpc-axum /tmp/connectrpc-axum && cp -r /tmp/connectrpc-axum/.claude/skills/test ~/.claude/skills/connectrpc-axum

// tip: Run this command in your terminal to install the skill


name: test description: Run the complete test suite for connectrpc-axum. Use when the user asks to run tests, verify changes, or check if the code works.

test

Run the complete test suite for connectrpc-axum: unit tests, doc tests, and integration tests with Go clients.

Instructions

Run both test suites in order:

1. Unit Tests

cargo test

2. Integration Tests

Run from the repo root (use -C to avoid changing working directory):

go test -C connectrpc-axum-examples/go-client -v -timeout 300s

The Go tests:

  1. Build all Rust example servers (once, cached)
  2. Start each server, wait for it to be ready
  3. Run Go client tests against each server
  4. Validate responses match expected behavior

Success Criteria

Unit Tests: All tests pass with exit code 0

Integration Tests: All tests pass (PASS in output)

Integration Test Matrix

TestServerProtocolTest Type
TestConnectUnaryconnect-unaryConnectUnary
TestConnectServerStreamconnect-server-streamConnectServer streaming
TestTonicUnaryConnecttonic-unaryConnectUnary
TestTonicUnaryGRPCtonic-unarygRPCUnary
TestTonicServerStreamConnecttonic-server-streamConnectServer streaming
TestTonicServerStreamGRPCtonic-server-streamgRPCServer streaming
TestTonicBidiStreamConnectUnarytonic-bidi-streamConnectUnary
TestTonicBidiStreamGRPCtonic-bidi-streamgRPCBidi streaming
TestGRPCWebgrpc-webgRPC-WebUnary
TestStreamingErrorHandlingstreaming-error-reproConnectStream error handling
TestProtocolVersionprotocol-versionConnectProtocol header validation
TestTimeouttimeoutConnectConnect-Timeout-Ms enforcement
TestExtractorConnectErrorextractor-connect-errorConnectExtractor rejection with ConnectError
TestExtractorHTTPResponseextractor-http-responseConnectExtractor rejection with plain HTTP

Failure Handling

Unit test failures: Check the specific test name and error message

Integration test failures:

  1. Note which specific test failed from the output
  2. Check if the server started (look for "Server ready" message)
  3. Check the Go client error message for details
  4. Common issues:
    • Port 3000 already in use
    • Missing Go dependencies (run go mod tidy in go-client/)
    • Build errors (run cargo build --features tonic first)

Report Format

Unit Tests: [PASS/FAIL]
- Passed: X
- Failed: Y

Integration Tests: [PASS/FAIL]
- X tests passed