-
Notifications
You must be signed in to change notification settings - Fork 589
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
[CI] Mutation testing: Automated github action to generate issue #2204
Conversation
The current implementation outputs mutation test FAILS in a single python output. I'm not sure how i'll break each of the fails and split them up with a number and separate code block without using regex cc @alexanderbez @ValarDragon @nikever @xBalbinus |
You can add code blocks with Let's say the file contains this: --- ./x/tokenfactory/keeper/createdenom.go 2022-07-21 11:57:23.000000000 +0200
+++ /var/folders/p8/6wtxs79s3x75t51d07gnv9c00000gn/T/go-mutesting-3068611658/./x/tokenfactory/keeper/createdenom.go.0 2022-07-23 10:16:35.000000000 +0200
@@ -77,7 +77,7 @@
if err != nil {
return err
}
- if len(creationFee) > 0 {
+ if len(creationFee) >= 0 {
if err := k.distrKeeper.FundCommunityPool(ctx, creationFee, accAddr); err != nil {
return err
}
FAIL "/var/folders/p8/6wtxs79s3x75t51d07gnv9c00000gn/T/go-mutesting-3068611658/./x/tokenfactory/keeper/createdenom.go.0" with checksum 8530d085e7d2c8848191f6d9471baeeb
With cat mutation_test_result.txt | sed "s# @@# @@\n\`\`\`go\n#g " | sed "s#FAIL#\`\`\`\nFAIL\n\n\n#g " > mutation_test_result.txt It will encapsulate the go code in go block and add some new lines at the end: --- ./x/tokenfactory/keeper/createdenom.go 2022-07-21 11:57:23.000000000 +0200
+++ /var/folders/p8/6wtxs79s3x75t51d07gnv9c00000gn/T/go-mutesting-3068611658/./x/tokenfactory/keeper/createdenom.go.0 2022-07-23 10:16:35.000000000 +0200
@@ -77,7 +77,7 @@
```go
if err != nil {
return err
}
- if len(creationFee) > 0 {
+ if len(creationFee) >= 0 {
if err := k.distrKeeper.FundCommunityPool(ctx, creationFee, accAddr); err != nil {
return err
}
\``` # <--- I have added \ to escape the closing block
FAIL "/var/folders/p8/6wtxs79s3x75t51d07gnv9c00000gn/T/go-mutesting-3068611658/./x/tokenfactory/keeper/createdenom.go.0" with checksum 8530d085e7d2c8848191f6d9471baeeb
|
@stackman27 do you have an example of what a github issue would look like when created? |
# for testing | ||
push: | ||
branches: | ||
- mut-test-gen |
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 off of main
?
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.
just so that it runs every time i push to my branch.
All of it is just for testing
name: Generate Mutation Test Errors | ||
|
||
on: | ||
# for testing |
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.
# for testing |
Currently, this line is failing Once resolved the issues should look like this |
It should be possible to create this token on your personal fork, merge this into the main of the fork, and test if this functions correctly by attempting to create an issue there |
Code LGTM, would like to see a sample issue before hitting merge tho |
I also think we're going to eventually need to do a more sophisticated python script to parse this and create the issue text body, but no need to block on this, getting the initial regular issue out is already awesome =) |
hmm looks like i can't create issues in my osmosis-fork. I dont even have a tab for issues 🤔 |
That's weird haha. It looks like forks have to manually enable issues in settings: |
@ValarDragon @p0mvn @alexanderbez Mutation testing issue sample issue: stackman27#13 |
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.
This LGTM, are we switching this from testing to prod values before merging?
Yup just pushed the production version! Good to go now 🚀 |
5b25d2a
to
285b904
Compare
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.
Nice work
Merging since test issue was shown here: stackman27#13 Thanks, @stackman27 |
(cherry picked from commit 3d866e4)
Closes: #2114
What is the purpose of the change
Brief Changelog
n/a
Testing and Verifying
Untested because need
secrets.ADD_TO_PROJECT_PAT
accessDocumentation and Release Note
Unreleased
section inCHANGELOG.md
? (yes / no)x/<module>/spec/
) / Osmosis docs repo / not documented)