-
Notifications
You must be signed in to change notification settings - Fork 217
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
More test coverage of selection errors. #2979
More test coverage of selection errors. #2979
Conversation
These now all have the following pattern: - verify<X> : name of function that verifies property <X> - Verify<X>Failure : name of outer constructor for verification failure - Verify<X>FailureInfo : name of inner constructor for verification failure The use of `Failure` and `FailureInfo` avoids confusion with the term `Error`, which will appear only in the names of verification functions for `SelectionError` values.
In cases where it's possible for multiple values to fail verification, our current verification functions go to the effort of pattern matching on and only returning the first such value that failed verification. However, we can simplify the code by just returning all values that fail verification. If callers only wish to report the first value, then callers still have the option to do this.
We will eventually have the following type synonyms: - VerifySelection - VerifySelectionError Shorter names are worth having here, to make these type synonyms less verbose.
In this change we add pattern matches for the various types of errors that we want to verify.
This commit adds coverage checks for the different failure conditions of `performSelection`. The coverage checks are rather numerous, so we also extract them out into a separate function where they can be self-contained.
When testing a `SelectionLimitReachedError`, we don't necessarily have access to the adjusted `outputsToCover` value, as `prepareOutputs` may have adjusted the original outputs, which may give rise to a different value of `SelectionLimit`. So we add `outputsToCover` to the error record type to make testing easier.
ba93cb6
to
0c56da8
Compare
0c56da8
to
03bb00b
Compare
bors r+ |
2979: More test coverage of selection errors. r=jonathanknowles a=jonathanknowles ## Issue Number ADP-1037 ## Summary This PR adds more test coverage of selection errors. Co-authored-by: Jonathan Knowles <[email protected]>
Build failed: Failures:
src/Test/Integration/Scenario/CLI/Shelley/Transactions.hs:243:59:
1) CLI Specifications, SHELLEY_CLI_TRANSACTIONS, TRANS_CREATE_06 - Invalid amount, string with wildcards
uncaught exception: IOException of type ResourceVanished
fd:131: hFlush: resource vanished (Broken pipe)
To rerun use: --match "/CLI Specifications/SHELLEY_CLI_TRANSACTIONS/TRANS_CREATE_06 - Invalid amount/string with wildcards/"
Randomized with seed 1642389836
Finished in 881.4515 seconds, used 943.6028 seconds of CPU time
871 examples, 1 failure, 45 pending Can't seem to find the log on hydra, but here's the failure on buildkite: https://buildkite.com/input-output-hk/cardano-wallet/builds/17337#162299be-70ce-4613-a1fb-9f9193c13795) I'm going try rebuilding just this job before any new merge attempt (to avoid running into a "cached failure"). EDIT: The rebuild succeeded (https://hydra.iohk.io/build/8006913), so going to make a fresh merge attempt. Failure ticket: |
bors r+ |
Build succeeded: |
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.
✅
Issue Number
ADP-1037
Summary
This PR adds more test coverage of selection errors.