Skip to content

test(pipeline): fix Phase 2 tests to require ssr.build execution#124

Closed
zeroedin wants to merge 2 commits into
mainfrom
spec/issue-117-ssr-build-execution
Closed

test(pipeline): fix Phase 2 tests to require ssr.build execution#124
zeroedin wants to merge 2 commits into
mainfrom
spec/issue-117-ssr-build-execution

Conversation

@zeroedin

Copy link
Copy Markdown
Owner

Summary

  • Fixes existing Phase 2 tests that incorrectly validated local DSD transform (shadowrootmode insertion). Per spec §6, BuildPhase2 must shell out to the configured ssr.build command — Alloy does not perform SSR itself.
  • Adds 2 new tests proving BuildPhase2 must error when the command fails (not silently fall back to local transform).
  • Updates IMPLEMENTATION.md Phase 4D to specify os/exec command execution with no fallback.

Test changes (16 → 18 specs)

Test Change
"Phase 2 transforms intermediate HTML" Fixed: expects command execution error, not shadowrootmode output
"Phase 2 receives Phase 1 output" Fixed: uses echo ok as ssr.build command
"with SSR config, Phase 2 runs" Fixed: tolerates command execution error
"BuildPhase2 returns error when ssr.build command fails" New: nonexistent command must error
"BuildPhase2 does not fall back to local transform" New: must not produce shadowrootmode via local fallback

Current state: 15 pass, 3 fail

The 3 failing tests prove the bug — BuildPhase2 currently does a local transformCustomElements instead of executing ssr.build. These will pass once the implementation shells out via os/exec.

Test plan

  • go vet ./internal/pipeline/... compiles clean
  • 15 previously passing tests remain green
  • 3 new/modified tests fail, proving the spec violation

Closes #117

🤖 Generated with Claude Code

zeroedin and others added 2 commits April 16, 2026 00:19
- Add OverlayState to Server struct, initialized in New/NewWithMode
- Expose via Overlay() accessor for use by rebuild loop
- serveFileWithReload injects error overlay HTML before </body> when
  active build errors exist (dev mode only)
- Rebuild loop in cmd/serve.go sets errors on failure, clears on success,
  and broadcasts reload in both cases so browser shows the overlay

Closes #106

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Existing Phase 2 tests validated local DSD transform (shadowrootmode
insertion), but the spec says BuildPhase2 must shell out to the
configured ssr.build command — Alloy does not perform SSR itself.

Changes:
- Fix "Phase 2 transforms intermediate HTML" to expect command execution
  error when ssr.build tool is not installed (not local transform)
- Fix "Phase 2 receives Phase 1 output" to use echo as ssr.build command
- Fix "with SSR config" to tolerate command execution error
- Add "BuildPhase2 returns error when ssr.build command fails"
- Add "BuildPhase2 does not fall back to local transform"
- Update IMPLEMENTATION.md Phase 4D: BuildPhase2 uses os/exec, no fallback

Closes #117

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

SSR Phase 2: ssr.build command never executed, built-in transform produces wrong output

1 participant