-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
x/auth: in-process test refactor #6573
Merged
mergify
merged 71 commits into
master
from
jonathan/auth-module-inprocess-integration-test
Jul 14, 2020
Merged
Changes from 69 commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
9a02e1a
remove unused functions
jgimeno 55cabc9
create helper func to send tx
jgimeno 3c5dec4
refactor to use test help to send tx by client
jgimeno e78c747
Merge branch 'master' into jonathan/auth-module-inprocess-integration…
jgimeno e8242f0
Commit before getting backend.
jgimeno c40e293
Merge branch 'master' into jonathan/auth-module-inprocess-integration…
jgimeno 836b685
Temporal commit
jgimeno 2827d29
temp commit
jgimeno b5f89c7
Merge branch 'master' into jonathan/auth-module-inprocess-integration…
jgimeno 5376b5f
remove the creation of txbuilder from cli
jgimeno 0a6690f
fix imports
jgimeno 204aa71
update changelog
jgimeno db8bc87
Merge branch 'master' into jonathan/tx-builder
jgimeno 58774c3
Remove unused function.
jgimeno 772733e
Merge branch 'jonathan/tx-builder' of github.com:cosmos/cosmos-sdk in…
jgimeno da4f432
Merge branch 'jonathan/tx-builder' into jonathan/auth-module-inproces…
jgimeno af47525
Add flag home into tx sign command.
jgimeno c4ff30e
Merge branch 'jonathan/tx-builder' into jonathan/auth-module-inproces…
jgimeno 3962c82
migrade TestCLIValidateSignatures to use new test suite
jgimeno f46f8ea
Merge branch 'master' into jonathan/auth-module-inprocess-integration…
jgimeno 54a84a6
Merge branch 'master' into jonathan/auth-module-inprocess-integration…
jgimeno 47767d6
migrate test one
jgimeno ea95899
Add changes to make sign batch.
jgimeno 8c7958c
Merge branch 'master' into jonathan/auth-module-inprocess-integration…
jgimeno f0c22e5
make test pass
jgimeno 1e9e3e2
refactor common logic
jgimeno dbe63bd
First part of cli sign.
jgimeno 604a936
Add test for sign batch.
jgimeno 69024ab
Merge branch 'master' into jonathan/auth-module-inprocess-integration…
jgimeno c91d2e5
Merge branch 'master' into jonathan/auth-module-inprocess-integration…
0f26ab0
refactor a little and improve the test
jgimeno 03197b4
Merge branch 'jonathan/auth-module-inprocess-integration-test' of git…
jgimeno 6670230
migrate broadcast command
jgimeno 4fc0031
Merge branch 'master' into jonathan/auth-module-inprocess-integration…
ff460e8
fix linter
jgimeno bfd58dd
Merge branch 'jonathan/auth-module-inprocess-integration-test' of git…
jgimeno 3bab3e5
Remove printf for debug in bank module.
jgimeno 5006376
Fix unused err var.
jgimeno 3a86663
fix linter
jgimeno ebe54b8
fix test
jgimeno 21810a5
fix tests client
jgimeno 7046e76
Fix linter.
jgimeno 286492c
Temp commit signature.
jgimeno 8e9a1d5
encode tx
jgimeno 9f96ef9
migrate tests
jgimeno 1a755a3
Merge branch 'master' into jonathan/auth-module-inprocess-integration…
jgimeno 67805a4
Fix imports.
jgimeno 4973b9a
Remove changelog
jgimeno 1f4db6e
fix tests
jgimeno 54fa3cc
Fix tests.
jgimeno a3f7647
Update x/bank/client/testutil/cli_helpers.go
61ad3cf
Remove alias.
jgimeno 1bf0a90
Merge branch 'jonathan/auth-module-inprocess-integration-test' of git…
jgimeno af3a0f2
Merge branch 'master' into jonathan/auth-module-inprocess-integration…
fedekunze 57baa45
Remove wait for N block func.
jgimeno b7604f5
Merge branch 'jonathan/auth-module-inprocess-integration-test' of git…
jgimeno b9667fe
export callCmd function into its own file.
jgimeno 7bf3912
fix imports
jgimeno 9fba248
Merge branch 'master' into jonathan/auth-module-inprocess-integration…
jgimeno 72debd9
Merge branch 'master' into jonathan/auth-module-inprocess-integration…
alexanderbez a1997f0
bring back to inner functions
jgimeno 8523e71
Merge branch 'jonathan/auth-module-inprocess-integration-test' of git…
jgimeno 9138048
apply mock io
jgimeno bae1521
the helpers use mockio
jgimeno 6a35ee9
fix bug
jgimeno 45374fb
Add Helpers.
jgimeno 4a05e9c
Merge branch 'master' into jonathan/auth-module-inprocess-integration…
jgimeno 16bf27f
Merge branch 'master' into jonathan/auth-module-inprocess-integration…
jgimeno dded545
return to put the function in testutil package
jgimeno 8616606
return BufferWriter in ExecTestCLICmd
jgimeno 4e9e0e3
Merge branch 'master' into jonathan/auth-module-inprocess-integration…
jgimeno File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package cli | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/cosmos/cosmos-sdk/testutil" | ||
) | ||
|
||
// ExecTestCLICmd builds the client context, mocks the output and executes the command. | ||
func ExecTestCLICmd(clientCtx client.Context, cmd *cobra.Command, extraArgs []string) ([]byte, error) { | ||
cmd.SetArgs(extraArgs) | ||
|
||
_, out := testutil.ApplyMockIO(cmd) | ||
clientCtx = clientCtx.WithOutput(out) | ||
|
||
ctx := context.Background() | ||
ctx = context.WithValue(ctx, client.ClientContextKey, &clientCtx) | ||
|
||
if err := cmd.ExecuteContext(ctx); err != nil { | ||
return out.Bytes(), err | ||
} | ||
|
||
return out.Bytes(), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's return
out
here instead of[]byte
. Otherwise, ACK 🎉There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!