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

FastCatchup - add unit testing for ledgerFetcher #1147

Merged
merged 202 commits into from
Jun 9, 2020

Conversation

tsachiherman
Copy link
Contributor

@tsachiherman tsachiherman commented Jun 9, 2020

Summary

Add testing for the ledgerFetcher

Notes

  1. Refactor ledger.CatchpointCatchupAccessor into an Interface, so it could be mocked out and abstracted.
  2. Create a mockCatchpointCatchupAccessor.go
  3. Create a unit tests for ledgerFetcher which covers all the error execution paths.

@tsachiherman tsachiherman marked this pull request as ready for review June 9, 2020 17:43
@tsachiherman tsachiherman self-assigned this Jun 9, 2020
Copy link
Contributor

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

Copy link
Contributor

@algorandskiy algorandskiy left a comment

Choose a reason for hiding this comment

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

Would be nice to have a happy case test as well

Copy link
Contributor

@wjurayj-algo wjurayj-algo left a comment

Choose a reason for hiding this comment

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

Mostly looks good to my eyes, my only real concern is the pointer return discrepancy I commented.

catchup/ledgerFetcher_test.go Show resolved Hide resolved
ledger/catchupaccessor.go Show resolved Hide resolved
Copy link
Contributor

@wjurayj-algo wjurayj-algo left a comment

Choose a reason for hiding this comment

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

All looks good!

@tsachiherman
Copy link
Contributor Author

Would be nice to have a happy case test as well

definitely. I'm planning to get there. however, I'm trying to prioritize the use cases which aren't covered at all by other tests first. The success case is covered by the e2e test, so it "defaults" to have a lower priority.

@tsachiherman tsachiherman merged commit 13b7864 into algorand:master Jun 9, 2020
@tsachiherman tsachiherman deleted the tsachi/fastcatchup3 branch June 9, 2020 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants