haskell-graphql / graphql-api

Write type-safe GraphQL services in Haskell
BSD 3-Clause "New" or "Revised" License
406 stars 35 forks source link

[Feature Request] Prettier (color) printing for the Tasty tests. #136

Closed sunwukonga closed 6 years ago

sunwukonga commented 6 years ago

The output of the HSpec tests isn't very inspiring (I much prefer big green OK's or ticks).

From https://github.com/hspec/hspec/issues/333, it seems that a custom formatter can be added to the package.yaml file. Unfortunately, I've never done that before, and I'm wandering in the dark. I couldn't find a hpack option under tests that seemed appropriate. Maybe changing type: exitcode-stdio-1.0, but I don't know. Regardless, even if this is the option, I don't know an appropriate alternative.

sunwukonga commented 6 years ago

The reason for this is that I'd like to start offering bounties through bountysource or similar, and to do that the problem domain needs to be well specified with meaningful (and visually distinct) tests that highlight the non-negotiable properties of a successful solution.

jml commented 6 years ago

This will do the trick:

$ stack test --fast graphql-api

It won't run the tutorial tests or the graphql-wai tests though.

sunwukonga commented 6 years ago

I see, the --fast option turns off optimizations, and presumably one of those optimizations is to not print out the individualized test results.

Excellent! Thank you :)

jml commented 6 years ago

No, --fast works with colour too. The trick is to specify which stack package is being built. Our stack.yaml has three, and if stack test --fast is run without specifying a package, it will run all three in parallel, and suppress output to avoid weird interleaving behaviour. If you run a single package, it just executes the test suite normally.

On Thu, 21 Dec 2017 at 08:41 Paul Desmond Parker notifications@github.com wrote:

Closed #136 https://github.com/jml/graphql-api/issues/136.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/jml/graphql-api/issues/136#event-1397555009, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHq6rALS7kFEnHWHRYOfl0a6veuJ3GPks5tChm7gaJpZM4RH-zg .

sunwukonga commented 6 years ago

OK, now I've got it 👍

sol commented 6 years ago

@sunwukonga please note that you are not getting Hspec's output. You are using tasty-hspec, which will result in Tasty producing the output. Please also note that unless you have very specific requirements, tasty-hspec is almost never what you want (what you get here is the common denominator of Hspec and Tasty while at the same time committing to the superset of their dependencies).

All that said, you may still not like Hspec's default output. Hspec comes with 4 different default formatters, and if you like non of them then you have to write your own.