Skip to content

test: fault injection, DNS/HTTPS provisioning, CI sharding, and a11y navigation tests#676

Open
Mystery-CLI wants to merge 4 commits into
StellerCraft:mainfrom
Mystery-CLI:main
Open

test: fault injection, DNS/HTTPS provisioning, CI sharding, and a11y navigation tests#676
Mystery-CLI wants to merge 4 commits into
StellerCraft:mainfrom
Mystery-CLI:main

Conversation

@Mystery-CLI
Copy link
Copy Markdown
Contributor

Summary

Closes #580
Closes #579
Closes #578
Closes #577

Changes

#580 — Fault injection test suite for Health Monitor Service

  • Created apps/backend/src/services/health-monitor.fault-injection.test.ts with 20+ test cases covering:
    • Database (Supabase) failure: null deployment, DB error object, missing deployment_url field, null active-deployments list, null owner lookup
    • Vercel network failures: 502, 503, connection refused, request timeout, analytics recording on failure
    • Stellar network failures: 503, timeout, unreachable
    • Stripe endpoint failures: 500, 429 rate-limit, connection timeout
    • Partial failures: one of three deployments down, all dependencies failing simultaneously, per-dependency uptime recording
    • Combined failures: DB miss with analytics failure, network failure + zero responseTime, downtime notification with successful owner lookup
  • Added JSDoc dependency graph to health-monitor.service.ts documenting all external dependencies and failure modes

#579 — Vercel DNS Verification and HTTPS Certificate Provisioning

Extended apps/backend/src/app/api/deployments/[id]/dns/verify/route.test.ts:

  • 400 for unsupported DNS record type (A record)
  • 400 for invalid JSON body
  • 400 for non-string token
  • 200 with verified: false + TOKEN_MISMATCH when TXT value does not match
  • 200 with verified: false + WRONG_TARGET when CNAME points to wrong host
  • 500 when upstream DNS resolver throws (DNS resolver unavailable, CNAME lookup timeout)
  • 404 when deployment row does not exist in DB
  • Enterprise tier is allowed (not just pro)

Extended apps/backend/src/app/api/deployments/[id]/https/route.test.ts:

  • POST: cert state is pending immediately after domain add
  • POST: AUTH_FAILED maps to 500
  • POST: generic unexpected addDomain error returns 500
  • POST: getCertificate throwing after successful addDomain propagates
  • POST: Retry-After rounds fractional retryAfterMs up to nearest second
  • POST: Retry-After header omitted when retryAfterMs is undefined
  • GET: issued cert state during provisioning (polling cycle 1)
  • GET: active cert state with expiresAt once provisioning completes
  • GET: error state when Vercel-side provisioning fails (e.g. CAA mismatch)
  • GET: 500 when getCertificate throws during polling
  • GET: 404 when vercel_project_id is missing

#578 — Parallelized Test Sharding Infrastructure for CI

  • Updated vitest.config.ts (root): added sequence.shuffle: false and detailed sharding documentation (CLI usage, shard count rationale, shard-safety rules)
  • Updated apps/backend/vitest.config.ts: added sequence.shuffle: false with shard-safety comment
  • Updated apps/frontend/vitest.config.ts: added sequence.shuffle: false with shard-safety comment
  • Created .github/workflows/test-sharding.yml:
    • Backend: 4-shard matrix (--shard=1/44/4), fail-fast: false
    • Frontend: 2-shard matrix
    • JSON coverage artifacts uploaded per shard
    • merge-coverage job downloads all shard artifacts and merges via vitest merge-reports

#577 — Accessibility Compliance Tests for Dashboard Navigation

Extended apps/frontend/tests/accessibility/components.a11y.test.ts:

NavItem (WCAG 2.4.3, 4.1.2, 2.4.6, 1.1.1):

  • Active link exposes aria-current="page"; inactive link does not
  • Non-empty accessible name from label text
  • Disabled item renders as non-link to prevent keyboard focus trap
  • Badge count is visible accessible text; 99+ truncation preserved
  • axe checks for both active and disabled states

Breadcrumbs (WCAG 2.4.8, 4.1.2):

  • nav has aria-label="Breadcrumb" for landmark identification
  • Intermediate crumbs render as links; last crumb renders as plain text
  • axe check for multi-level path
  • Empty items array renders nothing (no orphan nav landmark)

Sidebar (WCAG 2.4.1, 2.4.3, 1.3.1, 1.1.1):

  • axe no-violations check
  • <aside> contains <nav> landmark (bypass blocks)
  • All nav items are keyboard-focusable links
  • Active nav item carries aria-current="page" (mocked usePathname)
  • User avatar image has non-empty alt attribute
  • User name and email are visible text

MobileDrawer (WCAG 2.1.2, 4.1.2, 1.3.1, 1.1.1):

  • axe no-violations when open and when closed
  • <aside> has aria-label="Mobile navigation"
  • Close button has aria-label="Close menu" (icon-only button)
  • Escape key calls onClose (no keyboard trap)
  • Escape is no-op when drawer is closed
  • Backdrop overlay is aria-hidden="true"
  • Clicking close button calls onClose
  • Clicking backdrop calls onClose
  • All nav items present as links inside open drawer
  • User avatar in drawer footer has alt text

🤖 Generated with Claude Code

Mystery-CLI and others added 4 commits May 27, 2026 15:05
- Simulate failures for database, Stellar, Vercel, and Stripe
- Test partial failure scenarios (one dependency down, others healthy)
- Test combined failures (network + analytics simultaneously)
- Assert correct aggregate health status reporting
- Document the health check dependency graph in service JSDoc

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… provisioning

- Test DNS record validation: unsupported type (A record), invalid JSON body, non-string token
- Test DNS verification failure paths: token mismatch, wrong CNAME target, upstream DNS errors
- Test certificate provisioning state polling: pending → issued → active states
- Assert correct handling of AUTH_FAILED, unexpected addDomain errors
- Test Retry-After rounding and omission when retryAfterMs is undefined
- Test GET provisioning error state and getCertificate failure during polling

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Configure Vitest shard support across monorepo (root + per-app configs)
- Add sequence.shuffle: false to all configs for deterministic shard execution
- Add .github/workflows/test-sharding.yml with 4-shard backend matrix and 2-shard frontend matrix
- Include coverage artifact upload and merge-coverage aggregation job
- Document sharding strategy, shard count rationale, and shard-safety requirements

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add Sidebar tests: nav landmark, aria-current active state, avatar alt text (WCAG 2.4.1, 2.4.3, 1.1.1)
- Add MobileDrawer tests: aria-label, close button label, Escape key closes, backdrop aria-hidden, click-to-close (WCAG 2.1.2, 4.1.2, 1.3.1)
- Extend NavItem tests: aria-current page, disabled no-link, badge text (WCAG 2.4.3, 4.1.2)
- Extend Breadcrumbs tests: nav aria-label, last crumb plain text, empty items (WCAG 2.4.8)
- Reference WCAG 2.1 AA success criteria in all test descriptions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@Mystery-CLI Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment