-
Notifications
You must be signed in to change notification settings - Fork 2.2k
graph/db: add test coverage for all V1Store methods #9796
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
graph/db: add test coverage for all V1Store methods #9796
Conversation
Expand this existing test so that it also tests that a node's addresses and feature are fetched correctly after insertion. With this, we ensure that the `FetchNodeFeatures` and `AddrsForNodes` methods of the `V1Store` interface are properly covered by unit tests.
Important Review skippedAuto reviews are limited to specific labels. 🏷️ Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
LGTM 🎉
d8fb99e
to
00d7fbc
Compare
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! One small bug, other than that looks great 🎉
In preparation for a different store impl which may wrap errors, we use `require.ErrorIs` for error assertions rather than direct "=" comparisons in tests.
So we can use`require.Equal` for the ChannelEdgeInfo type.
In preparation for our SQL Graph store which wont explicitly store the chain hash but will instead obtain it from the runtime config, we replace the test chainhash value with that of the mainnet genesis hash.
00d7fbc
to
f8b5b75
Compare
Instead of returning an error and needing to call `require.NoError` for each call to `MakeTestGraph`, rather just used the available testing variable to require no error within the function itself.
f8b5b75
to
595077b
Compare
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.
Nice, LGTM 🎉
This PR expands the graph db unit tests to ensure that all the methods covered in the
V1Store
interface are covered.A couple other changes are also made to prepare the tests for the upcoming SQL implementation of the graph store - more detail for these commits is given in the commit messages.
Part of #9795