Introduce cargo mutants cron job#573
Conversation
Pull Request Test Coverage Report for Build 14042949679Details
💛 - Coveralls |
b3e5da6 to
ff1eeb8
Compare
There was a problem hiding this comment.
Based on my current understanding, this cron job would look for mutants over all of payjoin and payjoin-cli each time it runs. Since there are over 250 mutants remaining as you mentioned, it would create a new issue every week flagging the same mutants over and over until we've addressed all of them.
To avoid this noise, we should find (or achieve) a narrow scope of code that has zero mutants and change mutants.toml to exclude everything else, such that running the job returns zero missed mutants. That way this cron job functions as a regression test and we can get true signal if it runs one week and creates an issue.
Over time - as better tests are added to other areas of the code - we can expand the mutation testing scope. For example rust-bitcoin started off by running mutation tests only over the units crate, then expanded to also cover primitives. They also exclude a bunch of crate-specific stuff using regex for reasons, I guess for mutants that are known to be unkillable or not worth the effort.
additional_cargo_args = ["--all-features"]
examine_globs = ["units/src/**/*.rs", "primitives/src/**/*.rs"]
exclude_globs = [
"units/src/amount/verification.rs" # kani tests
]
exclude_re = [
# ...
"deserialize", # Skip serde mutation tests
"Iterator", # Mutating operations in an iterator can result in an infinite loop
# ----------------------------------Crate-specific exclusions----------------------------------
# Units
# src/amount/mod.rs
"parse_signed_to_satoshi", # Can't kill all mutants since there is no denomination smaller than Satoshi
# ...|
Ok! Good call, I'm realizing now that even on their first run the rust-bitcoin mutation cron had 0 missed mutants, they had full coverage before they added theirs. I'll look into a good place to start our scope and then expand it out as we add coverage. alternatively I can close this for now before we feel like its worth adding a cron job for keeping track of regressions |
d0166b8 to
9cdbfbc
Compare
|
I just added additional coverage that completes mutation coverage for |
I guess this will just grow as we go, as these definitely seem like unknown-unknowns at the moment. The first one that comes to mind is the |
At the moment all cargo mutant exploration I have been doing locally but with over 250 missed mutants remaining and possibly growing as new code is introduced I think it is time to implement a weekly cron job to track these mutants. This heavily copies the rust-bitcoin implementation of their mutants workflow with tweaks for our codebase and mutants coverage progress.
|
I added the first crate specific exclude rules relating to |
Relates to #539
This is our first step at cargo mutants in our ci!
At the moment all cargo mutant exploration I have been doing locally but with over 250 missed mutants remaining and possibly growing as new code is introduced I think it is time to implement a weekly cron job to track these mutants.
This heavily copies the rust-bitcoin implementation of their mutants workflow with tweaks for our codebase and mutants coverage progress.
currently set to happen weekly Sun 00:00