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 failure #89

Closed
bergmark opened this issue Aug 13, 2018 · 8 comments
Closed

Test failure #89

bergmark opened this issue Aug 13, 2018 · 8 comments

Comments

@bergmark
Copy link

This happened on the stackage server, but i couldn't reproduce it locally...

Building test suite 'spec' for servant-swagger-1.1.5..
[1 of 2] Compiling Servant.SwaggerSpec ( test/Servant/SwaggerSpec.hs, dist/build/spec/spec-tmp/Servant/SwaggerSpec.o )
[2 of 2] Compiling Main             ( test/Spec.hs, dist/build/spec/spec-tmp/Main.o )
Linking dist/build/spec/spec ...
> /tmp/stackage-build12/servant-swagger-1.1.5$ dist/build/doctests/doctests
/tmp/stackage-build12/servant-swagger-1.1.5/src/Servant/Swagger.hs:158: failure in expression `hspec $ validateEveryToJSON (Proxy :: Proxy UserAPI)'
expected:
          [User]
          User
          UserId

          Finished in ... seconds
          3 examples, 0 failures
 but got:
          [User]
            +++ OK, passed 100 tests.
          User
            +++ OK, passed 100 tests.
          UserId
            +++ OK, passed 100 tests.

          Finished in 0.1027 seconds
          3 examples, 0 failures

/tmp/stackage-build12/servant-swagger-1.1.5/src/Servant/Swagger/Internal/Test.hs:46: failure in expression `hspec $ context "ToJSON matches ToSchema" $ validateEveryToJSON (Proxy :: Proxy UserAPI)'
expected:
          ToJSON matches ToSchema
            User
            UserId

          Finished in ... seconds
          2 examples, 0 failures
 but got:
          ToJSON matches ToSchema
            User
              +++ OK, passed 100 tests.
            UserId
              +++ OK, passed 100 tests.

          Finished in 0.0066 seconds
          2 examples, 0 failures

/tmp/stackage-build12/servant-swagger-1.1.5/src/Servant/Swagger/Internal/Test.hs:99: failure in expression `:{
  hspec $
    context "read . show == id" $
      props
        (Proxy :: Proxy [Eq, Show, Read])
        (\x -> read (show x) == x)
        (Proxy :: Proxy [Bool, Int, String])
:}'
expected:
          read . show == id
            Bool
            Int
            [Char]

          Finished in ... seconds
          3 examples, 0 failures
 but got:
          read . show == id
            Bool
              +++ OK, passed 100 tests.
            Int
              +++ OK, passed 100 tests.
            [Char]
              +++ OK, passed 100 tests.

          Finished in 0.0145 seconds
          3 examples, 0 failures

Examples: 82  Tried: 77  Errors: 0  Failures: 3
@fizruk
Copy link
Member

fizruk commented Aug 14, 2018

I think this is because hspec-2.5.0 has changed output for QuickCheck properties and now includes all of it (see hspec/hspec#257).

I will update doctests, although I'm not sure if I need to bump version. @phadej can you advise?

@phadej
Copy link
Contributor

phadej commented Aug 14, 2018

I'd rather do it properly this time:

  • make swagger2 test-driver agnostic
  • have swagger2-hspec with current hspec functionality
  • use something with deterministic output in doctests

@phadej
Copy link
Contributor

phadej commented Aug 14, 2018

... and I'm personally against making releases just to update tests. We can bound hspec version to correct one in released versions, but hold on until we have another reasons to make a release.

@phadej
Copy link
Contributor

phadej commented Aug 14, 2018

Note to self: add bounds to test-dependencies in the next release.

@phadej
Copy link
Contributor

phadej commented Aug 14, 2018

... hmm, i cannot reproduce this. With hspec-2.4 and hspec-2.5 doctests pass fine.

@phadej
Copy link
Contributor

phadej commented Aug 14, 2018

Looks like I already fixed tests 249530d9, but as mentioned, didn't care to make a release because of tests only.

@phadej
Copy link
Contributor

phadej commented Aug 14, 2018

And now, I don't want to make a release before #87 is fixed, even the new prettyValidateWith export in the Internal module.

@bergmark
Copy link
Author

Thanks! no problem leaving this without a release for now.

fisx pushed a commit to wireapp/servant-swagger that referenced this issue Jun 1, 2019
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