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

1.5.1 breaks Cabal test suites #421

Closed
geekosaur opened this issue Jun 22, 2024 · 6 comments
Closed

1.5.1 breaks Cabal test suites #421

geekosaur opened this issue Jun 22, 2024 · 6 comments

Comments

@geekosaur
Copy link

We've been using tasty 1.5, but 1.5.1 was just released today and now our CI gets:

tests/UnitTests/Distribution/Solver/Modular/QuickCheck/Utils.hs:34:25: error: [GHC-83865]
Error:     • Couldn't match expected type: (Test.QuickCheck.Random.QCGen, Int)
                  with actual type: Maybe a1
    • In the pattern: Just override
      In the pattern: QuickCheckReplay (Just override)
      In a case alternative:
          QuickCheckReplay (Just override) -> return override
   |
34 |       QuickCheckReplay (Just override) -> return override
   |                         ^^^^^^^^^^^^^

tests/UnitTests/Distribution/Solver/Modular/QuickCheck/Utils.hs:35:24: error: [GHC-83865]
Error:     • Couldn't match expected type: (Test.QuickCheck.Random.QCGen, Int)
                  with actual type: Maybe a0
    • In the pattern: Nothing
      In the pattern: QuickCheckReplay Nothing
      In a case alternative:
          QuickCheckReplay Nothing -> getStdRandom random
   |
35 |       QuickCheckReplay Nothing -> getStdRandom random
   |                        ^^^^^^^

tests/UnitTests/Distribution/Solver/Modular/QuickCheck/Utils.hs:37:39: error: [GHC-83865]
Error:     • Couldn't match expected type: (Test.QuickCheck.Random.QCGen, Int)
                  with actual type: Maybe a1
    • In the first argument of ‘QuickCheckReplay’, namely
        ‘(Just replay)’
      In the first argument of ‘setOption’, namely
        ‘(QuickCheckReplay (Just replay))’
      In the first argument of ‘run’, namely
        ‘(setOption (QuickCheckReplay (Just replay)) options)’
    • Relevant bindings include
        replay :: a1
          (bound at tests/UnitTests/Distribution/Solver/Modular/QuickCheck/Utils.hs:33:5)
   |
37 |     run (setOption (QuickCheckReplay (Just replay)) options) test progress
   |                                       ^^^^^^^^^^^

While the errors involve QuickCheck, it hasn't changed recently, while the build log says Test.Tasty.Providers did change and forced the rebuild.

@geekosaur
Copy link
Author

Confirmed: changing our tasty constraint from <1.6 to <1.5.1 our tests build. Shouldn't this kind of change not happen in minor releases?

@Bodigrim
Copy link
Collaborator

Isn't this caused by tasty-quickcheck-0.11, which is a major release?

@Bodigrim
Copy link
Collaborator

You can probably replace Nothing with QuickCheckReplayNone and Just with QuickCheckReplayLegacy. Or put tasty-quickcheck < 0.11 if time is short.

@Bodigrim
Copy link
Collaborator

(intSeed, replaySeed) <- case quickCheckReplay of
QuickCheckReplayNone -> do
intSeed <- getStdRandom (randomR (1,999999))
return (intSeed, (mkQCGen intSeed, 0))
QuickCheckReplayLegacy intSeed -> return (intSeed, (mkQCGen intSeed, 0))
-- The intSeed is not used when the new form of replay seed is used.
QuickCheckReplay replaySeed -> return (0, replaySeed)

...and then show (intSeed, replaySeed) instead of show replay.


It would be better to fix the root cause for Cabal's workaround by implementing #359 (comment). Should be pretty straightforward.

@geekosaur
Copy link
Author

We're trying to get a release out, so I'm pushing the constraint. I just got a successful validate run.

@Bodigrim
Copy link
Collaborator

Cf. haskell/cabal#10136

peti added a commit to opensuse-haskell/configuration that referenced this issue Jul 12, 2024
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

2 participants