From 7d9966627f09d97766110ed9f6fa3bd5256391a2 Mon Sep 17 00:00:00 2001 From: Ken Lee Shu Ming Date: Thu, 5 Oct 2023 18:35:04 +0800 Subject: [PATCH] chore(ci): backend jest config (#6772) * fix: add ci mode, ci mode runs test in band to avoid context switch * fix: ci crashing due to oom * fix: increase ci worker count * Revert "fix: ci crashing due to oom" This reverts commit dff5171115389ab28265b065fe671d6450acc1f3. * feat: set workeridlememorylimit to 0.4 * feat: set workeridlememorylimit to 0.2 --- .github/workflows/ci.yml | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d532ffdfa3..29c364377c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -154,7 +154,7 @@ jobs: path: '**/node_modules' key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/package-lock.json') }} - run: npm ci --prefix serverless/virus-scanner - - run: npm run test:backend + - run: npm run test:backend:ci env: NODE_OPTIONS: '--max-old-space-size=4096' - name: Coveralls diff --git a/package.json b/package.json index ffb09f4200..0f894ebcb0 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "postinstall": "npm run postinstall:frontend && npm run postinstall:shared", "test": "npm run test:backend && npm run test:frontend", "test:backend": "env-cmd -f __tests__/setup/.test-env jest", + "test:backend:ci": "env-cmd -f __tests__/setup/.test-env jest --maxWorkers=2 --logHeapUsage --workerIdleMemoryLimit=0.2", "test:backend:watch": "env-cmd -f __tests__/setup/.test-env jest --watch", "test:frontend": "npm --prefix frontend test", "test:e2e-v2": "npm run build && npx playwright test",