← Back to Pull requests

test(db): fail instead of skip when Postgres is unreachable #574

Closed
unknown closed this pull request without merging on Jul 14, 2026 15:18 UTC
View on GitHub
unknown unknown commented on Jul 10, 2026 22:13 UTC
Author

Description

The integration-tagged DB test helpers (v1alpha1store.NewTestPool and the freshDB/newDB copies under pkg/registry/database) skip when Postgres is unreachable, so make test without a database goes silently green. They now fail fast with a hint to start Postgres or run make test-unit. Failure messages never echo the DSN (connect errors already name user/database/host, and credentials stay out of CI logs). CI already provisions Postgres before make test and is unaffected.

Also:

  • The three scattered DB-helper test files (legacymigrate, migrate_searchpath, orchestrator) consolidate into one test/integration/database/ package with a single shared freshDB; still covered by make test's -tags=integration ./....

  • The admin DSN can be overridden via AGENT_REGISTRY_TEST_DATABASE_URL (URL-form; default unchanged) or passed explicitly via NewTestPoolWithDSN(t, dsn) (pool, testDSN) for suites that own their database configuration; the exported test surface is exactly NewTestPool + NewTestPoolWithDSN, with the DSN plumbing unexported behind them (pinned by in-package tests).

  • The test-cli-e2e tier's documented self-skip is untouched.
  • Change Type

    /kind cleanup

    Changelog

    ``release-note
    NONE
    ``

    Diff: 157 lines (+117 / -40) across 1 files Reviewer: lcopi Review duration: 5344m
    All Vouch review confidence checks passed
    Residual risk 0.13 = Change Risk (0.33) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.33 · 157 lines diff across 1 files
    0.33
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.303
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #574"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 33.3% (LOW) · Higher = larger blast radius
    33.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 13.2% · Safe to merge
    13.2%