-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
priority: highHigh Priority (important issues which affect many people severely)High Priority (important issues which affect many people severely)scope: corecore nx functionalitycore nx functionality
Description
Current Behavior
When running nx test in CI, output still contains ANSI escape sequences even when FORCE_COLOR=0 is set.
This breaks tools/tests that parse plain output. Example from Homebrew formula test:
FORCE_COLOR=0 nx testExpected plain text line:
Successfully ran target test for project @acme/repo
Actual output still includes ANSI escapes around tokens like test and the NX banner.
Expected Behavior
With FORCE_COLOR=0, nx test should not emit ANSI color/style escape sequences.
Steps to Reproduce
- Create a minimal package with script:
{
"name": "@acme/repo",
"version": "0.0.1",
"scripts": {
"test": "echo 'Tests passed'"
}
}- Initialize Nx:
nx init --no-interactive- Run with forced no-color:
FORCE_COLOR=0 nx test- Observe ANSI sequences in output in CI/non-interactive environments.
Nx Report
Observed on nx 22.5.0 in Linux CI.
Additional Context
CI run showing failure due ANSI output in parser assertion:
https://github.com/Homebrew/homebrew-core/actions/runs/21845716504/job/63041266086?pr=266654
Raw snippet from CI output:
\e[7m\e[1m\e[32m NX \e[39m\e[22m\e[27m \e[32mSuccessfully ran target \e[1mtest\e[22m for project @acme/repo\e[39m
Potentially related older issues (not exact): #8051, #22731.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority: highHigh Priority (important issues which affect many people severely)High Priority (important issues which affect many people severely)scope: corecore nx functionalitycore nx functionality