Skip to content

Commit

Permalink
Build: Enable FORCE_COLOR=1 in CI
Browse files Browse the repository at this point in the history
This is something we lost in the transition from Travis, where procs
had a more consistently detectable TTY. There's a number of ways to
make this work by magic, but it actually makes sense for those to
not be TTYs as far as I'm concerned. Set it explicitly which is what
we're trying to do.
  • Loading branch information
Krinkle committed Mar 26, 2022
1 parent 527087c commit e12cefb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
runs-on: ${{ matrix.os }}
env:
PUPPETEER_DOWNLOAD_PATH: "${{ github.workspace }}/.puppeteer_download"
FORCE_COLOR: "1"
steps:
- uses: actions/checkout@v2

Expand Down
4 changes: 4 additions & 0 deletions test/cli/helpers/execute.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ function normalize( actual ) {
module.exports.execute = async function execute( command, options = {}, hook ) {
options.cwd = path.join( __dirname, "..", "fixtures" );

// Inherit no environment by default
// Without this, tests may fail from inheriting FORCE_COLOR=1
options.env = options.env || {};

// Avoid Windows-specific issue where otherwise 'foo/bar' is seen as a directory
// named "'foo/" (including the single quote).
options.windowsVerbatimArguments = true;
Expand Down
6 changes: 6 additions & 0 deletions test/integration/grunt-contrib-qunit.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ QUnit.test.each( "failing tests", {
try {
const ret = cp.execSync( "node_modules/.bin/grunt qunit:" + command, {
cwd: DIR,
env: {
CHROMIUM_FLAGS: process.env.CHROMIUM_FLAGS,
CI: process.env.CI,
PATH: process.env.PATH,
PUPPETEER_DOWNLOAD_PATH: process.env.PUPPETEER_DOWNLOAD_PATH
},
encoding: "utf8"
} );
assert.equal( ret, null );
Expand Down
2 changes: 1 addition & 1 deletion test/integration/nyc.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ All files | 85.71 | 100 | 50 | 85.71 |
--------------|---------|----------|---------|---------|-------------------
`.trim();

const actual = cp.execSync( "npm test", { cwd: DIR, encoding: "utf8" } );
const actual = cp.execSync( "npm test", { cwd: DIR, env: { PATH: process.env.PATH }, encoding: "utf8" } );
assert.pushResult( { result: actual.includes( expected ), actual, expected } );
} );

0 comments on commit e12cefb

Please sign in to comment.