diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 245749aa4..6273f10e7 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 0116eb24e..a37b7e76f 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 41c52c691..f8889227f 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(), + }; +}