Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I stream test results with cabal new-test?

Using cabal test, you're able to stream results with cabal test --show-details=streaming.

I can't find a comparable option for cabal new-test. Is it possible to stream results using new-test?

like image 469
MaxGabriel Avatar asked Jul 23 '18 23:07

MaxGabriel


2 Answers

I just ran into this an hour ago myself!

The --show-details flag is not yet supported by new-test: https://github.com/haskell/cabal/issues/4766

The discussion in the bug report indicate that maybe --show-details was a misfeature anyways, and it should always just stream.

like image 56
Joachim Breitner Avatar answered Oct 13 '22 00:10

Joachim Breitner


As of PR 5455 (available since Cabal-install 3, see changelog), you can use the flag:

--test-show-details=streaming

Example:

~/hackage-server $ cabal test --enable-tests --test-show-details=streaming ReverseDependenciesTest
Building test suite 'ReverseDependenciesTest' for hackage-server-0.5.1..
Test suite ReverseDependenciesTest: RUNNING...
ReverseDependenciesTest
  with set [beeline->mtl] and querying for mtl, we get beeline:                                        OK
  revPackageName selects only latest version, even if it has no dependency on chosen package:          OK
  revPackageId does select old version when queried with old reverse dependency:                       OK
  revPackageName can find multiple packages:                                                           OK
  with set [beeline->mtl->base, lens->mtl->base], revPackageFlat 'base' finds [beeline, lens, mtl]:    OK
  with set [beeline->mtl->base, lens->mtl->base], revPackageStats 'base' return 1,3:                   OK
  with set [beeline->mtl->base, lens->mtl->base], queryReverseDeps 'base' return [mtl],[beeline,lens]: OK

All 7 tests passed (0.01s)
like image 24
Janus Troelsen Avatar answered Oct 12 '22 22:10

Janus Troelsen