From 5a452fe5ade298ddc0a9d771d7ceb180c2e536ec Mon Sep 17 00:00:00 2001 From: Bernardo Belchior Date: Fri, 14 Feb 2025 17:34:05 +0100 Subject: [PATCH 1/2] [charts] Run benchmarks in a real browser --- test/performance-charts/vitest.config.ts | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/test/performance-charts/vitest.config.ts b/test/performance-charts/vitest.config.ts index 7b332cfb991c6..8de97eac8e764 100644 --- a/test/performance-charts/vitest.config.ts +++ b/test/performance-charts/vitest.config.ts @@ -2,19 +2,17 @@ import { defineConfig } from 'vitest/config'; import codspeedPlugin from '@codspeed/vitest-plugin'; import react from '@vitejs/plugin-react'; +const isCI = process.env.CI === 'true'; + export default defineConfig({ - plugins: [codspeedPlugin(), react()], + plugins: [...(isCI ? [codspeedPlugin()] : []), react()], test: { setupFiles: ['./setup.ts'], - environment: 'jsdom', - // browser: { - // enabled: true, - // headless: true, - // name: 'chromium', - // provider: 'playwright', - // providerOptions: { - // timeout: 60000, - // }, - // }, + browser: { + enabled: true, + headless: true, + instances: [{ browser: 'chromium', testTimeout: 60_000 }], + provider: 'playwright', + }, }, }); From 74b0d359f5149bc5369fd9dbc0dbecf4b9083834 Mon Sep 17 00:00:00 2001 From: Bernardo Belchior Date: Fri, 14 Feb 2025 17:41:58 +0100 Subject: [PATCH 2/2] Install playwright browsers --- .github/workflows/codspeed.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index 01504ec66ef00..b077f0898693c 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -44,6 +44,7 @@ jobs: node-version: 20 cache: 'pnpm' # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-dependencies - run: pnpm install --frozen-lockfile + - run: pnpm exec playwright install # Ensure we are running on the prod version of our libs - run: pnpm --filter "@mui/x-charts-pro..." build - name: Run benchmarks