-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Move stdin/stdout/stderr access functionality to cli.context #3558
Comments
Include stderr too. |
Cobra already provides this functionality but there are a few small adjustments to make. Also I have a proof of concept for We can set mocks for stdin, stdout, stderr at the command level: and later confirm outputs: I/O redirection is at the command level so parallel tests are also possible now. I would suggest that we use a cobra fork until the PR gets accepted and adjust tests. |
I would really prefer not to run off of a fork, but this really does add quite a bit of flexibility here and will allow for much better CLI testing. Does anyone else have thoughts here @alessio @alexanderbez @fedekunze |
I can send a PR for review.. it is not complete but gives an idea of how much better the tests look like |
@jleni Would love to see that! |
I have submitted a PR to cobra so this change is accepted upstream and we avoid forking. Unfortunately, things are very coupled at the moment. CLI tests are a lot better but unless the PR is accepted, it will require Tendermint to use the fork or to decouple by using interfaces. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
this will be part of the cli v2 work. |
The problem with context is that moving things there results in cyclic dependencies with
keys
. I will need further refactoring to makecontext
independant from other packages.The original location of
func BufferStdin() *bufio.Reader
and in order to inject a different stdin I placed it as near as possible.I would suggest we create another PR to make context a first-class citizen :) Including stdout too.
Originally posted by @jleni in #3517
The text was updated successfully, but these errors were encountered: