Skip to content
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

Test failures -> Cardano.Wallet.Primitive.Types.Ranges #917

Closed
piotr-iohk opened this issue Oct 25, 2019 · 3 comments
Closed

Test failures -> Cardano.Wallet.Primitive.Types.Ranges #917

piotr-iohk opened this issue Oct 25, 2019 · 3 comments
Assignees

Comments

@piotr-iohk
Copy link
Contributor

Release Operating System Cause
next Windows & OSX & Linux) Code v Configuration v Environment v Human v Unknown

Context

Those tests failed already on several prs.

    Failures:
 
      test/unit/Cardano/Wallet/Primitive/TypesSpec.hs:304:9:
      1) Cardano.Wallet.Primitive.Types.Ranges Range (succ a) b `isSubrangeOf` Range a b
           *** Gave up! Passed only 99 tests; 3 discarded tests:
           76% has upper bound
           71% has lower bound
           54% is finite
 
      To rerun use: --match "/Cardano.Wallet.Primitive.Types/Ranges/Range (succ a) b `isSubrangeOf` Range a b/"
 
      test/unit/Cardano/Wallet/Primitive/TypesSpec.hs:313:9:
      2) Cardano.Wallet.Primitive.Types.Ranges Range a (pred b) `isSubrangeOf` Range a b
           *** Gave up! Passed only 99 tests; 3 discarded tests:
           76% has upper bound
           71% has lower bound
           54% is finite
 
      To rerun use: --match "/Cardano.Wallet.Primitive.Types/Ranges/Range a (pred b) `isSubrangeOf` Range a b/"

Additional context: #915 (comment)

Steps to Reproduce

To rerun use: --match "/Cardano.Wallet.Primitive.Types/Ranges/Range (succ a) b `isSubrangeOf` Range a b/"

To rerun use: --match "/Cardano.Wallet.Primitive.Types/Ranges/Range (succ a) b `isSubrangeOf` Range a b/"

Expected behavior

Should pass.

Actual behavior

They fail.


Resolution Plan

PR

Number Base
#? develop

QA

@jonathanknowles jonathanknowles self-assigned this Oct 28, 2019
iohk-bors bot added a commit that referenced this issue Oct 28, 2019
927: Fix range tests by generating non-singleton ranges directly. r=jonathanknowles a=jonathanknowles

# Issue Number

#917

# Overview

This PR:

- [x] Adds a `NonSingletonRange` type and associated `Arbitrary` instance. Generated ranges of this type are always expected to contain than one value.
- [x] Adds tests to demonstrate that the generator and shrinker for `NonSingletonRange` always produces non-singleton ranges.
- [x] Uses the `NonSingletonRange` type to replace the preconditions for the `isSubrange` tests.

# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Jonathan Knowles <[email protected]>
@KtorZ
Copy link
Member

KtorZ commented Oct 30, 2019

@jonathanknowles please remember to send this to QA if now fixed.

@jonathanknowles
Copy link
Member

@jonathanknowles please remember to send this to QA if now fixed.

Done.

@piotr-iohk
Copy link
Contributor Author

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants