Skip to content

fix: add A2UI bundle step to gateway test build#65

Closed
arubis wants to merge 1 commit intoopenclaw:mainfrom
arubis:fix/gateway-tests-a2ui-bundle
Closed

fix: add A2UI bundle step to gateway test build#65
arubis wants to merge 1 commit intoopenclaw:mainfrom
arubis:fix/gateway-tests-a2ui-bundle

Conversation

@arubis
Copy link

@arubis arubis commented Feb 24, 2026

Hi there — first-time contributor here. We ran into this while working on #62 (the rolldown/sandbox build fix in #63). Happy to adjust anything that doesn't fit your preferences.

Problem

Upstream commit 2dcb2449 ("refactor(test): dedupe gateway and web scaffolding") renamed server.canvas-auth.e2e.test.ts to server.canvas-auth.test.ts. The vitest base config excludes **/*.e2e.test.ts, so this rename brought the canvas-auth test into the gateway vitest suite for the first time.

The test expects a scoped A2UI fetch to return HTTP 200, but gateway-tests-build.sh only ran pnpm install — it never produced a2ui.bundle.js. Without the bundle, the A2UI handler returns 503 ("A2UI assets not found"), causing the test to fail.

Fix

Add the minimal build steps needed to produce the A2UI bundle in the test environment:

  1. chmod -R u+w node_modules (required for pnpm rebuild)
  2. pnpm rebuild for native deps (same download-blocker pattern as the production build)
  3. Rolldown PATH shim (rolldown was removed from direct devDependencies upstream but remains as a transitive dep via rolldown-plugin-dts)
  4. pnpm canvas:a2ui:bundle

The STDENV_SETUP check is also moved earlier in the script to match the production build's ordering.

Verification

Closes #64

Test plan

  • nix build .#checks.x86_64-linux.gateway-tests passes at v2026.2.22 — 54 test files, 553 tests, all green
  • nix build .#checks.x86_64-linux.gateway-tests at v2026.2.20 — no regression from this change (pre-existing net.test.ts failure unrelated)

🤖 Generated with Claude Code

Upstream renamed server.canvas-auth.e2e.test.ts to .test.ts (commit
2dcb2449), bringing it into the gateway vitest suite for the first
time. The test expects A2UI assets on disk, but the test build never
ran canvas:a2ui:bundle — causing a 503 instead of the expected 200.

Add the minimal build steps needed to produce the bundle: native dep
rebuild, rolldown PATH shim (same pattern as the production build),
and the canvas:a2ui:bundle step itself.

Closes openclaw#64

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@arubis
Copy link
Author

arubis commented Feb 24, 2026

Folded into #63 — the two fixes are tightly coupled (the test build fix is only needed because of the pin bump, and the pin bump can't pass CI without the test build fix). Keeping them in one PR avoids a chicken-and-egg CI problem.

@arubis arubis closed this Feb 24, 2026
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.

Gateway test build needs canvas:a2ui:bundle for renamed canvas-auth test

1 participant