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

test(grpc): Add snapshots #8277

Merged
merged 5 commits into from Feb 16, 2024
Merged

test(grpc): Add snapshots #8277

merged 5 commits into from Feb 16, 2024

Conversation

oxarbitrage
Copy link
Contributor

Motivation

As part of #8244 we want to do snapshot tests for the responses of the new grpc methods.

PR Author Checklist

Check before marking the PR as ready for review:

  • Will the PR name make sense to users?
  • Does the PR have a priority label?
  • Have you added or updated tests?
  • Is the documentation up to date?

Solution

Add snapshots for the grpc methods that currently return other data than Empty.

Review

Anyone can review.

Reviewer Checklist

Check before approving the PR:

  • Does the PR scope match the ticket?
  • Are there enough tests to make sure it works? Do the tests cover the PR motivation?
  • Are all the PR blockers dealt with?
    PR blockers can be dealt with in new tickets or PRs.

And check the PR Author checklist is complete.

Follow Up Work

@oxarbitrage oxarbitrage added C-testing Category: These are tests A-blockchain-scanner Area: Blockchain scanner of shielded transactions P-Medium ⚡ labels Feb 15, 2024
@oxarbitrage oxarbitrage requested a review from a team as a code owner February 15, 2024 23:24
@oxarbitrage oxarbitrage requested review from arya2 and removed request for a team February 15, 2024 23:24
@github-actions github-actions bot added the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label Feb 15, 2024
Copy link
Contributor

@arya2 arya2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Thank you for adding these snapshots.

I left a few suggestions that may involve significant changes, let me know if you'd like me to open a suggestion PR for some of them.

zebra-grpc/src/tests/snapshot.rs Outdated Show resolved Hide resolved
zebra-grpc/src/tests/snapshot.rs Outdated Show resolved Hide resolved
zebra-grpc/src/tests/snapshot.rs Outdated Show resolved Hide resolved
zebra-grpc/src/tests/snapshot.rs Outdated Show resolved Hide resolved
zebra-grpc/src/tests/snapshot.rs Outdated Show resolved Hide resolved
zebra-grpc/src/tests/snapshot.rs Outdated Show resolved Hide resolved
zebra-grpc/src/tests/snapshot.rs Outdated Show resolved Hide resolved
@oxarbitrage
Copy link
Contributor Author

Feel free to push commits directly or open a PR pointing here. I will go over the suggestions otherwise tomorrow.

@arya2 arya2 requested a review from upbqdn February 16, 2024 04:33
@mpguerra mpguerra linked an issue Feb 16, 2024 that may be closed by this pull request
@oxarbitrage
Copy link
Contributor Author

@mpguerra please note this PR will not close the #8244 completely but partially.

I think we still need tests for testing all the grpc methods specially the ones that are not snapshoted. I will add that in another PR.

Copy link
Contributor Author

@oxarbitrage oxarbitrage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arya2 thank you for the simplifications. looks cleaner now, i made a few small doc changes. feel free to merge.

zebra-grpc/src/tests/snapshot.rs Outdated Show resolved Hide resolved
zebra-grpc/src/tests/snapshot.rs Outdated Show resolved Hide resolved
zebra-grpc/src/tests/snapshot.rs Show resolved Hide resolved
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
@arya2 arya2 mentioned this pull request Feb 16, 2024
9 tasks
@mergify mergify bot merged commit fbddec3 into main Feb 16, 2024
154 checks passed
@mergify mergify bot deleted the issue8244 branch February 16, 2024 19:41
upbqdn pushed a commit that referenced this pull request Feb 16, 2024
* add grpc snapshot tests

* replaces ScanService with MockService in snapshot tests

* removes dev-dep in zebra-grpc on zebra-scan and updates snapshots

* Apply suggestions from code review

Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-blockchain-scanner Area: Blockchain scanner of shielded transactions C-testing Category: These are tests C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG P-Medium ⚡
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tests for gRPC methods
2 participants