🐛 Fix Vitest SDK status values and add SDK E2E tests to CI#181
🐛 Fix Vitest SDK status values and add SDK E2E tests to CI#181
Conversation
Fixes #179 - Vitest client was checking for 'passed'/'failed' status values but PR #169 changed the TDD handler to return 'match'/'diff'. **Vitest SDK fix:** - Changed status checks from 'passed' to 'match' - Changed status checks from 'failed' to 'diff' - Added handling for 'baseline-updated' status **CI improvements:** - Added `test-sdk-e2e` job that always runs (not conditional on path changes) - Tests Core JS Client, Vitest, Ember, and Ruby SDKs end-to-end - Removed redundant `test-site` job (now part of test-sdk-e2e) - Shared Playwright browser cache across SDK tests This ensures CLI changes that break SDK integrations are caught before merge.
Code Review SummaryThis PR correctly fixes the Vitest SDK status mismatch bug and adds valuable E2E testing infrastructure. The changes are well-structured and address the root cause effectively. ✅ Strengths1. Correct Bug Fix
2. Excellent CI Improvements
3. Comprehensive Test Coverage
🔍 Observations & Suggestions1. Test Coverage Gap (Low Priority) The E2E tests will catch this, but consider adding unit/integration tests for
This would catch regressions faster (unit tests run on every commit, E2E only in CI). 2. Threshold Logic Clarity Looking at the handler code (src/server/handlers/tdd-handler.js:485-499), it appears the TDD service returns 3. CI Workflow - Job Dependencies 4. Error Handling Consistency 🔒 SecurityNo security concerns. The changes are confined to:
⚡ PerformancePositive impact:
📝 Code QualityStyle & Conventions:
Potential Improvement: 🧪 Test Plan VerificationFrom the PR description:
The test plan is thorough and appropriate. 📋 RecommendationsMust Fix: None - the PR is ready to merge as-is. Should Consider (Non-blocking):
Nice to Have (Future):
✨ Final VerdictApproved! This PR:
The fix is minimal, correct, and well-tested by the E2E suite. Once the CI passes, this is ready to merge. Great work connecting the dots between PR #169's backend changes and the client SDK impact! 🎯 |
Each SDK now has its own isolated job for better: - Parallelism (all SDK E2E tests run concurrently) - Failure diagnosis (easy to see which SDK failed) - Visibility (clear job names in GitHub Actions UI) Jobs: - e2e-core-js-client: Core vizzlyScreenshot function with Playwright - e2e-vitest-sdk: toMatchScreenshot matcher - e2e-ember-sdk: vizzlyScreenshot helper with Testem - e2e-ruby-sdk: Vizzly.screenshot with TDD server
Summary
match/diffinstead ofpassed/failed)test-sdk-e2eCI job that always runs to catch CLI changes that break SDK integrationstest-sitejob (consolidated intotest-sdk-e2e)Fixes #179
Changes
Vitest SDK (
clients/vitest/src/setup.js):'passed'→'match'status check'failed'→'diff'status check'baseline-updated'statusCI Workflow (
.github/workflows/ci.yml):test-sdk-e2ejob that runs on every PR/push (not conditional on SDK file changes)test-siteintotest-sdk-e2eContext
PR #169 changed the TDD handler to return
'match'/'diff'instead of'passed'/'failed', but the Vitest client wasn't updated. This caused the error "Unknown comparison status: match" reported in #179.The SDK E2E tests would have caught this - they now run on every PR to prevent similar regressions.
See #180 for follow-up work to add Storybook and Static-site SDK E2E tests.
Test plan
test-sdk-e2ejob passes (will verify in this PR)