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

Revisit invariant checks in all tests #478

Open
LesnyRumcajs opened this issue Jun 15, 2022 · 1 comment
Open

Revisit invariant checks in all tests #478

LesnyRumcajs opened this issue Jun 15, 2022 · 1 comment
Labels
good first issue Good for newcomers testing

Comments

@LesnyRumcajs
Copy link
Contributor

Most of the tests, both crate and ITGs, should include invariant checks at the end, either asserting that everything is passing or that certain invariants are broken (and only them).

While porting tests from Go we might have missed some, either because they were not in the original implementation (but we can improve it here) or just by chance / missed additional tests when rebasing / anything else.

This task is to revisit all of them (writing a script to check where we lack such a check may be useful) and add the check if relevant. If the check is failing, it should fail exactly where we expect it to.

Another idea is to add a customizable destructor in e.g. MockRuntime with a call to proper invariant check. Or a procedural macro. This would reduce code bloat but perhaps we want to keep it explicit.

@anorth anorth added good first issue Good for newcomers testing labels Aug 11, 2022
@anorth anorth moved this to Opportunistic in Network nv17 Aug 11, 2022
@jennijuju jennijuju removed this from Network nv17 Nov 25, 2022
@anorth
Copy link
Member

anorth commented Mar 3, 2023

We did #605. This only checks expectations though, not state invariants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers testing
Projects
None yet
Development

No branches or pull requests

2 participants