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

feat(loans): add mutation testing decorations #971

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

daniel-savu
Copy link
Contributor

Decorates all functions in the loans pallet with #[cfg_attr(test, mutate)], so mutagen can mutate them and check if the unit tests break, "killing" the mutations. Only unit tests are used when checking, so some of the surviving mutants exist because they're tested in an integration test.

Most surviving mutants just remove the deposit_event call, however some logic in the interest rate model should actually be better tested. This is the output about surviving mutants: SURVIVED.txt

The mutagen dependency uses the latest master on their GitHub, because version 2.x wasn't released to crates.io for some reason.

@sander2
Copy link
Member

sander2 commented Mar 17, 2023

Related: a long time ago we also looked into getting code coverage info in the CI. I remember it worked, but we never integrated it

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.

2 participants