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

bacon test doesn't color tests #124

Closed
svenstaro opened this issue Mar 25, 2023 · 4 comments
Closed

bacon test doesn't color tests #124

svenstaro opened this issue Mar 25, 2023 · 4 comments

Comments

@svenstaro
Copy link

Hey, cool project! This is kind of a minor issue but I still think it'd be nice to have tests be able to output in color. However, bacon test doesn't use color unless forced to with bacon test -- -- --color always which is kind of inconvenient.

There is this related issue: rust-lang/cargo#1983

@Canop
Copy link
Owner

Canop commented Mar 25, 2023

Can you build a test case exhibiting the lack of color ?

@svenstaro
Copy link
Author

Result of bacon test on a random Rust project with tests:

image

Running it with bacon test -- -- --color always:
image

@Canop
Copy link
Owner

Canop commented Mar 25, 2023

Ok, I see.

So this could be fixed with this definition of the test job (wich I could make default):

[jobs.test]
command = ["cargo", "test", "--color", "always", "--", "--color", "always"]
need_stdout = true

This would hopefully become useless if rust-lang/cargo#1983 is revived.

Any better suggestion ?

@svenstaro
Copy link
Author

I think that'd work. Since bacon is only ever meant to run interactively, I don't see any issues here.

@Canop Canop closed this as completed in 2f6ad15 Mar 25, 2023
Canop added a commit that referenced this issue Jun 17, 2023
Due to #124 especially, we're more likely to receive test
failure abstracts on stdout and not just stderr

Fix #317
Canop added a commit that referenced this issue Jun 19, 2023
Due to #124 especially, we're more likely to receive test
failure abstracts on stdout and not just stderr

Fix #317
joshka added a commit to joshka/bacon that referenced this issue Nov 16, 2024
Adds a new root level config item env, which allows setting environment
vars for all jobs. This makes it possible then to set CARGO_TERM_COLOR
to always, which fixes the problem with --color=always not working.

Fixes: Canop#261 and Canop#124
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants