Skip to content

Add test proxy framework for integration testing#446

Open
paddybyers wants to merge 1 commit intouts-integrationfrom
uts-proxy-framework
Open

Add test proxy framework for integration testing#446
paddybyers wants to merge 1 commit intouts-integrationfrom
uts-proxy-framework

Conversation

@paddybyers
Copy link
Copy Markdown
Member

@paddybyers paddybyers commented Mar 30, 2026

UTS proxy framework for integration tests

This PR extends the UTS work (which contains unit tests with mocked network clients, and some happy-path integration tests) with a proxy that can be used to implement unhappy path tests to exercise client handling of connection problems, protocol errors, refused or failed operations, etc.

This means that it is also possible to specify integration tests similarly in natural language, without mocking the networking clients. Integration tests that verify SDK behaviour in response to non-normal server behaviour can be implemented using this proxy, under control of the test, that intercepts and/or modifies protocol messages. The required behaviour of the proxy in a given test can also be specified in natural language. The integration tests include a proxy written in Go that can be spawned in a test run and controlled by tests via a control API.

See the proposal for details of the proxy behaviour and API.

This PR contains a small number of test specs for tests using this proxy to illustrate how it would be used.

Add a Go-based test proxy that intercepts and manipulates WebSocket and
HTTP traffic between SDK clients and the Ably service. Includes:

- Programmable proxy server with rule-based request/response manipulation
- WebSocket and HTTP proxy handlers with protocol-level inspection
- Session management and action framework for fault injection
- Integration test specs for connection failures, resume, heartbeats,
  channel faults, and REST faults using the proxy
- Proxy helper spec for UTS integration test authors
- Updated write-test-spec skill with proxy test patterns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant