-
Notifications
You must be signed in to change notification settings - Fork 220
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
Make DB QSM tests fail if one or more tags are not covered. #367
Conversation
…ot covered. Module `Cardano.Wallet.DB.StateMachine` defined a set of `Tag` values to represent various test scenarios that are considered important or interesting. It also supplied a `tag` function to match `Tag` values to arbitrary sequences of commands. However, the test suite didn't actually check that all possible `Tag` values were covered during execution. This created a risk that we might actually not be covering all the cases we'd like. This change makes the `prop_sequential` property fail if one or more tags are not covered.
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.
Great, I was wondering how to do this.
@@ -118,6 +118,7 @@ test-suite unit | |||
, containers | |||
, cryptonite | |||
, deepseq | |||
, extra >= 1.6.17 |
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.
To get enumerate = [minBound..maxBound]
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.
Agreed, it's a very small function!
But [minBound .. maxBound]
seems to be surprisingly common.
@@ -1,4 +1,4 @@ | |||
resolver: lts-13.8 | |||
resolver: lts-13.24 |
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.
Wow! Careful with this 😄 ... Now we need to reset all the caches in CI because they'll likely have doubled in size.
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.
Wow! Careful with this smile ... Now we need to reset all the caches in CI because they'll likely have doubled in size.
Good point. The first time Travis built this, the build time nearly exceeded the 50 minutes limit. Do we have a defined process for changing the resolver?
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.
Not necessarily, in the sense that, this should work just fine. But we have to make sure to remove the cache from master
before merging. Otherwise, we end up with a cache twice as big on master
because it'll carry two LTS. Although, this will be needed for a short while until everyone gets existing PRs up-to-date.
It's just that, when I see "Make DB QSM tests fail ...", I don't expect an LTS bump 😅 ... It's good to advertise this kind of change on our Slack channel because it impacts everyone.
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.
But we have to make sure to remove the cache from master before merging.
Just to confirm: Can this be done by navigating to https://travis-ci.org/input-output-hk/cardano-wallet/caches and then hitting the garbage can icon?
It's just that, when I see "Make DB QSM tests fail ...", I don't expect an LTS bump sweat_smile ... It's good to advertise this kind of change on our Slack channel because it impacts everyone.
Good point.
Perhaps this is something we can add to our list of things to take care of when writing a PR / doing a review.
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 to confirm: Can this be done by navigating to https://travis-ci.org/input-output-hk/cardano-wallet/caches and then hitting the garbage can icon?
Indeed.
Perhaps this is something we can add to our list of things to take care of when writing a PR / doing a review.
👍
If we add more tags in future, we might have to adjust the coverage threshold. (Currently, it's 5% for every tag.) |
Issue Number
#353
Overview
Module
Cardano.Wallet.DB.StateMachine
defines set ofTag
values to represent various test scenarios that are considered important or interesting. It also supplies atag
function to matchTag
values to arbitrary sequences of commands.However, the test suite doesn't actually check that all possible
Tag
values are covered during execution. This creates a risk that we might actually not be covering all the cases we'd like.prop_sequential
property fail if one or more tags are not covered.Comments
With this change applied, we get the following output from the test suite:
Suppose we add a new constructor
Wibble
to theTag
data type, without modifying thetags
function.Now, if we re-run the test suite, we get a failure: