From cabe1bd557cf66fe21f8d7ddabb48abcd7396946 Mon Sep 17 00:00:00 2001 From: Maor Rozenfeld <49363375+maor-rozenfeld@users.noreply.github.com> Date: Fri, 16 Jan 2026 12:54:00 +0100 Subject: [PATCH] Reduce test log noise and optimize performance in CI --- .github/workflows/ci.yml | 1 + jest.preset.js | 8 ++++++++ jest.setup.js | 12 ++++++++++++ 3 files changed, 21 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 245749aa48..6273f10e7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -155,6 +155,7 @@ jobs: command: npx nx run-many --target ${{ matrix.test-suits.target || 'test' }} --projects "${{ matrix.test-suits.include }}" --exclude "${{ matrix.test-suits.exclude }}" --quiet env: NX_REJECT_UNKNOWN_LOCAL_CACHE: 0 + CI: true - name: Truncate NX cache run: ./tools/truncate-nx-cache.sh build: diff --git a/jest.preset.js b/jest.preset.js index 0116eb24eb..a37b7e76f8 100644 --- a/jest.preset.js +++ b/jest.preset.js @@ -14,4 +14,12 @@ module.exports = { snapshotFormat: { escapeString: true, printBasicPrototype: true }, transformIgnorePatterns: ['node_modules/(?!(lodash-es)/)'], setupFilesAfterEnv: [__dirname + '/jest.setup.js'], + // Reduce log noise in CI + silent: process.env.CI === 'true', + // Optimize test execution + maxWorkers: process.env.CI === 'true' ? '50%' : '75%', + // Use minimal reporter in CI for cleaner logs + reporters: process.env.CI === 'true' + ? [['default', { summaryThreshold: 0 }]] + : ['default'], }; diff --git a/jest.setup.js b/jest.setup.js index 41c52c6913..f8889227f7 100644 --- a/jest.setup.js +++ b/jest.setup.js @@ -5,3 +5,15 @@ jest.mock('langfuse-vercel', () => ({ shutdown: jest.fn(), })), })); + +// Suppress console output in CI to reduce log noise +if (process.env.CI === 'true') { + global.console = { + ...console, + log: jest.fn(), + debug: jest.fn(), + info: jest.fn(), + warn: jest.fn(), + error: jest.fn(), + }; +}