multi: Remove rpctest package#3028
Conversation
|
Looks great 👍 |
davecgh
left a comment
There was a problem hiding this comment.
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.
davecgh
left a comment
There was a problem hiding this comment.
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
rpctestpackage to a new internalintegration/rpctestspackage, switches them to use the recently introduceddcrtest/dcrdtestpackage and finally removes therpctestpackage from this repository.