-
Notifications
You must be signed in to change notification settings - Fork 188
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
Add unit tests #10
Comments
I worked on this and the results are at This has reduced Honestly I'm thinking since the project mostly relies on grpc-go’s behavior (e.g. returned error types/codes, timeouts etc), mocking all that stuff with testing seemed redundant. I'm initializing actual tcp server for connection testing, which is good, but then I have to replicate every kind of error (timeouts, general failures, tls hanging etc). Similarly testing I call this a failed experiment and I think we should keep the source code of this project short, given it has not yielded any bug reports despite >80k downloads so far. |
@ahmetb , once again I am trying to contribute to this issue as well. I have added one endtoend testcase - #43 . Most importantly, it does not require any change to existing source file which we intented to make it simple as per previous post. It does following.
|
@arindamnayak You should definitely check out https://github.com/grpc-ecosystem/grpc-health-probe/tree/testing. I think where we actually need tests is around TLS/credentials/flags. It would be much better if we can bring the tests inside unit-test code instead of exec-ing (that way we can tweak the server etc). |
It should be possible to easily spin-up grpc servers in-memory for tests and exercise probing capabilities.
It can be either execing out to a binary, or we could export the probing code to a pkg and just invoke that (but that wouldn't probably test the CLI flags).
The text was updated successfully, but these errors were encountered: