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(scan): Add raw database format snapshots to the scanner #8075

Merged
merged 15 commits into from
Dec 12, 2023
Merged

Conversation

teor2345
Copy link
Collaborator

@teor2345 teor2345 commented Dec 7, 2023

Motivation

These are part of the standard database tests in #8069.

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?

If a checkbox isn't relevant to the PR, mark it as done.

Complex Code or Requirements

Not really, it's just the same as the state.

Solution

  • Add snapshot tests for the raw scanner database format
  • Expose database test support code in zebra-state
  • Expose test support code in zebra-scan

Related changes:

  • Make scanner storage methods clearer and easier to use
  • Move scanner tests to a submodule

Testing

These are extra tests.

I have manually checked the data formats in the snapshots and they appear correct.

Review

Because of the code movement, the state db test APIs, and the storage API changes, this PR blocks other tests. So it would be good to get it merged soon. It doesn't need to be in the release.

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

The rest of the tests in #8069

@teor2345 teor2345 added P-High 🔥 C-testing Category: These are tests A-state Area: State / database changes C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG A-blockchain-scanner Area: Blockchain scanner of shielded transactions labels Dec 7, 2023
@teor2345 teor2345 self-assigned this Dec 7, 2023
@teor2345 teor2345 requested a review from a team as a code owner December 7, 2023 23:49
@teor2345 teor2345 requested review from arya2 and removed request for a team December 7, 2023 23:49
@oxarbitrage
Copy link
Contributor

@teor2345
Copy link
Collaborator Author

Thanks for fixing up the imports, that was a bit of a mistake from me!

Copy link
Contributor

@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.

looks good to me.

@arya2 arya2 added the do-not-merge Tells Mergify not to merge this PR label Dec 11, 2023
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.

Looks good!

zebra-scan/src/storage/db/sapling.rs Show resolved Hide resolved
@teor2345 teor2345 removed the do-not-merge Tells Mergify not to merge this PR label Dec 12, 2023
mergify bot added a commit that referenced this pull request Dec 12, 2023
@mergify mergify bot merged commit 3318eaa into main Dec 12, 2023
150 checks passed
@mergify mergify bot deleted the scan-db-test branch December 12, 2023 07:45
@oxarbitrage oxarbitrage mentioned this pull request Jan 17, 2024
41 tasks
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 A-state Area: State / database changes C-testing Category: These are tests C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test: Add database snapshot tests for the scanner database
3 participants