Skip to content

Commit e1cd39c

Browse files
feat(dev): enable colors when running in nextest (#23819)
* feat(dev): enable colors when running in nextest * Fix and simplify colors * Remove CI check * Make test fail * Set CARGO_TERM_COLOR always in test.yml * Revert "Make test fail" This reverts commit bf6acf2.
1 parent a70eca4 commit e1cd39c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ env:
1515
DD_ENV: "ci"
1616
DD_API_KEY: ${{ secrets.DD_API_KEY }}
1717
RUST_BACKTRACE: full
18+
CARGO_TERM_COLOR: always
1819
VECTOR_LOG: vector=debug
1920
VERBOSE: true
2021
CI: true

src/test_util/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ pub fn trace_init() {
139139
let color = {
140140
use std::io::IsTerminal;
141141
std::io::stdout().is_terminal()
142+
|| std::env::var("NEXTEST")
143+
.ok()
144+
.and(Some(true))
145+
.unwrap_or(false)
142146
};
143147
// Windows: ANSI colors are not supported by cmd.exe
144148
// Color is false for everything except unix.

0 commit comments

Comments
 (0)