Skip to content

Lite: complete test mocks and start some tests#115

Merged
ebuchman merged 7 commits intobucky/spec-reorgfrom
bucky/lite-new-unit-tests
Dec 30, 2019
Merged

Lite: complete test mocks and start some tests#115
ebuchman merged 7 commits intobucky/spec-reorgfrom
bucky/lite-new-unit-tests

Conversation

@ebuchman
Copy link
Contributor

@ebuchman ebuchman commented Dec 29, 2019

First take at some tests for the new verify_single function, ala #113

This completes an implementation of mocks for the core types for the lite module and shows how to use them for testing. Still unmocked are the Store and Requester.

There's probably much to be improved here, including the test names and how we organize them, but this seems like a decent start.

This also surfaced some issues with error types:

  • when used to verify a commit (rather than just checking if we can skip), voting_power_in can't detect signatures from validators not in the current validator set
  • we should have two distinct errors for InsufficientVotingPower - one when it's insufficient to skip, and one when it's insufficient to verify! Otherwise we might start bisecting when really the commit is just invalid ...

For now we're just duplicating some of the mocks that are already in the verifier tests module. Probably verifier.rs and public.rs will be consolidated down to verifier in #114 and this will be deduplicated then.

  • Referenced an issue explaining the need for the change
  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Updated CHANGES.md

@ebuchman ebuchman force-pushed the bucky/lite-new-unit-tests branch from 62c7bfd to f8f9e88 Compare December 29, 2019 19:12
@ebuchman ebuchman marked this pull request as ready for review December 30, 2019 23:17
@ebuchman
Copy link
Contributor Author

I'm going to merge this into bucky/spec-reorg locally and just push there. avoiding squash merge while other PRs are depending on this branch oh man...

@ebuchman ebuchman merged commit f8f9e88 into bucky/spec-reorg Dec 30, 2019
@ebuchman ebuchman mentioned this pull request Dec 31, 2019
5 tasks
@xla xla deleted the bucky/lite-new-unit-tests branch January 18, 2020 15:10
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

Successfully merging this pull request may close these issues.

1 participant