haskell / haskell/cabal

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

Open
#9,809 2 comments 0 reactions 0 assignees View on GitHub
needs triage type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**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
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.