UnkindPartition / tasty

Modern and extensible testing framework for Haskell
638 stars 108 forks source link

Allow disabling / configuring test timing info #341

Closed brandonchinn178 closed 1 year ago

brandonchinn178 commented 2 years ago

Currently, if a test takes longer than a hardcoded limit, it's printed out.

https://github.com/UnkindPartition/tasty/blob/9b8ce7eb12046ce925b40ff2feb8b3ffde771c8d/core/Test/Tasty/Ingredients/ConsoleReporter.hs#L145-L146

It would be nice to be able to configure this limit. It would also be nice to never print the timing info (equivalent to limit = Infinity) or always print the timing info (equivalent to limit = -Infinity), but just configuring the limit would be sufficient for me.

Context: I'm writing integration tests that check the output of tasty, and currently, I have to strip out the timing information. https://github.com/brandonchinn178/tasty-autocollect/pull/7

Bodigrim commented 2 years ago

Cf. https://github.com/UnkindPartition/tasty/pull/328

bfrk commented 1 year ago

Yes, this is better than merely turning it on or off.

Bodigrim commented 1 year ago

@brandonchinn178 any ideas how to name this flag?

brandonchinn178 commented 1 year ago

No idea 🫤 Maybe something like --min-duration-report?

Bodigrim commented 1 year ago

(I'm not a native speaker) Would --min-duration-to-report be more natural?

Would you like to take a stab at this feature?

brandonchinn178 commented 1 year ago

--min-duration-to-report is better, just longer.

Sure, I might have some time to do this