Closed Mr3zee closed 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
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:old client
phase where only client is emulated using recorded messages from all versions (including current).old server
phase, where only server is emulated using recorded messages from only current version (it is not that useful as of right now we do not guarantee this type of compatibility. Later this restriction will be lifted and all old server version will be tested like as with clients)