Kotlin / kotlinx-rpc

Add asynchronous RPC services to your multiplatform applications.
https://kotlin.github.io/kotlinx-rpc/
Apache License 2.0
533 stars 7 forks source link

API Versioning: Connection Sampling #28

Closed Mr3zee closed 5 months ago

Mr3zee commented 5 months ago

Problem Description Evolution of protocol API is very error prone. We need to make sure each change to the protocol is compatible with previous versions.

Solution This is Part 2 of the solution, where we record samples of services' communication and replay them with existing implementations, making sure nothing breaks that shouldn't

Details I've extracted gold files functionality to reuse it for wire sampling checks. Each wireSamplingTest first runs current endpoints against each other on the specific small test. Their communication is recorded and placed as a gold file (with fail-to-update if needed). After that all recorded samples for this test are run with the current version in two phases:

Mr3zee commented 5 months ago

I know it looks really big (+1300 lines), but that are mostly .gold files and extraction of test utils for gold tests into separate files New logic itself is present in two files: WireSamplingTestScope and ApiVersioningTest