-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
How to write tests for the gateway? #699
Comments
I'm going to close this issue since it's not really related to features or bugs of this library. However, having done this kind of testing myself, here are some pointers:
|
For anyone else stumbling upon this, the 503 Service Unavailable is potentially due to the GRPC server not having fully spun up before a request was launched against it (due to it running within a goroutine). Besides using a |
I've seen this solved in two other ways:
Best of luck! |
I'd like to be able to write some tests to validate that everything that gets auto-generated on the gateway side hasn't changed. Basically, I'd like to write some tests so that I can change things in the proto file but the tests will fail if the gateway doesn't respond ( or throws an error for invalid input ). That way, I don't have to worry about breaking things for the non-grpc clients that use the gateway.
This is what I've got right now ( and it's not working ):
Most of that is copying bits and pieces from how we assemble the grpc/http servers in our service backend library.
The response that comes back:
The request:
Also, right now the test doesn't exit automatically, it gets killed at the 10 minute mark by the testing package.
If I could get some pointers on how to accomplish these kinds of tests, that'd be awesome.
The text was updated successfully, but these errors were encountered: