From 6741ee5b5069c8a9df136bd88b3d6e82a23dfe66 Mon Sep 17 00:00:00 2001 From: "Ali(Ako) Hosseini" Date: Tue, 27 Jun 2023 13:58:05 +0800 Subject: [PATCH] Ako/ fix coverage reporter (#9129) * build: update max-worker param * build: update max worker param * ci: remove max worker param * ci: add a separate script to run jest on github * build: add JEST_MAX_WORKERS as param and added a default value to it * ci: update codecov test runner command * Update package.json --------- Co-authored-by: balakrishna-deriv <56330681+balakrishna-deriv@users.noreply.github.com> --- .github/workflows/codecov.yml | 4 +++- package.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index bfad532d50de..bf94fb5cd355 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -3,6 +3,8 @@ on: pull_request: branches: - '**' + env: + JEST_MAX_WORKERS: 4 push: branches: - master @@ -21,7 +23,7 @@ jobs: npm install npm run bootstrap npm run build:all - npm run test:jest 4 + npm run test:jest - name: Upload coverage to Codecov uses: codecov/codecov-action@v3.1.1 diff --git a/package.json b/package.json index 260f7ae54e7e..57eaf99bbe17 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "start": "f () { lerna exec --scope=@deriv/${1:-'*'} -- npm run start ;}; f", "test": "f () { bash ./scripts/circleci-config.test.sh && npm run test:stylelint && npm run test:eslint-all && npm run test:jest ;}; f", "test:stylelint": "stylelint \"./packages/*/src/**/*.s(a|c)ss\"", - "test:jest": "jest --all --maxWorkers=${1:-8}", + "test:jest": "jest --all --maxWorkers=${JEST_MAX_WORKERS:-'45%'}", "test:e2e": "cd end-to-end-test && npx playwright test", "test:e2e-dev": "cd end-to-end-test && npx playwright test --trace on && npx playwright show-report", "test:performance": "cd e2e_tests && jest -c ./jest.config.js --maxWorkers=2 --detectOpenHandles performance",