From bfe57a36b811a288ab951032839af4c922100e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcelo=20Gon=C3=A7alves?= Date: Fri, 9 Jan 2026 16:50:27 +0000 Subject: [PATCH 1/8] WIP --- .github/workflows/ci.yml | 9 ++++++++- packages/server/api/project.json | 13 +++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 245749aa4..48ba2a0a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -121,12 +121,13 @@ jobs: include: server-api - name: Server API Integration Tests key: server-api-integration + target: test-integration include: server-api - name: Engine and Libraries key: others exclude: ui-*,*-ui,blocks-*,server-api name: Test ${{ matrix.test-suits.name }} - needs: install + needs: [install, build] runs-on: ubuntu-latest steps: - uses: actions/checkout@v6.0.1 @@ -137,6 +138,12 @@ jobs: path: node_modules key: node-modules-cache-${{ hashFiles('package-lock.json', '.npmrc') }} fail-on-cache-miss: true + - name: Restore build cache + uses: actions/cache/restore@v5.0.1 + with: + path: dist + key: dist-${{ github.sha }} + fail-on-cache-miss: true - name: Restore NX cache uses: actions/cache@v5.0.1 with: diff --git a/packages/server/api/project.json b/packages/server/api/project.json index 99d6f997c..27eaabb59 100644 --- a/packages/server/api/project.json +++ b/packages/server/api/project.json @@ -93,11 +93,10 @@ "testPathPattern": ["packages/server/api/test/integration/cloud"] } }, - "test": { + "test-integration": { "executor": "nx:run-commands", "options": { "commands": [ - "nx run-many -t build -p server*,blocks-*,openops*,shared", "./tools/link-packages.sh", "export $(cat packages/server/api/.env.tests | xargs) && OPS_EDITION=cloud nx test-cloud server-api --output-style stream-without-prefixes", "export $(cat packages/server/api/.env.tests | xargs) && OPS_EDITION=ce nx test-ce server-api --output-style stream-without-prefixes" @@ -105,6 +104,16 @@ "parallel": false } }, + "test": { + "executor": "nx:run-commands", + "options": { + "commands": [ + "nx run-many -t build -p server*,blocks-*,openops*,shared", + "nx test-integration server-api" + ], + "parallel": false + } + }, "test:docker": { "command": "UID=\"$(id -u)\" GID=\"$(id -g)\" docker compose --profile full -f docker-compose.test.yml up --exit-code-from app --attach app" }, From dd57c521b86a16fe60f3f2ee723a1e86640f196f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcelo=20Gon=C3=A7alves?= Date: Fri, 9 Jan 2026 17:06:45 +0000 Subject: [PATCH 2/8] WIP --- .github/workflows/ci.yml | 112 ++++++++++++++++--------------- packages/server/api/project.json | 3 +- 2 files changed, 60 insertions(+), 55 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48ba2a0a2..181009856 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,32 +102,63 @@ jobs: uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 with: commit_message: Update THIRD_PARTY_LICENSES.txt + build: + name: Build Project + needs: install + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6.0.1 + - name: Restore node_modules cache + id: node-modules-cache + uses: actions/cache/restore@v5.0.1 + with: + path: node_modules + key: node-modules-cache-${{ hashFiles('package-lock.json', '.npmrc') }} + fail-on-cache-miss: true + - name: Restore NX cache + uses: actions/cache@v5.0.1 + with: + path: .nx/cache + key: nx-build-${{ github.sha }} + restore-keys: nx-build- + - name: Build project + env: + NX_REJECT_UNKNOWN_LOCAL_CACHE: 0 + run: | + npm run prepare + npx nx run-many --target=build + ./tools/truncate-nx-cache.sh + - name: Save build cache + uses: actions/cache/save@v5.0.1 + with: + path: dist + key: dist-${{ github.sha }} test: strategy: - matrix: - test-suits: - - name: UI - include: ui-*,*-ui - - name: Blocks Shard 1 - include: blocks-a*,blocks-c*,blocks-d*, - - name: Blocks Shard 2 - include: blocks-f*,blocks-g*,blocks-m*, - - name: Blocks Shard 3 - include: blocks-* - exclude: blocks-a*,blocks-c*,blocks-d*,blocks-f*,blocks-g*,blocks-m*, - - name: Server API Unit Tests - key: server-api-unit - target: test-unit - include: server-api - - name: Server API Integration Tests - key: server-api-integration - target: test-integration - include: server-api - - name: Engine and Libraries - key: others - exclude: ui-*,*-ui,blocks-*,server-api + matrix: + test-suits: + - name: UI + include: ui-*,*-ui + - name: Blocks Shard 1 + include: blocks-a*,blocks-c*,blocks-d*, + - name: Blocks Shard 2 + include: blocks-f*,blocks-g*,blocks-m*, + - name: Blocks Shard 3 + include: blocks-* + exclude: blocks-a*,blocks-c*,blocks-d*,blocks-f*,blocks-g*,blocks-m*, + - name: Server API Unit Tests + key: server-api-unit + target: test-unit + include: server-api + - name: Server API Integration Tests + key: server-api-integration + target: test-integration + include: server-api + - name: Engine and Libraries + key: others + exclude: ui-*,*-ui,blocks-*,server-api name: Test ${{ matrix.test-suits.name }} - needs: [install, build] + needs: [ install, build ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v6.0.1 @@ -151,6 +182,10 @@ jobs: key: nx-test-${{ matrix.test-suits.key || matrix.test-suits.name }}-${{ github.sha }} restore-keys: nx-test-${{ matrix.test-suits.key || matrix.test-suits.name }}- save-always: true + - name: Link packages (integration only) + if: matrix.test-suits.key == 'server-api-integration' && + steps.nx-test-cache.outputs.cache-hit != 'true' + run: ./tools/link-packages.sh - name: Test if: steps.nx-test-cache.outputs.cache-hit != 'true' continue-on-error: false @@ -164,37 +199,6 @@ jobs: NX_REJECT_UNKNOWN_LOCAL_CACHE: 0 - name: Truncate NX cache run: ./tools/truncate-nx-cache.sh - build: - name: Build Project - needs: install - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6.0.1 - - name: Restore node_modules cache - id: node-modules-cache - uses: actions/cache/restore@v5.0.1 - with: - path: node_modules - key: node-modules-cache-${{ hashFiles('package-lock.json', '.npmrc') }} - fail-on-cache-miss: true - - name: Restore NX cache - uses: actions/cache@v5.0.1 - with: - path: .nx/cache - key: nx-build-${{ github.sha }} - restore-keys: nx-build- - - name: Build project - env: - NX_REJECT_UNKNOWN_LOCAL_CACHE: 0 - run: | - npm run prepare - npx nx run-many --target=build - ./tools/truncate-nx-cache.sh - - name: Save build cache - uses: actions/cache/save@v5.0.1 - with: - path: dist - key: dist-${{ github.sha }} build-images: strategy: matrix: diff --git a/packages/server/api/project.json b/packages/server/api/project.json index 27eaabb59..c147badf5 100644 --- a/packages/server/api/project.json +++ b/packages/server/api/project.json @@ -97,7 +97,6 @@ "executor": "nx:run-commands", "options": { "commands": [ - "./tools/link-packages.sh", "export $(cat packages/server/api/.env.tests | xargs) && OPS_EDITION=cloud nx test-cloud server-api --output-style stream-without-prefixes", "export $(cat packages/server/api/.env.tests | xargs) && OPS_EDITION=ce nx test-ce server-api --output-style stream-without-prefixes" ], @@ -109,6 +108,8 @@ "options": { "commands": [ "nx run-many -t build -p server*,blocks-*,openops*,shared", + "./tools/link-packages.sh", + "nx test-unit server-api", "nx test-integration server-api" ], "parallel": false From 69c2f4195036838f8e69aefe8c3b73623c02d458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcelo=20Gon=C3=A7alves?= Date: Fri, 9 Jan 2026 17:16:07 +0000 Subject: [PATCH 3/8] WIP --- .github/workflows/ci.yml | 4 ---- jest.setup.js | 8 ++++++++ packages/server/api/project.json | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 181009856..63a69424c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -182,10 +182,6 @@ jobs: key: nx-test-${{ matrix.test-suits.key || matrix.test-suits.name }}-${{ github.sha }} restore-keys: nx-test-${{ matrix.test-suits.key || matrix.test-suits.name }}- save-always: true - - name: Link packages (integration only) - if: matrix.test-suits.key == 'server-api-integration' && - steps.nx-test-cache.outputs.cache-hit != 'true' - run: ./tools/link-packages.sh - name: Test if: steps.nx-test-cache.outputs.cache-hit != 'true' continue-on-error: false diff --git a/jest.setup.js b/jest.setup.js index 41c52c691..2cb050f57 100644 --- a/jest.setup.js +++ b/jest.setup.js @@ -5,3 +5,11 @@ jest.mock('langfuse-vercel', () => ({ shutdown: jest.fn(), })), })); + +beforeAll(() => { + jest.spyOn(console, 'log').mockImplementation(() => {}); +}); + +afterAll(() => { + jest.restoreAllMocks(); +}); diff --git a/packages/server/api/project.json b/packages/server/api/project.json index c147badf5..dcf3a7768 100644 --- a/packages/server/api/project.json +++ b/packages/server/api/project.json @@ -97,6 +97,7 @@ "executor": "nx:run-commands", "options": { "commands": [ + "./tools/link-packages.sh", "export $(cat packages/server/api/.env.tests | xargs) && OPS_EDITION=cloud nx test-cloud server-api --output-style stream-without-prefixes", "export $(cat packages/server/api/.env.tests | xargs) && OPS_EDITION=ce nx test-ce server-api --output-style stream-without-prefixes" ], @@ -108,7 +109,6 @@ "options": { "commands": [ "nx run-many -t build -p server*,blocks-*,openops*,shared", - "./tools/link-packages.sh", "nx test-unit server-api", "nx test-integration server-api" ], From 6856c08185d2e58c7d6b054a2b07176eb9079653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcelo=20Gon=C3=A7alves?= Date: Fri, 9 Jan 2026 17:23:11 +0000 Subject: [PATCH 4/8] WIP --- jest.setup.js | 4 +--- .../test/compute-optimizer-client.test.ts | 2 +- packages/blocks/cloudhealth/test/graphql-action.test.ts | 2 +- .../slack/test/get-slack-Id-from-property-input.test.ts | 2 +- packages/blocks/slack/test/props.test.ts | 2 +- packages/blocks/slack/test/wait-for-action.test.ts | 2 +- packages/blocks/slack/test/wait-for-interaction.test.ts | 2 +- .../cloud/slack-integration/slack-interaction.test.ts | 2 +- .../server/shared/test/request-oversize-body-handler.test.ts | 2 +- 9 files changed, 9 insertions(+), 11 deletions(-) diff --git a/jest.setup.js b/jest.setup.js index 2cb050f57..f447c5e1a 100644 --- a/jest.setup.js +++ b/jest.setup.js @@ -6,9 +6,7 @@ jest.mock('langfuse-vercel', () => ({ })), })); -beforeAll(() => { - jest.spyOn(console, 'log').mockImplementation(() => {}); -}); +jest.spyOn(console, 'log').mockImplementation(() => {}); afterAll(() => { jest.restoreAllMocks(); diff --git a/packages/blocks/aws-compute-optimizer/test/compute-optimizer-client.test.ts b/packages/blocks/aws-compute-optimizer/test/compute-optimizer-client.test.ts index 6fe577d2c..aee295e73 100644 --- a/packages/blocks/aws-compute-optimizer/test/compute-optimizer-client.test.ts +++ b/packages/blocks/aws-compute-optimizer/test/compute-optimizer-client.test.ts @@ -21,7 +21,7 @@ import { getRecommendationSummaries } from '../src/lib/common/compute-optimizer- describe('Get recommendations summary', () => { beforeEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); test('should return recommendations summary', async () => { diff --git a/packages/blocks/cloudhealth/test/graphql-action.test.ts b/packages/blocks/cloudhealth/test/graphql-action.test.ts index 91bda0679..32977934a 100644 --- a/packages/blocks/cloudhealth/test/graphql-action.test.ts +++ b/packages/blocks/cloudhealth/test/graphql-action.test.ts @@ -20,7 +20,7 @@ describe('GraphQL Action', () => { }); afterEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); it('should successfully execute a GraphQL query', async () => { diff --git a/packages/blocks/slack/test/get-slack-Id-from-property-input.test.ts b/packages/blocks/slack/test/get-slack-Id-from-property-input.test.ts index 6e36d875d..2ebfed01a 100644 --- a/packages/blocks/slack/test/get-slack-Id-from-property-input.test.ts +++ b/packages/blocks/slack/test/get-slack-Id-from-property-input.test.ts @@ -7,7 +7,7 @@ import { getSlackIdFromPropertyInput } from '../src/lib/common/get-slack-users'; describe('getSlackIdFromPropertyInput', () => { afterEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); const accessToken = 'mockAccessToken'; diff --git a/packages/blocks/slack/test/props.test.ts b/packages/blocks/slack/test/props.test.ts index cb46e2b94..7598a8710 100644 --- a/packages/blocks/slack/test/props.test.ts +++ b/packages/blocks/slack/test/props.test.ts @@ -16,7 +16,7 @@ describe('Props Common', () => { }; beforeEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); describe('channel dropdown', () => { diff --git a/packages/blocks/slack/test/wait-for-action.test.ts b/packages/blocks/slack/test/wait-for-action.test.ts index 4b5fd4247..5ffcf3553 100644 --- a/packages/blocks/slack/test/wait-for-action.test.ts +++ b/packages/blocks/slack/test/wait-for-action.test.ts @@ -12,7 +12,7 @@ import { MessageInfo } from '../src/lib/common/message-result'; describe('waitForAction', () => { beforeEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); test('should create action with correct properties', () => { diff --git a/packages/blocks/slack/test/wait-for-interaction.test.ts b/packages/blocks/slack/test/wait-for-interaction.test.ts index 4911c73c4..2a8c8f657 100644 --- a/packages/blocks/slack/test/wait-for-interaction.test.ts +++ b/packages/blocks/slack/test/wait-for-interaction.test.ts @@ -14,7 +14,7 @@ import { describe('wait-for-interaction', () => { beforeEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); slackUpdateMessageMock.mockResolvedValue('updated message'); }); diff --git a/packages/server/api/test/integration/cloud/slack-integration/slack-interaction.test.ts b/packages/server/api/test/integration/cloud/slack-integration/slack-interaction.test.ts index 80a41d39c..e8dd23ec8 100644 --- a/packages/server/api/test/integration/cloud/slack-integration/slack-interaction.test.ts +++ b/packages/server/api/test/integration/cloud/slack-integration/slack-interaction.test.ts @@ -58,7 +58,7 @@ afterAll(async () => { describe('Slack API', () => { beforeEach(async () => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); describe('POST', () => { diff --git a/packages/server/shared/test/request-oversize-body-handler.test.ts b/packages/server/shared/test/request-oversize-body-handler.test.ts index 94c543e38..e5dee22ec 100644 --- a/packages/server/shared/test/request-oversize-body-handler.test.ts +++ b/packages/server/shared/test/request-oversize-body-handler.test.ts @@ -38,7 +38,7 @@ import { logger } from '../src/lib/logger'; describe('request-oversize-body-handler', () => { beforeEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); describe('saveRequestBody', () => { From a7ee0363c881461ff8cc5761fc76363c5ce72f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcelo=20Gon=C3=A7alves?= Date: Fri, 9 Jan 2026 17:44:08 +0000 Subject: [PATCH 5/8] WIP --- packages/server/api/jest.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/server/api/jest.config.ts b/packages/server/api/jest.config.ts index 42d13548b..da7c12f4c 100644 --- a/packages/server/api/jest.config.ts +++ b/packages/server/api/jest.config.ts @@ -2,6 +2,7 @@ export default { displayName: 'server-api', preset: '../../../jest.preset.js', setupFiles: ['../../../jest.env.js'], + setupFilesAfterEnv: ['../../../jest.setup.js'], globals: {}, testEnvironment: 'node', transform: { From 12ec6fe24534de110ebb6df677919289671b29b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcelo=20Gon=C3=A7alves?= Date: Fri, 9 Jan 2026 17:49:36 +0000 Subject: [PATCH 6/8] WIP --- .github/workflows/ci.yml | 113 ++++++++---------- jest.setup.js | 6 - .../test/compute-optimizer-client.test.ts | 2 +- .../cloudhealth/test/graphql-action.test.ts | 2 +- .../get-slack-Id-from-property-input.test.ts | 2 +- packages/blocks/slack/test/props.test.ts | 2 +- 6 files changed, 57 insertions(+), 70 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63a69424c..245749aa4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,63 +102,31 @@ jobs: uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 with: commit_message: Update THIRD_PARTY_LICENSES.txt - build: - name: Build Project - needs: install - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6.0.1 - - name: Restore node_modules cache - id: node-modules-cache - uses: actions/cache/restore@v5.0.1 - with: - path: node_modules - key: node-modules-cache-${{ hashFiles('package-lock.json', '.npmrc') }} - fail-on-cache-miss: true - - name: Restore NX cache - uses: actions/cache@v5.0.1 - with: - path: .nx/cache - key: nx-build-${{ github.sha }} - restore-keys: nx-build- - - name: Build project - env: - NX_REJECT_UNKNOWN_LOCAL_CACHE: 0 - run: | - npm run prepare - npx nx run-many --target=build - ./tools/truncate-nx-cache.sh - - name: Save build cache - uses: actions/cache/save@v5.0.1 - with: - path: dist - key: dist-${{ github.sha }} test: strategy: - matrix: - test-suits: - - name: UI - include: ui-*,*-ui - - name: Blocks Shard 1 - include: blocks-a*,blocks-c*,blocks-d*, - - name: Blocks Shard 2 - include: blocks-f*,blocks-g*,blocks-m*, - - name: Blocks Shard 3 - include: blocks-* - exclude: blocks-a*,blocks-c*,blocks-d*,blocks-f*,blocks-g*,blocks-m*, - - name: Server API Unit Tests - key: server-api-unit - target: test-unit - include: server-api - - name: Server API Integration Tests - key: server-api-integration - target: test-integration - include: server-api - - name: Engine and Libraries - key: others - exclude: ui-*,*-ui,blocks-*,server-api + matrix: + test-suits: + - name: UI + include: ui-*,*-ui + - name: Blocks Shard 1 + include: blocks-a*,blocks-c*,blocks-d*, + - name: Blocks Shard 2 + include: blocks-f*,blocks-g*,blocks-m*, + - name: Blocks Shard 3 + include: blocks-* + exclude: blocks-a*,blocks-c*,blocks-d*,blocks-f*,blocks-g*,blocks-m*, + - name: Server API Unit Tests + key: server-api-unit + target: test-unit + include: server-api + - name: Server API Integration Tests + key: server-api-integration + include: server-api + - name: Engine and Libraries + key: others + exclude: ui-*,*-ui,blocks-*,server-api name: Test ${{ matrix.test-suits.name }} - needs: [ install, build ] + needs: install runs-on: ubuntu-latest steps: - uses: actions/checkout@v6.0.1 @@ -169,12 +137,6 @@ jobs: path: node_modules key: node-modules-cache-${{ hashFiles('package-lock.json', '.npmrc') }} fail-on-cache-miss: true - - name: Restore build cache - uses: actions/cache/restore@v5.0.1 - with: - path: dist - key: dist-${{ github.sha }} - fail-on-cache-miss: true - name: Restore NX cache uses: actions/cache@v5.0.1 with: @@ -195,6 +157,37 @@ jobs: NX_REJECT_UNKNOWN_LOCAL_CACHE: 0 - name: Truncate NX cache run: ./tools/truncate-nx-cache.sh + build: + name: Build Project + needs: install + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6.0.1 + - name: Restore node_modules cache + id: node-modules-cache + uses: actions/cache/restore@v5.0.1 + with: + path: node_modules + key: node-modules-cache-${{ hashFiles('package-lock.json', '.npmrc') }} + fail-on-cache-miss: true + - name: Restore NX cache + uses: actions/cache@v5.0.1 + with: + path: .nx/cache + key: nx-build-${{ github.sha }} + restore-keys: nx-build- + - name: Build project + env: + NX_REJECT_UNKNOWN_LOCAL_CACHE: 0 + run: | + npm run prepare + npx nx run-many --target=build + ./tools/truncate-nx-cache.sh + - name: Save build cache + uses: actions/cache/save@v5.0.1 + with: + path: dist + key: dist-${{ github.sha }} build-images: strategy: matrix: diff --git a/jest.setup.js b/jest.setup.js index f447c5e1a..41c52c691 100644 --- a/jest.setup.js +++ b/jest.setup.js @@ -5,9 +5,3 @@ jest.mock('langfuse-vercel', () => ({ shutdown: jest.fn(), })), })); - -jest.spyOn(console, 'log').mockImplementation(() => {}); - -afterAll(() => { - jest.restoreAllMocks(); -}); diff --git a/packages/blocks/aws-compute-optimizer/test/compute-optimizer-client.test.ts b/packages/blocks/aws-compute-optimizer/test/compute-optimizer-client.test.ts index aee295e73..6fe577d2c 100644 --- a/packages/blocks/aws-compute-optimizer/test/compute-optimizer-client.test.ts +++ b/packages/blocks/aws-compute-optimizer/test/compute-optimizer-client.test.ts @@ -21,7 +21,7 @@ import { getRecommendationSummaries } from '../src/lib/common/compute-optimizer- describe('Get recommendations summary', () => { beforeEach(() => { - jest.clearAllMocks(); + jest.resetAllMocks(); }); test('should return recommendations summary', async () => { diff --git a/packages/blocks/cloudhealth/test/graphql-action.test.ts b/packages/blocks/cloudhealth/test/graphql-action.test.ts index 32977934a..91bda0679 100644 --- a/packages/blocks/cloudhealth/test/graphql-action.test.ts +++ b/packages/blocks/cloudhealth/test/graphql-action.test.ts @@ -20,7 +20,7 @@ describe('GraphQL Action', () => { }); afterEach(() => { - jest.clearAllMocks(); + jest.resetAllMocks(); }); it('should successfully execute a GraphQL query', async () => { diff --git a/packages/blocks/slack/test/get-slack-Id-from-property-input.test.ts b/packages/blocks/slack/test/get-slack-Id-from-property-input.test.ts index 2ebfed01a..6e36d875d 100644 --- a/packages/blocks/slack/test/get-slack-Id-from-property-input.test.ts +++ b/packages/blocks/slack/test/get-slack-Id-from-property-input.test.ts @@ -7,7 +7,7 @@ import { getSlackIdFromPropertyInput } from '../src/lib/common/get-slack-users'; describe('getSlackIdFromPropertyInput', () => { afterEach(() => { - jest.clearAllMocks(); + jest.resetAllMocks(); }); const accessToken = 'mockAccessToken'; diff --git a/packages/blocks/slack/test/props.test.ts b/packages/blocks/slack/test/props.test.ts index 7598a8710..cb46e2b94 100644 --- a/packages/blocks/slack/test/props.test.ts +++ b/packages/blocks/slack/test/props.test.ts @@ -16,7 +16,7 @@ describe('Props Common', () => { }; beforeEach(() => { - jest.clearAllMocks(); + jest.resetAllMocks(); }); describe('channel dropdown', () => { From dfaa470cf32f503443e917c6676526ea08936dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcelo=20Gon=C3=A7alves?= Date: Fri, 9 Jan 2026 17:50:25 +0000 Subject: [PATCH 7/8] WIP --- packages/blocks/slack/test/wait-for-action.test.ts | 2 +- packages/blocks/slack/test/wait-for-interaction.test.ts | 2 +- packages/server/api/jest.config.ts | 1 - .../cloud/slack-integration/slack-interaction.test.ts | 2 +- .../server/shared/test/request-oversize-body-handler.test.ts | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/blocks/slack/test/wait-for-action.test.ts b/packages/blocks/slack/test/wait-for-action.test.ts index 5ffcf3553..4b5fd4247 100644 --- a/packages/blocks/slack/test/wait-for-action.test.ts +++ b/packages/blocks/slack/test/wait-for-action.test.ts @@ -12,7 +12,7 @@ import { MessageInfo } from '../src/lib/common/message-result'; describe('waitForAction', () => { beforeEach(() => { - jest.clearAllMocks(); + jest.resetAllMocks(); }); test('should create action with correct properties', () => { diff --git a/packages/blocks/slack/test/wait-for-interaction.test.ts b/packages/blocks/slack/test/wait-for-interaction.test.ts index 2a8c8f657..4911c73c4 100644 --- a/packages/blocks/slack/test/wait-for-interaction.test.ts +++ b/packages/blocks/slack/test/wait-for-interaction.test.ts @@ -14,7 +14,7 @@ import { describe('wait-for-interaction', () => { beforeEach(() => { - jest.clearAllMocks(); + jest.resetAllMocks(); slackUpdateMessageMock.mockResolvedValue('updated message'); }); diff --git a/packages/server/api/jest.config.ts b/packages/server/api/jest.config.ts index da7c12f4c..42d13548b 100644 --- a/packages/server/api/jest.config.ts +++ b/packages/server/api/jest.config.ts @@ -2,7 +2,6 @@ export default { displayName: 'server-api', preset: '../../../jest.preset.js', setupFiles: ['../../../jest.env.js'], - setupFilesAfterEnv: ['../../../jest.setup.js'], globals: {}, testEnvironment: 'node', transform: { diff --git a/packages/server/api/test/integration/cloud/slack-integration/slack-interaction.test.ts b/packages/server/api/test/integration/cloud/slack-integration/slack-interaction.test.ts index e8dd23ec8..80a41d39c 100644 --- a/packages/server/api/test/integration/cloud/slack-integration/slack-interaction.test.ts +++ b/packages/server/api/test/integration/cloud/slack-integration/slack-interaction.test.ts @@ -58,7 +58,7 @@ afterAll(async () => { describe('Slack API', () => { beforeEach(async () => { - jest.clearAllMocks(); + jest.resetAllMocks(); }); describe('POST', () => { diff --git a/packages/server/shared/test/request-oversize-body-handler.test.ts b/packages/server/shared/test/request-oversize-body-handler.test.ts index e5dee22ec..94c543e38 100644 --- a/packages/server/shared/test/request-oversize-body-handler.test.ts +++ b/packages/server/shared/test/request-oversize-body-handler.test.ts @@ -38,7 +38,7 @@ import { logger } from '../src/lib/logger'; describe('request-oversize-body-handler', () => { beforeEach(() => { - jest.clearAllMocks(); + jest.resetAllMocks(); }); describe('saveRequestBody', () => { From 498e27fa6c400275bcdd6a555604016dd41ac8c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcelo=20Gon=C3=A7alves?= Date: Fri, 9 Jan 2026 17:51:34 +0000 Subject: [PATCH 8/8] WIP --- .github/workflows/ci.yml | 113 +++++++++++++++++++++------------------ 1 file changed, 60 insertions(+), 53 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 245749aa4..63a69424c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,30 +102,8 @@ jobs: uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 with: commit_message: Update THIRD_PARTY_LICENSES.txt - test: - strategy: - matrix: - test-suits: - - name: UI - include: ui-*,*-ui - - name: Blocks Shard 1 - include: blocks-a*,blocks-c*,blocks-d*, - - name: Blocks Shard 2 - include: blocks-f*,blocks-g*,blocks-m*, - - name: Blocks Shard 3 - include: blocks-* - exclude: blocks-a*,blocks-c*,blocks-d*,blocks-f*,blocks-g*,blocks-m*, - - name: Server API Unit Tests - key: server-api-unit - target: test-unit - include: server-api - - name: Server API Integration Tests - key: server-api-integration - include: server-api - - name: Engine and Libraries - key: others - exclude: ui-*,*-ui,blocks-*,server-api - name: Test ${{ matrix.test-suits.name }} + build: + name: Build Project needs: install runs-on: ubuntu-latest steps: @@ -141,25 +119,46 @@ jobs: uses: actions/cache@v5.0.1 with: path: .nx/cache - key: nx-test-${{ matrix.test-suits.key || matrix.test-suits.name }}-${{ github.sha }} - restore-keys: nx-test-${{ matrix.test-suits.key || matrix.test-suits.name }}- - save-always: true - - name: Test - if: steps.nx-test-cache.outputs.cache-hit != 'true' - continue-on-error: false - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 - with: - timeout_minutes: 10 - max_attempts: 3 - retry_on: error - command: npx nx run-many --target ${{ matrix.test-suits.target || 'test' }} --projects "${{ matrix.test-suits.include }}" --exclude "${{ matrix.test-suits.exclude }}" --quiet + key: nx-build-${{ github.sha }} + restore-keys: nx-build- + - name: Build project env: NX_REJECT_UNKNOWN_LOCAL_CACHE: 0 - - name: Truncate NX cache - run: ./tools/truncate-nx-cache.sh - build: - name: Build Project - needs: install + run: | + npm run prepare + npx nx run-many --target=build + ./tools/truncate-nx-cache.sh + - name: Save build cache + uses: actions/cache/save@v5.0.1 + with: + path: dist + key: dist-${{ github.sha }} + test: + strategy: + matrix: + test-suits: + - name: UI + include: ui-*,*-ui + - name: Blocks Shard 1 + include: blocks-a*,blocks-c*,blocks-d*, + - name: Blocks Shard 2 + include: blocks-f*,blocks-g*,blocks-m*, + - name: Blocks Shard 3 + include: blocks-* + exclude: blocks-a*,blocks-c*,blocks-d*,blocks-f*,blocks-g*,blocks-m*, + - name: Server API Unit Tests + key: server-api-unit + target: test-unit + include: server-api + - name: Server API Integration Tests + key: server-api-integration + target: test-integration + include: server-api + - name: Engine and Libraries + key: others + exclude: ui-*,*-ui,blocks-*,server-api + name: Test ${{ matrix.test-suits.name }} + needs: [ install, build ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v6.0.1 @@ -170,24 +169,32 @@ jobs: path: node_modules key: node-modules-cache-${{ hashFiles('package-lock.json', '.npmrc') }} fail-on-cache-miss: true + - name: Restore build cache + uses: actions/cache/restore@v5.0.1 + with: + path: dist + key: dist-${{ github.sha }} + fail-on-cache-miss: true - name: Restore NX cache uses: actions/cache@v5.0.1 with: path: .nx/cache - key: nx-build-${{ github.sha }} - restore-keys: nx-build- - - name: Build project + key: nx-test-${{ matrix.test-suits.key || matrix.test-suits.name }}-${{ github.sha }} + restore-keys: nx-test-${{ matrix.test-suits.key || matrix.test-suits.name }}- + save-always: true + - name: Test + if: steps.nx-test-cache.outputs.cache-hit != 'true' + continue-on-error: false + uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 + with: + timeout_minutes: 10 + max_attempts: 3 + retry_on: error + 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 - run: | - npm run prepare - npx nx run-many --target=build - ./tools/truncate-nx-cache.sh - - name: Save build cache - uses: actions/cache/save@v5.0.1 - with: - path: dist - key: dist-${{ github.sha }} + - name: Truncate NX cache + run: ./tools/truncate-nx-cache.sh build-images: strategy: matrix: