-
Notifications
You must be signed in to change notification settings - Fork 609
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
Osmocli: Fix lines of code overhead + speed of CLI tests #3647
Merged
Conversation
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
ValarDragon
changed the title
Osmocli: Fix CLI tests
Osmocli: Fix lines of code overhead + speed of CLI tests
Dec 7, 2022
github-actions
bot
added
the
C:x/gamm
Changes, features and bugs related to the gamm module.
label
Dec 7, 2022
ValarDragon
force-pushed
the
dev/osmocli_test_fix
branch
from
December 7, 2022 23:07
72fcd5d
to
65ea153
Compare
ValarDragon
added
V:state/compatible/backport
State machine compatible PR, should be backported
A:backport/v13.x
backport patches to v13.x branch
labels
Dec 7, 2022
👍 |
6 tasks
Per call, were good with merging this, as its just CLI affecting. (And unblocks other things) |
mergify bot
pushed a commit
that referenced
this pull request
Dec 12, 2022
* Initial commit for cli test fixing * Finish replacing tx tests * Start query modification for testability * Testing scaffolding now in place * sync * Fix cobra not resetting flag values * Delete more cli tests * Migrate incentives modules tests * WIP on gamm deletion * Finish converting all gamm tx tests * Cleanup gamm index command * pflag -> flag (alias, not import) * Delete tests for 0-arg fns * Convert simple query tests * Finish adapting gamm tests * Changelog * Delete test suite that was never being ran (cherry picked from commit 1986ad2) # Conflicts: # osmoutils/cli_helpers.go
ValarDragon
added a commit
that referenced
this pull request
Dec 13, 2022
) (#3694) * Osmocli: Fix lines of code overhead + speed of CLI tests (#3647) * Initial commit for cli test fixing * Finish replacing tx tests * Start query modification for testability * Testing scaffolding now in place * sync * Fix cobra not resetting flag values * Delete more cli tests * Migrate incentives modules tests * WIP on gamm deletion * Finish converting all gamm tx tests * Cleanup gamm index command * pflag -> flag (alias, not import) * Delete tests for 0-arg fns * Convert simple query tests * Finish adapting gamm tests * Changelog * Delete test suite that was never being ran (cherry picked from commit 1986ad2) # Conflicts: # osmoutils/cli_helpers.go * Fix conflict Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Dev Ojha <dojha@berkeley.edu>
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A:backport/v13.x
backport patches to v13.x branch
C:CLI
C:x/gamm
Changes, features and bugs related to the gamm module.
C:x/incentives
C:x/lockup
C:x/pool-incentives
V:state/compatible/backport
State machine compatible PR, should be backported
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.
Cref: #3641
What is the purpose of the change
Makes writing CLI tests very fast, and few lines of code, testing exactly what you want to test
Txs currently done and queries done. Propogated to most of the CLI.
Net
go test time
down from 4minutes to 3minutes 30 seconds. (I am confused though, because if you add up the time thats no longer in CLI tests from gamm, incentives, lockup, thats 76 seconds. So perhaps theres some degree of parallelism in tests somewhere? But also confusingly, sum of the remaining module test times appear to me to be roughly around 2 minutes, not sure how its still saying its 3.5 minutes. My guess would be theres something with it not counting time executed from cgo/cosmwasm contracts?)Brief Changelog
Testing and Verifying
This change adds tests for all CLI commands it changes, that can be easily verified!
Note, I do also delete a few of the old cli_tests in lockup. We tested parsing of a larger subset of the messages before, but due to the standardization now applied, I only wrote one test per "class" of message we parse.
Documentation and Release Note
Unreleased
section inCHANGELOG.md
? yes