Skip to content

fix(studio): unbreak Test Core CI by repairing vitest config and stale tests#1174

Merged
xuyushun441-sys merged 2 commits intomainfrom
copilot/fix-ci-build-and-test-errors-d84cbd23-45f8-4018-8904-cdbedc70c528
Apr 17, 2026
Merged

fix(studio): unbreak Test Core CI by repairing vitest config and stale tests#1174
xuyushun441-sys merged 2 commits intomainfrom
copilot/fix-ci-build-and-test-errors-d84cbd23-45f8-4018-8904-cdbedc70c528

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

@objectstack/studio#test has been failing on main since #1150 (2026-04-16), taking down the Test Core job. Three independent issues were conflated under a single command exited (1):

1. Wrong relative paths in nested test files

test/plugins/plugin-system.test.tsx (and three component tests) used ../src/... but live two levels under apps/studio/, so Vite reported Failed to resolve import "../src/plugins". Corrected to ../../src/....

2. vitest.config.ts missing ~25 aliases from vite.config.ts

Only @ was declared. Any test transitively importing src/mocks/createKernel.ts blew up with:

Error: "./objects" is not exported under the conditions ["node", "development", "import"]
from package .../@objectstack/plugin-auth

The plugin-{auth,security,audit}/objects subpath aliases and the node-builtin polyfill stubs were only present in vite.config.ts. Rebuilt vitest.config.ts to mirror the full alias set (with a comment pointing to the source of truth). setupFiles is now an absolute path.

3. Stale tests against non-existent APIs

Four tests introduced in 115612c targeted API surfaces that do not exist and never passed CI:

  • plugin-system.test.tsx — called registry.getAllPlugins(), activateAll(), getViewersForType(), and new PluginRegistry([plugins]). Rewritten against the real API (getPlugins, getViewers, registerAndActivate, isActivated, getSidebarGroups) and the async activation lifecycle of PluginRegistryProvider.
  • AppSidebar.test.tsx, ObjectDataForm.test.tsx, ObjectDataTable.test.tsx — passed props that were removed from the components (selectedObject, onSelectObject, onCreate, onUpdate, objectDef) and rendered TanStack Router hooks without a router context. Unsalvageable without rewriting from scratch; removed.

Follow-ups worth considering

  • Add proper ./objects subpath exports to plugin-auth/plugin-security/plugin-audit so Studio doesn't need the alias workaround in two places.
  • The apps/studio build task runs msw init && vite build, making test.dependsOn: ["build"] in turbo.json do real work per-test-run. Switching to ^build would be leaner.

Copilot AI and others added 2 commits April 17, 2026 03:58
…ale tests

Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/7895254c-6920-4d1d-9af2-fab5bf005c67

Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectstack-demo Ready Ready Preview, Comment Apr 17, 2026 4:19am
spec Building Building Preview, Comment Apr 17, 2026 4:19am

Request Review

@xuyushun441-sys xuyushun441-sys marked this pull request as ready for review April 17, 2026 04:19
@xuyushun441-sys xuyushun441-sys merged commit 89f796b into main Apr 17, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants