nextest
nextest copied to clipboard
Figuring out how to fully get colors out of Miri
Miri emits colorful diagnostics only if it is connected to a TTY (we have had a bad time trying to implement --color=always
). Since nextest launches tests in subprocesses and manages them, the Miri process always thinks it isn't connected to a TTY, and doesn't emit colors.
Is this fixable?
For my own purposes I would be fine with setting a config option to have nextest always convince subprocesses that they are connected to a TTY but maybe that's unique
Hmm, is supporting CARGO_TERM_COLOR
, or one of the other semi-standard variables like CLICOLOR_FORCE
, out of the question? I'd prefer it be handled through environment variables rather than trying to do some sort of PTY thing.
You can also use --no-capture
which passes through stdout/stderr from the parent process. Note that stdin is always closed -- in the past there have been situations where tests have tried to read from stdin to their detriment.
Well, nothing is out of the question.
--no-capture
does produce colors which is good but it looks like this is the equivalent of --nocapture
which is not so great. A lot of crates write incredible amounts of data to stdout/stderr, and I would prefer to not persist all of that.
I'll look into what exactly CARGO_TERM_COLOR
does and reply later.
I think CARGO_TERM_COLOR
doesn't work with cargo-miri
because cargo-miri
isn't actually Cargo. Argh, maybe this is a good reason to straighten out that whole situation.
Thanks for looking into this, hah. I think cargo plugins should generally respect that env var (nextest does so)