Is it possible to force tty-off output in the test runner?

It’s related to only the built-in test runner.

Depending on whether the device is tty the test runner changes the output format and makes it inconistent across CI, terminal launches, dap consoles (aka terminals) and build jobs.
It makes testing results diagnostics complicated.

so I wonder I missed it or it’s feature request to add a flag to a runner --disable-progress which is available to tty devices and and outputs data like it doesn’t.

In general I would love to see a test runner in std, it’s very useful if you build your test runner to save a canonical error format in order to keep all the IDE testing plugins and CI analytics compatible.

2 Likes

AFAIK, there is no --disable-progress that you missed.

For the time being, you can copy the default build runner and remove the use of std.Progress

For the time being, you can copy the formatting from the default test runner.

Does zig build --color off test help you? It suppresses the progress (and ansi coloring)

1 Like

that’s what I did, but would rather see a built in solution.
I wonder if it’s a good feature request to improve the modularity of the test runner

it’s not really what Im trying to achieve.
test command invokes the test binary with --listen flag in server mode and its output changed even more due to reformat by the build runner.
so that I invoke the tests directly as b.addSystemCommand(&[_][]const u8{"zig-out/bin/test"}) in order to keep the built-in tests output.