-
Notifications
You must be signed in to change notification settings - Fork 490
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
tests: add catchpoint downloading/parsing to e2e catchup tests #6224
base: master
Are you sure you want to change the base?
Conversation
Running these assertions on TestStateProofInReplayCatchpoint but with the fix in #6214 commented out, it caught the issue:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6224 +/- ##
==========================================
- Coverage 51.86% 51.85% -0.02%
==========================================
Files 643 643
Lines 86382 86382
==========================================
- Hits 44806 44796 -10
- Misses 38714 38724 +10
Partials 2862 2862 ☔ View full report in Codecov by Sentry. |
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.
I'd prefer not to export chunks internals out of ledger to prevent dependencies growing given there is already multi-version confusion.
How about making the validateCatchpointChunks
an internal exported function on some some ValidatableCatchpointChunk
interface?
So move it out of _test.go code? Not sure what the best design is — I need to decode and validate the chunks directly in my test. Maybe I could have a decoder interface method turn it into a JSON style map or something if we don't want chunks exported. |
Summary
While working on #6214 and #6177, it would have been nice to be able to download catchpoint files and decode them inside E2E tests. This exports the catchpoint chunk formats (and msgp unmarshal code), so they can be used by the e2e tests to decode and assert catchpoint file snapshot contents.
While renaming the chunk types so they would be exported, their new names were carefully chosen to preserve alphabetical ordering and make the diff in msgp_gen.go easy to review (to see it is a name change only, no other changes to decode/encode logic).
Test Plan
Existing E2E tests should pass, with additional assertions added.