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

zcash_client_sqlite: Add a "golden test" framework #1676

Open
str4d opened this issue Dec 30, 2024 · 0 comments
Open

zcash_client_sqlite: Add a "golden test" framework #1676

str4d opened this issue Dec 30, 2024 · 0 comments

Comments

@str4d
Copy link
Contributor

str4d commented Dec 30, 2024

It would be beneficial to be able to generate SQLite database states that we can then test, for example that exhibit a bug that a particular migration is intended to fix (and that we want to ensure is a) fixed, and b) does not revert). However, we also want to avoid enabling the xz vulnerability by committing arbitrary binary data to the repository.

We should add a framework to zcash_client_sqlite (or to the devtools crate as necessary) such that when a developer adds a migration, they can also:

  • Write a script that uses a specific public version of zcash_client_sqlite (and associated crates) to deterministically generate a SQLite database.
  • Commit both the script and the resulting database.
  • Load the database in a test to verify the migration.

CI should detect the commits that create golden test databases, and verify that the committed binary data is reproducible from the script. That way, PR reviewers can just review the generation script, rather than needing to inspect the binary data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant