Conversation
The E2E tests were failing because: 1. The production build used `VITE_USE_MOCK_SERVER=false` 2. No backend API server was running during E2E tests 3. The app failed to initialize without API access 4. Sidebar elements were not rendered, causing test failures Solution: - Added `build:e2e` script that enables mock mode - Updated CI workflow to use `build:e2e` for console app - E2E tests now run with MSW mocking all API calls Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/c3922d38-8455-4461-9bbf-bd2719326e37 Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
❌ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
There was a problem hiding this comment.
Pull request overview
Fixes CI E2E failures by ensuring the Console app is built with the mock server enabled, removing the need for a live backend API during Playwright runs.
Changes:
- Added a dedicated
build:e2escript for the Console app that builds withVITE_USE_MOCK_SERVER=true. - Updated the CI build job to build workspace packages via Turbo and build the Console app using
build:e2efor the E2E pipeline.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| apps/console/package.json | Adds build:e2e to produce a mock-enabled production build for E2E execution. |
| .github/workflows/ci.yml | Switches CI to use the mock-enabled Console build prior to running Playwright E2E tests. |
| "build:e2e": "pnpm msw:init && tsc && VITE_USE_MOCK_SERVER=true vite build && pnpm build:plugin", | ||
| "build:vercel": "pnpm msw:init && tsc && VITE_USE_MOCK_SERVER=true vite build && pnpm build:plugin", |
There was a problem hiding this comment.
build:e2e is currently identical to build:vercel, which creates duplicated build logic and a risk of them drifting over time. Consider making one script call the other (or extracting a shared build:mock script) so there’s a single source of truth for the mock-enabled production build.
| "build:e2e": "pnpm msw:init && tsc && VITE_USE_MOCK_SERVER=true vite build && pnpm build:plugin", | |
| "build:vercel": "pnpm msw:init && tsc && VITE_USE_MOCK_SERVER=true vite build && pnpm build:plugin", | |
| "build:mock": "pnpm msw:init && tsc && VITE_USE_MOCK_SERVER=true vite build && pnpm build:plugin", | |
| "build:e2e": "pnpm build:mock", | |
| "build:vercel": "pnpm build:mock", |
| - name: Build Core & Console | ||
| run: pnpm turbo run build --filter='./packages/*' --filter='./apps/console' | ||
| run: | | ||
| pnpm turbo run build --filter='./packages/*' | ||
| pnpm --filter @object-ui/console build:e2e |
There was a problem hiding this comment.
The console build is now executed outside Turbo (pnpm --filter @object-ui/console build:e2e), which means Turbo caching won’t apply to that portion of the build. If CI build time becomes an issue, consider adding VITE_USE_MOCK_SERVER to Turbo’s tracked env (turbo.json globalEnv/task env) and running the console build via Turbo with the env set, so cache correctness and performance are both preserved.
E2E tests failing in CI (run #24347234190) because the console app was built with
VITE_USE_MOCK_SERVER=falsebut no backend API was available during tests. The app failed to initialize without API access, causing sidebar elements to never render.Changes
build:e2escript toapps/console/package.jsonthat builds withVITE_USE_MOCK_SERVER=true, enabling MSW to mock all API callsbuild:e2einstead of defaultbuildfor the console app in the E2E test pipelineThe E2E tests now run against a fully functional app with mocked API responses, eliminating the backend dependency during testing.