-
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
tests: cli_tests no longer call unsafe_reset_all
on local env
#1538
Conversation
* Makes all cli tests use .test_gaiad, .test_gaiacli instead of the same directories as the default binaries * Abstracts alot of the functionality for setting up the server into a single function / file-wide constants. This is to reduce code duplication, especially since some of this functionality depends on each test setting up the keys in the same way. Closes #1461
Note, even though cli tests are broken, this can still be tested locally. (Just check that the last block signed in your |
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.
utACK
cmd/gaia/cli_test/cli_test.go
Outdated
if err != nil { | ||
log.Fatal(err) | ||
} | ||
// Users home directory |
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.
Think this comment is redundant 👍
Codecov Report
@@ Coverage Diff @@
## develop #1538 +/- ##
========================================
Coverage 64.44% 64.44%
========================================
Files 118 118
Lines 6508 6508
========================================
Hits 4194 4194
Misses 2064 2064
Partials 250 250 |
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.
Can we use a temporary directory instead of the user's home directory?
cmd/gaia/cli_test/cli_test.go
Outdated
// helper methods | ||
|
||
func getTestingHomeDirs() (string, string) { | ||
usr, err := user.Current() |
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.
Why do we need to put this in the user's home directory? Can we use a standard temp directory - os.TempDir
- or something?
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.
Good point, will change
cmd/gaia/cli_test/cli_test.go
Outdated
proc = tests.GoExecuteTWithStdout(t, fmt.Sprintf("gaiad start --home=%s --rpc.laddr=%v", gaiadHome, servAddr)) | ||
|
||
return flags, port, proc | ||
} |
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.
Yo so although I like the idea of clumping some common functionality - I think we should be more verbose for these tests and expand this function BACK to the TestXxx
s - The reason being is that these CLI tests have been designed to be readable like a script, I think it it's a step in the wrong direction abstracting anything out from the main test file which contains CLI tests - somebody should be able to just look at the test line-by-line and replicate it's functionality it the CLI
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.
Will revert, thanks! Thats a good point I hadn't considered.
This is done to enhance readability, so one can easily reproduce the functionality in the command line.
Thanks! looking good -besides that CI is failing |
Ok! So merging this is blocked until test_cli is fixed on develop? |
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.
utACK
unsafe_reset_all
on local envunsafe_reset_all
on local env
same directories as the default binaries
a single function / file-wide constants. This is to reduce
code duplication, especially since some of this functionality
depends on each test setting up the keys in the same way.
Closes #1461, #1557
Updated all relevant documentation in docsWrote testsUpdated Gaia/Examples