-
Notifications
You must be signed in to change notification settings - Fork 296
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
multi: Remove rpctest package #3028
Conversation
Looks great 👍 |
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.
Looks great overall thus far, but I did notice that it needs to run go mod tidy
because hdkeychain
is no longer a direct dependency.
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.
Very nice work on this and getting the RPC testing framework all split out and updated to improve some of its warts.
I ran the relevant affected tests on both a Linux and Windows environment:
$ go test ./internal/rpcserver
ok github.com/decred/dcrd/internal/rpcserver 5.628s
$ go test -tags rpctest ./internal/integration/rpctests
ok github.com/decred/dcrd/internal/integration/rpctests 53.963s
I also confirmed that it is in fact building the most recent dcrd code before running the tests by both manually examining the built binary in the temp dir and also by intentionally breaking an RPC handler:
$ go test -tags rpctest -run=TestRpcServer ./internal/integration/rpctests
--- FAIL: TestRpcServer (2.80s)
rpcserver_test.go:41: Block hashes do not match. Returned hash 0000000000000000000000000000000000000000000000000000000000000000, wanted hash 008e857ca0493162baf6c7f9261a253bec65cda771d75c09ed3dc309da66a7ab
FAIL
FAIL github.com/decred/dcrd/internal/integration/rpctests 2.920s
FAIL
I'm going to go ahead and approve, but as mentioned, it does still need a go mod tidy
before merge.
This moves all tests that rely on the rpctest package to their own package (internal/integration/rpctests) in preparation of switching to the recently introduced dcrdtest package.
This switches the tests in the rpctests package to use the recently introduced dcrtest/dcrdtest package. Given the rpctests package is inside the main dcrd module, the main dcrd module version is built for use in tests by default.
This removes the now unused rpctest package.
9cf3ad2
to
e9b9a4a
Compare
Tidied and rebased against latest master |
This moves the existing tests that rely on the existing
rpctest
package to a new internalintegration/rpctests
package, switches them to use the recently introduceddcrtest/dcrdtest
package and finally removes therpctest
package from this repository.