Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket protocol compatibility testing #93

Open
eswdd opened this issue Dec 4, 2014 · 4 comments
Open

Socket protocol compatibility testing #93

eswdd opened this issue Dec 4, 2014 · 4 comments
Assignees
Milestone

Comments

@eswdd
Copy link
Contributor

eswdd commented Dec 4, 2014

Been thinking about this for a couple of years now, but only really started thinking about how to solve the last week or so.

Currently we test protocol compatibility via unit tests that test every combination of protocol version against each other. The problem is that this is done using the latest code, so it's possible that changes elsewhere that the code protocol could affect protocol compatibility - we're not testing the code from the old version of Cougar.

What I propose is we build an additional all in one jar which contains a small commandline app which starts a socket transport, wires in a fake EV with a v simple Executable that provides echo capability for an RPC call that works and an RPC call that doesn't (and maybe later some v simple push capability). The jar also includes metadata on what versions of the protocol it supports. When started, it searches for a port, starts the binary protocol server on that port, echos the port to the console and waits until killed, processing any requests as they come in.

The jar would also have a client mode which expects certain data to come back from those calls based on the protocol version (i.e. all the data supported by that version).

We then build a test tool which can search a maven repo (local and central ideally) for all the test apps and then runs the full matrix of all of them. This ensures we properly test full compatibility. We should run at least as part of every release.

We could then simplify the unit tests by testing backwards compatibility with the previous version only, which would stop the already spiralling EV client test time getting out of control.

@bfmike
Copy link

bfmike commented Dec 4, 2014

Not everyone upgrades to every new version, so it would be good to run the tests with the current release and all of the released versions within the current major version rather than just the previous version. Major versions should probably pick and document which previous versions are still supported and test against all of those.

@eswdd
Copy link
Contributor Author

eswdd commented Dec 4, 2014

Socket protocol versioning != cougar versioning. So for now at least and
the forseeable future, every version of the socket protocol should be able
to talk to every other version, across all cougar versions that supported
that version as it's highest capability. This is a large matrix, but agree
it should be tested every release.. It just is too big for unit testing.

@atropineal
Copy link
Contributor

i had a poke around on the web and didn't really find any doco on how other
people approach this sort of testing. this sounds pretty decent

so you'd have a set of socket-protocol-compatibility-tests-x.y.z jars, and

for server in jars do
for client in jars do
java -jar $server -mode server -port 8080 &
echo $! > server.pid
# client quits when tests are complete
java -jar $client -mode client -server localhost -port 8080
-client_version $(version_of $client) -server_version $(version_of $server)
2>> error_detail.txt > report.txt
kill $(cat server.pid)
done
done

report.txt:

| client | server | result (failures) |
| x.y.z | a.b.c | PASS |
| a.b.c | x.y.z | FAIL (echo) |

errors.txt

+++ TEST client=a.b.c, server=x.y.z, operation=echo
com.betfair.cougar.client.WhateverException: "wibble"
at .....

you could run the script from a compatibility testing maven module, and
that module could depend on all the versions of clients and servers, then
the script could enumerate them all from the local repo. running something
more portable than bash might be preferable

anyway, liked it enough to think about it and comment :-)

@eswdd
Copy link
Contributor Author

eswdd commented Dec 4, 2014

Yep, pretty much what I was thinking. Java seems pretty portable, boring that it is..

Not sure whether it will happen now. Might just do it for the sake of it.

@eswdd eswdd self-assigned this Jul 13, 2015
@eswdd eswdd added this to the Release 3.3.0 milestone Jul 13, 2015
eswdd added a commit that referenced this issue Jul 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants