Skip to content
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

Merged
merged 3 commits into from
Nov 30, 2022
Merged

Conversation

matheusd
Copy link
Member

This moves the existing tests that rely on the existing rpctest package to a new internal integration/rpctests package, switches them to use the recently introduced dcrtest/dcrdtest package and finally removes the rpctest package from this repository.

@dnldd
Copy link
Member

dnldd commented Nov 30, 2022

Looks great 👍

Copy link
Member

@davecgh davecgh left a 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.

@davecgh davecgh added this to the 1.8.0 milestone Nov 30, 2022
@davecgh davecgh added the test coverage Discussion and pull requests for improving test coverage. label Nov 30, 2022
Copy link
Member

@davecgh davecgh left a 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.
@matheusd
Copy link
Member Author

Tidied and rebased against latest master

@davecgh davecgh merged commit 79402f2 into decred:master Nov 30, 2022
@matheusd matheusd deleted the remove-rpctest branch November 30, 2022 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test coverage Discussion and pull requests for improving test coverage.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants