From 35b31d0cdd1f18e3c6c34122dcc8f48ae1fe551a Mon Sep 17 00:00:00 2001 From: yyh <92089059+lyzno1@users.noreply.github.com> Date: Fri, 27 Feb 2026 21:33:12 +0800 Subject: [PATCH] ci(web): parallelize web tests with 4-shard Vitest sharding (#32713) --- .github/workflows/web-tests.yml | 63 ++++++++++++++++++- .../header/account-setting/index.tsx | 16 ++--- 2 files changed, 69 insertions(+), 10 deletions(-) diff --git a/.github/workflows/web-tests.yml b/.github/workflows/web-tests.yml index 78d0b2af40..f50689636b 100644 --- a/.github/workflows/web-tests.yml +++ b/.github/workflows/web-tests.yml @@ -3,14 +3,22 @@ name: Web Tests on: workflow_call: +permissions: + contents: read + concurrency: group: web-tests-${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: test: - name: Web Tests + name: Web Tests (${{ matrix.shardIndex }}/${{ matrix.shardTotal }}) runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + shardIndex: [1, 2, 3, 4] + shardTotal: [4] defaults: run: shell: bash @@ -39,7 +47,58 @@ jobs: run: pnpm install --frozen-lockfile - name: Run tests - run: pnpm test:ci + run: pnpm vitest run --reporter=blob --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --coverage + + - name: Upload blob report + if: ${{ !cancelled() }} + uses: actions/upload-artifact@v6 + with: + name: blob-report-${{ matrix.shardIndex }} + path: web/.vitest-reports/* + include-hidden-files: true + retention-days: 1 + + merge-reports: + name: Merge Test Reports + if: ${{ !cancelled() }} + needs: [test] + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: ./web + + steps: + - name: Checkout code + uses: actions/checkout@v6 + with: + persist-credentials: false + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + package_json_file: web/package.json + run_install: false + + - name: Setup Node.js + uses: actions/setup-node@v6 + with: + node-version: 24 + cache: pnpm + cache-dependency-path: ./web/pnpm-lock.yaml + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Download blob reports + uses: actions/download-artifact@v6 + with: + path: web/.vitest-reports + pattern: blob-report-* + merge-multiple: true + + - name: Merge reports + run: pnpm vitest --merge-reports --coverage --silent=passed-only - name: Coverage Summary if: always() diff --git a/web/app/components/header/account-setting/index.tsx b/web/app/components/header/account-setting/index.tsx index 65ac396529..45d8dde8a6 100644 --- a/web/app/components/header/account-setting/index.tsx +++ b/web/app/components/header/account-setting/index.tsx @@ -209,7 +209,7 @@ export default function AccountSetting({
{activeItem?.description}
)} - {activeItem?.key === 'provider' && ( + {activeItem?.key === ACCOUNT_SETTING_TAB.PROVIDER && (
- {activeMenu === 'provider' && } - {activeMenu === 'members' && } - {activeMenu === 'billing' && } - {activeMenu === 'data-source' && } - {activeMenu === 'api-based-extension' && } - {activeMenu === 'custom' && } - {activeMenu === 'language' && } + {activeMenu === ACCOUNT_SETTING_TAB.PROVIDER && } + {activeMenu === ACCOUNT_SETTING_TAB.MEMBERS && } + {activeMenu === ACCOUNT_SETTING_TAB.BILLING && } + {activeMenu === ACCOUNT_SETTING_TAB.DATA_SOURCE && } + {activeMenu === ACCOUNT_SETTING_TAB.API_BASED_EXTENSION && } + {activeMenu === ACCOUNT_SETTING_TAB.CUSTOM && } + {activeMenu === ACCOUNT_SETTING_TAB.LANGUAGE && }