Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo test color ignores both environment var and commandline arg #8470

Closed
TheButlah opened this issue Jul 8, 2020 · 2 comments
Closed

cargo test color ignores both environment var and commandline arg #8470

TheButlah opened this issue Jul 8, 2020 · 2 comments
Labels
C-bug Category: bug

Comments

@TheButlah
Copy link
Contributor

TheButlah commented Jul 8, 2020

Problem
cargo test appears to be ignoring both CARGO_TERM_COLOR and the --color option and always autodetecting color support. This means that if you want to force color on or off, it doesn't respect either the env var or the flag.

Steps

  1. cargo test --color never produces color in a terminal (bug)
  2. CARGO_TERM_COLOR=never cargo test produces color in a terminal (bug)
  3. Same occurrs with the inverse - try the commands in CI (like gitlab) and try forcing on color - it doesn't work.

Notes

Output of cargo version:
cargo 1.46.0-nightly (c26576f9a 2020-06-23)

Note that this doesn't seem to apply to check, build, or doc - they all appear to work as intended. Note also that in the below screenshot (run with --color always in an environment that cargo detects as without color by default), the doc/build steps in cargo test have colored output, but the test status does not

image

@TheButlah TheButlah added the C-bug Category: bug label Jul 8, 2020
@ehuss
Copy link
Contributor

ehuss commented Jul 8, 2020

If this is in reference to the color of the tests themselves, then I think this is issue #1983. Libtest has its own set of flags that need to be passed separately.

@ehuss
Copy link
Contributor

ehuss commented Jul 29, 2020

Closing as I believe this is essentially #1983.

@ehuss ehuss closed this as completed Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants