From c7db2e19d2fe9780719a029e6747c3a6b0283c3a Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Thu, 9 Jan 2025 11:09:47 -0300 Subject: [PATCH 1/5] Silence foundation console logs --- yarn-project/foundation/src/log/log_history.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yarn-project/foundation/src/log/log_history.test.ts b/yarn-project/foundation/src/log/log_history.test.ts index 8049616d6c15..d0aff6a4b747 100644 --- a/yarn-project/foundation/src/log/log_history.test.ts +++ b/yarn-project/foundation/src/log/log_history.test.ts @@ -5,7 +5,8 @@ import { LogHistory } from './log_history.js'; jest.useFakeTimers({ doNotFake: ['performance'] }); -describe('log history', () => { +// We skip log history tests since this class is not used and it pollutes the logs in CI. +describe.skip('log history', () => { let debug: (msg: string) => void; let logHistory: LogHistory; const timestamp = new Date().toISOString(); From 8b9f2496eee9ffa5d7f464e221f581834de43e04 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Thu, 9 Jan 2025 11:10:30 -0300 Subject: [PATCH 2/5] Add jest root config with CI friendly reporters --- yarn-project/jest.root.config.js | 21 +++++++++++++++++++++ yarn-project/kv-store/package.json | 2 +- yarn-project/kv-store/package.local.json | 2 +- yarn-project/package.json | 2 +- 4 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 yarn-project/jest.root.config.js diff --git a/yarn-project/jest.root.config.js b/yarn-project/jest.root.config.js new file mode 100644 index 000000000000..a0df60a11f60 --- /dev/null +++ b/yarn-project/jest.root.config.js @@ -0,0 +1,21 @@ +const { cwd } = require('process'); +const { join } = require('path'); +const { readFileSync } = require('fs'); + +// Loads the jest config from the package.json in the working directory and overrides the reporters. +// Note we cannot just use the `--reporters` CLI option because it does not allow setting options, +// and we need the `summaryThreshold` option to show actual errors when tests fail. +// This file is only used from the yarn project root `test` script. +/** @type {import('jest').Config} */ +const config = { + ...JSON.parse(readFileSync(join(cwd(), 'package.json'), 'utf-8')).jest, + // CI-friendly reporters config + reporters: [ + ['github-actions', { silent: false }], + ['summary', { summaryThreshold: 0 }], + ], + // Override rootDir to the src of the current package + rootDir: join(cwd(), 'src'), +}; + +module.exports = config; diff --git a/yarn-project/kv-store/package.json b/yarn-project/kv-store/package.json index 6cdf31d3f0a2..ec96af1ae242 100644 --- a/yarn-project/kv-store/package.json +++ b/yarn-project/kv-store/package.json @@ -17,7 +17,7 @@ "formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src", "test:node": "NODE_NO_WARNINGS=1 mocha --config ./.mocharc.json --reporter dot", "test:browser": "wtr --config ./web-test-runner.config.mjs", - "test": "yarn test:node && yarn test:browser" + "test": "yarn test:node && yarn test:browser && true" }, "inherits": [ "../package.common.json", diff --git a/yarn-project/kv-store/package.local.json b/yarn-project/kv-store/package.local.json index d93348f53280..afcf95e38cc9 100644 --- a/yarn-project/kv-store/package.local.json +++ b/yarn-project/kv-store/package.local.json @@ -1,5 +1,5 @@ { "scripts": { - "test": "yarn test:node && yarn test:browser" + "test": "yarn test:node && yarn test:browser && true" } } diff --git a/yarn-project/package.json b/yarn-project/package.json index 68b32f53c60d..6028af4c8f1c 100644 --- a/yarn-project/package.json +++ b/yarn-project/package.json @@ -10,7 +10,7 @@ "formatting:fix": "FORCE_COLOR=true yarn workspaces foreach -A -p -v run formatting:fix", "lint": "yarn eslint --cache --ignore-pattern l1-artifacts .", "format": "yarn prettier --cache -w .", - "test": "RAYON_NUM_THREADS=4 FORCE_COLOR=true yarn workspaces foreach -A --exclude @aztec/aztec3-packages --exclude @aztec/bb-prover --exclude @aztec/prover-client -p -v run test --reporters=summary", + "test": "RAYON_NUM_THREADS=4 FORCE_COLOR=true yarn workspaces foreach -A --exclude @aztec/aztec3-packages --exclude @aztec/bb-prover --exclude @aztec/prover-client -p -v run test --config=../jest.root.config.js", "build": "FORCE_COLOR=true yarn workspaces foreach -A --parallel --topological-dev --verbose --exclude @aztec/aztec3-packages --exclude @aztec/docs run build", "build:fast": "cd foundation && yarn build && cd ../l1-artifacts && yarn build && cd ../circuits.js && yarn build && cd .. && yarn generate && tsc -b", "build:dev": "./watch.sh", From 313617c6ee335e9c00bb2e04cbadba12302e9d67 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Thu, 9 Jan 2025 11:11:26 -0300 Subject: [PATCH 3/5] Add error to see how it looks --- yarn-project/sequencer-client/src/config.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn-project/sequencer-client/src/config.test.ts b/yarn-project/sequencer-client/src/config.test.ts index f71c8c800cde..34c80e0c7875 100644 --- a/yarn-project/sequencer-client/src/config.test.ts +++ b/yarn-project/sequencer-client/src/config.test.ts @@ -2,8 +2,8 @@ import { AztecAddress, Fr, FunctionSelector } from '@aztec/circuits.js'; import { parseSequencerAllowList } from './config.js'; -describe('sequencer config', () => { - it('parse a sequencer config', () => { +describe.only('sequencer config', () => { + it.only('parse a sequencer config', () => { const instance = { address: AztecAddress.random() }; const instanceFunction = { address: AztecAddress.random(), selector: FunctionSelector.random() }; const classId = { classId: Fr.random() }; @@ -20,7 +20,7 @@ describe('sequencer config', () => { const stringifiedAllowList = configStrings.join(','); const allowList = parseSequencerAllowList(stringifiedAllowList); - + expect(false).toBeTruthy(); expect(allowList).toEqual(config); }); }); From eb34487963d7290a6d08aaa0515a130f766a3b81 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Thu, 9 Jan 2025 11:34:04 -0300 Subject: [PATCH 4/5] Lint --- yarn-project/sequencer-client/src/config.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn-project/sequencer-client/src/config.test.ts b/yarn-project/sequencer-client/src/config.test.ts index 34c80e0c7875..a69f2cff6642 100644 --- a/yarn-project/sequencer-client/src/config.test.ts +++ b/yarn-project/sequencer-client/src/config.test.ts @@ -2,8 +2,8 @@ import { AztecAddress, Fr, FunctionSelector } from '@aztec/circuits.js'; import { parseSequencerAllowList } from './config.js'; -describe.only('sequencer config', () => { - it.only('parse a sequencer config', () => { +describe('sequencer config', () => { + it('parse a sequencer config', () => { const instance = { address: AztecAddress.random() }; const instanceFunction = { address: AztecAddress.random(), selector: FunctionSelector.random() }; const classId = { classId: Fr.random() }; From 93bb817d08d911453121028a9b8d6aa647f3ac3b Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Thu, 9 Jan 2025 11:59:23 -0300 Subject: [PATCH 5/5] Remove test failure --- yarn-project/sequencer-client/src/config.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/yarn-project/sequencer-client/src/config.test.ts b/yarn-project/sequencer-client/src/config.test.ts index a69f2cff6642..56f0dc464a90 100644 --- a/yarn-project/sequencer-client/src/config.test.ts +++ b/yarn-project/sequencer-client/src/config.test.ts @@ -20,7 +20,6 @@ describe('sequencer config', () => { const stringifiedAllowList = configStrings.join(','); const allowList = parseSequencerAllowList(stringifiedAllowList); - expect(false).toBeTruthy(); expect(allowList).toEqual(config); }); });