-
Notifications
You must be signed in to change notification settings - Fork 22
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
Mutation testing #28
Mutation testing #28
Conversation
Codecov Report
@@ Coverage Diff @@
## main #28 +/- ##
=======================================
Coverage 94.06% 94.06%
=======================================
Files 6 6
Lines 1314 1314
=======================================
Hits 1236 1236
Misses 57 57
Partials 21 21
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- ✅
- ✅
- Let's discuss
@JekaMas There is a specific reason why we kept the 2 separate, as |
I with I could keep this files separated. I left a comment, why this is needed. Otherwise, mutations won't be performed versus consensus_test |
.github/workflows/main.yml
Outdated
- name: Mutating testing | ||
run: make mut | ||
|
||
# test-race: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use the -race
flag in the existing workflow? https://github.com/0xPolygon/go-ibft/pull/28/files#diff-7829468e86c1cc5d5133195b5cb48e1ff6c75e3e9203777f6b2e379d9e4882b3R65
Makefile
Outdated
lint: | ||
golangci-lint run -E whitespace -E wsl -E wastedassign -E unconvert -E tparallel -E thelper -E stylecheck -E prealloc \ | ||
-E predeclared -E nlreturn -E misspell -E makezero -E lll -E importas -E ifshort -E gosec -E gofmt -E goconst \ | ||
-E forcetypeassert -E dogsled -E dupl -E errname -E errorlint -E nolintlint --timeout 2m | ||
|
||
install: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about renaming this to install-mut
, so it's more clear?
Makefile
Outdated
|
||
mut: | ||
go-mutesting --blacklist=".github/mut_blacklist" --config=".github/mut_config.yml" ./... | ||
@echo MSI: `jq '.stats.msi' report.json` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: Missing new line
@JekaMas |
Sure, it is from the mutation testing package readme https://github.com/avito-tech/go-mutesting
Also, I just tried it. |
Isn't it possible to just give the directory / package for mutation, instead of a single test file? I've ran it with |
It is possible, although it'd run file by file:
|
@zivkovicmilos Could you check the last changes? I tried a different approach with test files. |
I like this idea of having a test that will be the cornerstone for the cluster mutation tests 💯 |
closed in favor of #38 |
Description
As far as consensus is extremely sensitive functionality, I believe we need a way to check our tests for usefulness and correctness. Code coverage, unfortunately, doesn't tell us about the quality of tests, either about usefulness. Even with high code coverage it's possible to write not very useful tests that always 'green', or tests that are 'green' if being executed in particular order.
For that reason the PR introduces changes:
-race
flag as well. At the moment tests do have data races that'd be great to fix in separate issues.-shuffle
flagChanges include
Checklist
Comments
This PR is for discussion about new tooling. At the moment data race tests and mutation tests are
red
. If we'd like to merge the PR, we should comment out this CI steps and make tasks to fix tests with race and a bunch of tasks to add/check tests with respect of mutation testing results.A few examples of mutation testing:
More results are in the file result.txt