Add genesis tests to increase coverage #653
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses this issue, by including test cases that increase the genesis coverage from an initial
builder -> 80%
customnet -> 0%
devnet -> 0%
genesis -> 60%
mainnet -> 0%
testnet -> 70.6%
to
builder -> 90%
customnet -> 75%
devnet -> 75.7%
genesis -> 73.3%
mainnet -> 76.4%
testnet -> 70.6%
The lack of 80% coverage across all files is due to the fact that some parts of the code are unreachable. For example see the below snippet. To my understanding we are setting some global hardcoded values to the state and we have some error checking code. Since the value is constant and valid, the error case is never executed thus showing up as uncovered code.
Let me know if I am missing something or if this is indeed coverable code.
@libotony Regarding the unused function its actually used to increase coverage in
TestNewDevnetCustomTimestamp