Skip to content

Feat: Compatibility Verification Suite (k6 test harness)#41

Merged
makinosp merged 20 commits into
mainfrom
feature/compatibility-verification
Jun 29, 2026
Merged

Feat: Compatibility Verification Suite (k6 test harness)#41
makinosp merged 20 commits into
mainfrom
feature/compatibility-verification

Conversation

@makinosp

@makinosp makinosp commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Summary

Add a comprehensive k6-based automated test suite that validates Utopia's API responses against Firefly-III compatibility requirements.

What's Included

Seed Data Generator (scripts/seed/)

  • TypeScript/Bun script that truncates tables and inserts deterministic test fixtures
  • 6 account fixtures (asset, cash, expense, revenue, liability types)
  • 5 transaction fixtures (deposit, withdrawal, transfer)
  • Shared TypeScript interfaces for type consistency with k6 scripts

k6 Test Suite (k6/)

  • Test harness (harness.ts): Shared utilities for auth, response validation, pagination checks, and Firefly-III envelope verification
  • Auth tests (auth.ts): 6 scenarios — token issuance, authenticated request, unauthenticated rejection, token revocation, revoked token rejection, invalid bootstrap key
  • Accounts tests (accounts.ts): 7 scenarios — list, get, create, update, delete, pagination, type filter
  • Transactions tests (transactions.ts): 8 scenarios — list, get, create, update, delete, account-scoped listing, pagination, type filter
  • Fixtures (fixtures/): JSON schemas for strict response validation

Infrastructure

  • Docker Compose: Added k6 service with testing profile, volume mounts for k6/ and scripts/seed/
  • GitHub Actions (.github/workflows/compatibility-check.yml): CI workflow that starts the stack, loads seed data, runs the full k6 suite, and uploads results as artifacts on every PR
  • .env.example: Added APP_BASE_URL and K6_OUTPUT_DIR variables

Documentation

  • Code summary document (aidlc-docs/construction/compatibility-verification-suite/code/code-summary.md)
  • Updated aidlc-state.md and audit.md for UOW-05 Code Generation

NFR Compliance

NFR Implementation
PRF-001 (< 2 min) 1 VU, sequential execution, no throttling
PRF-002 (< 500ms) k6 threshold: http_req_duration: ["p(95)<500"]
REL-001 (Idempotency) Deterministic seed data, truncate+reseed before each run
REL-002/003 (Isolation/Reset) TRUNCATE ... CASCADE before seed
OBS-001/002 (Reporting) JSON output with per-test pass/fail + timing, uploaded as CI artifacts
SEC-001/002 (Security) Synthetic fixtures only, k6 runs in Docker Compose network
MAI-001/002/003 (Maintainability) TypeScript throughout, per-domain files with shared harness
INF-001/002 (Infrastructure) k6 service in Docker Compose, GitHub Actions on every PR

Test Plan

  • Start Docker Compose stack
  • Load seed data: bun run scripts/seed/index.ts
  • Run k6 suite: ./k6/run-all.sh
  • Verify all tests pass
  • Confirm CI workflow runs on PR

makinosp and others added 4 commits June 27, 2026 13:41
Add AI-DLC documentation for the new Compatibility Verification Suite unit
(UOW-05): state tracking, audit log entries, requirements analysis, workflow
planning, and NFR requirements plan for k6-based Firefly-III compatibility
testing.

Co-Authored-By: GitHub Copilot <noreply@github.com>
Add a comprehensive k6-based automated test suite that validates Utopia's
API responses against Firefly-III compatibility requirements.

- Seed data generator (scripts/seed/): TypeScript/Bun script that
  truncates tables and inserts deterministic test fixtures
- k6 test fixtures (k6/fixtures/): JSON schemas for strict response
  validation of auth, accounts, and transactions endpoints
- k6 test harness (k6/harness.ts): Shared utilities for auth, response
  validation, pagination checks, and Firefly-III envelope verification
- k6 test scripts: auth.ts (6 scenarios), accounts.ts (7 scenarios),
  transactions.ts (8 scenarios)
- k6 runner script (k6/run-all.sh): Orchestrates full test suite execution
- Docker Compose: Added k6 service with testing profile
- GitHub Actions: CI workflow for automated compatibility testing on PR
- Updated .env.example with k6 environment variables
- Updated aidlc-state.md and audit.md for UOW-05 Code Generation

Co-Authored-By: GitHub Copilot <<EMAIL>>
@makinosp makinosp self-assigned this Jun 27, 2026
makinosp added 16 commits June 27, 2026 22:47
Fix multiple issues causing the compatibility-check workflow to fail:

1. Health check: Use /metrics endpoint (unauthenticated) on port 3000
   instead of /api/v1/about (requires auth, redirects through Caddy)
2. Seed data: Expose postgres port 5432 to host so bun seed script
   can connect from the GitHub Actions runner
3. k6 profile: Add --profile testing flag to docker compose run
   commands so the k6 service is activated
4. .env for CI: Create .env from .env.example with Docker Compose
   network settings (postgres host, sslmode=disable, strict_ssl=false)
5. Dockerfile: Add curl for container healthcheck support
6. docker-compose: Add healthcheck to utopia-api, expose ports,
   use bind mount for k6 results, depend on healthy state
@makinosp
makinosp merged commit 49a6ca9 into main Jun 29, 2026
2 checks passed
@makinosp
makinosp deleted the feature/compatibility-verification branch June 29, 2026 09:53
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.

1 participant