Skip to content

Formalize test architecture: unit, integration, infrastructure, and mission-critical tiers #352

Closed

Description

@joelteply

Problem

No formalized test architecture. Tests exist but there's no clear tier system, no infrastructure tests, and no way to distinguish "this must pass before push" from "nice to verify."

Proposed test tiers

Tier 1: Unit tests (per-module, fast, cargo test)

  • Pure logic: frame serialization, routing decisions, ACL rules, registry operations
  • No I/O, no network, no file system (or temp dirs only)
  • Run on every build, sub-second

Tier 2: Integration tests (cross-module, real I/O)

  • TCP transport roundtrips (like grid's test_tcp_connect_and_send_frame)
  • Database operations with real SQLite/Postgres
  • Registry persistence (write → reload → verify)
  • Run on cargo test, seconds

Tier 3: Infrastructure tests (system-level, pre-push)

  • Full IPC server startup + command routing
  • Candle inference produces coherent output
  • Audio pipeline (STT/TTS) roundtrip
  • Grid transport to actual remote node (if available)
  • Academy sentinel executes a pipeline end-to-end
  • Run via git pre-push hook, minutes

Tier 4: Mission-critical smoke tests (pre-deploy)

  • Inference quality regression (compare output to known-good baselines)
  • LoRA training produces adapter with decreasing loss
  • Multi-node grid command execution
  • Full system boot → browser connects → chat works

Implementation

  • Organize tests by tier in directory structure or naming convention
  • cargo test runs Tier 1+2 by default
  • Pre-push hook runs Tier 3 (can be skipped with --no-verify when AIs have QA'd)
  • CI/CD runs all tiers
  • Each tier has a clear "what breaks if this fails" justification

Prior art

We had pre-commit hooks for TypeScript + CRUD tests. Need to extend to Rust and add pre-push for infrastructure tests.

Activity

  1. joelteply commented on Mar 25, 2026

    @joelteply
    ContributorAuthor

    Test architecture formalized via pre-push hook (PR #427):

    • Tier 1 (unit): cargo test --lib (1592 pass, runs in pre-push)
    • Tier 2 (integration): included in cargo test
    • Tier 3 (infrastructure): TypeScript + Rust compilation gate in pre-push
    • Tier 4 (mission-critical): pre-commit adversarial tests (already existed)

    The pre-push hook enforces Tier 1-3. Pre-commit handles Tier 4. Test tier naming is implicit in the hook phases.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions