haskell / cabal

Official upstream development repository for Cabal and cabal-install
https://haskell.org/cabal
Other
1.62k stars 696 forks source link

`cabal test` does no longer direct stdout to log file? #9809

Open jwaldmann opened 7 months ago

jwaldmann commented 7 months ago

Describe the bug

cabal test used to redirect stdout to the log file, but no longer does this?

To Reproduce

$ cabal unpack ersatz-0.5
$ cd ersatz-0.5
$ cabal test hunit

Expected behavior

with cabal-install version 3.10.2.1 , output is

...
Running 1 test suites...
Test suite hunit: RUNNING...
Test suite hunit: PASS
Test suite logged to:
/home/waldmann/tmp/ersatz-0.5/dist-newstyle/build/x86_64-linux/ghc-9.8.2/ersatz-0.5/t/hunit/test/ersatz-0.5-hunit.log
1 of 1 test suites (1 of 1 test cases) passed.

and the log file contains actual test output.

Observed behaviour

with cabal-install version 3.11.0.0, output is

...
Running 1 test suites...
Test suite hunit: RUNNING...
unit tests:
  unconstrained literals: [OK]

         Test Cases  Total 
 Passed  1           1     
 Failed  0           0     
 Total   1           1     
Test suite hunit: PASS
Test suite logged to:
/home/waldmann/tmp/ersatz-0.5/dist-newstyle/build/x86_64-linux/ghc-9.8.2/ersatz-0.5/t/hunit/test/ersatz-0.5-hunit.log
1 of 1 test suites (1 of 1 test cases) passed.

and the mentioned log file contains only

Test suite hunit: RUNNING...
Test suite hunit: PASS
Test suite logged to: /home/waldmann/tmp/ersatz-0.5/dist-newstyle/build/x86_64-linux/ghc-9.8.2/ersatz-0.5/t/hunit/test/ersatz-0.5-hunit.log

and NOT the actual test output.

System information

Fedora GNU/Linux 6.7.6-200.fc39.x86_64, ghc-9.8.2, cabal-install built from source at

commit b75671b0bb163a52a00df403eaf5d545121a27a3 (HEAD -> 3.12, origin/3.12)
Merge: 880831f97 698339c07
Author: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Date:   Mon Mar 11 15:06:57 2024 +0000
alt-romes commented 7 months ago

This was most likely introduced by me in #9524, it is very similar to the same change it introduced cabal build (#9607).

If that is the case, it should be very straightforward to fix.

alt-romes commented 7 months ago

I had mentioned the wrong PR that fixed this same issue for build, it should be: #9607