-
Notifications
You must be signed in to change notification settings - Fork 10
100% test coverage for validation.go #379
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
Conversation
…ing test coverage for validateFileContracts
…teV2FileContractsValidateRevisionClosure
|
Fixing the failing Lint tests now. |
|
@Alrighttt once this is ready make sure to assign PJ, Nate and me as reviewers. |
|
This is already a beast to review, so I will continue with providing 100% test coverage in subsequent pull requests. |
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.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
n8mgr
left a comment
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.
There are two duplicate test cases for "storage proof conflicts" you didn't add them, but might as well remove them.
Also this file is pretty large. I wouldn't move any existing tests, but if you added any new ones see if they might make sense in a new file i,.e. validation_txn_test.go. We should move existing tests in a follow-up so the diff isn't polluted.
peterjan
left a comment
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.
Left some minor comments, LGTM otherwise. I must admit though I didn't read through every line here 😳
consensus/validation_test.go
Outdated
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 case doesn't make sense. Since we're updating this file anyway we might as well take this along.
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 code is this referencing?
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.
The assertions check whether errString is different from "" and then check whether it's equal.
case test.errString != "" && test.errString == "": line 2273
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.
I removed it altogether. I believe the intent was to provide a check similar to https://github.com/SiaFoundation/core/blob/8b3a30692fd384e44203bac6f8d81e10341dd1ee/consensus/validation_test.go#L2295C1-L2297C5
|
I addressed all review comments. |
… case; Make each case run as a distinct test and verify that the error message matches
This pull request adds test coverage for any remaining cases within validation.go.
Some tests are non-exhaustive and only add test cases that were previously missing. These are noted with developer comments.