Skip to content

Conversation

jml
Copy link
Collaborator

@jml jml commented Feb 8, 2018

We had a weird thing where top-level examples dir symlinked into tests, we used the test suite to compile the examples, and then used the doctests to check the examples worked.

At least one side effect of this is we get cabal warnings all the time:

Warning: There were multiple candidates for the Cabal entry " Examples.InputObject
         * /Users/jml/src/graphql-api/Examples/InputObject.hs
         picking: /Users/jml/src/graphql-api/tests/Examples/InputObject.hs

Warning: There were multiple candidates for the Cabal entry " Examples.UnionExample
         * /Users/jml/src/graphql-api/Examples/UnionExample.hs
         picking: /Users/jml/src/graphql-api/tests/Examples/UnionExample.hs

I've made the examples executables, which means they can be edited & run, which I think is a nice property. This lets us remove the symlink & doctest hackery.

In order to preserve the doctest coverage, I've translated the doctests into end-to-end tests. I think this has been a useful exercise, because it already demonstrates that our input object support / documentation is lacking (see comment on DogStuff).

It also paves the way for a ratcheted test coverage thing, which I'm quite keen to try.

@jml jml force-pushed the make-examples-programs branch from 76fe6cb to 153984c Compare February 9, 2018 07:08
@jml jml force-pushed the make-examples-programs branch from 153984c to 377408b Compare February 9, 2018 07:25
@jml jml requested a review from teh February 9, 2018 07:26
Copy link
Collaborator

@teh teh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC I hadn't gotten around to writing the type machinery for deconstructing input objects so this is the way to do it for now :/

@jml jml merged commit 5ac071e into master Feb 10, 2018
@jml jml deleted the make-examples-programs branch February 10, 2018 14:34
jml added a commit that referenced this pull request Feb 10, 2018
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

Successfully merging this pull request may close these issues.

2 participants