Repository navigation
test(nostr): consolidate metrics coverage at its owner - #134378
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Maintainer source and test review is complete. The latest published ClawSweeper comment is still the review-started placeholder and contains no findings or Rank-up moves; I am not treating it as a substantive review. Independent Codex autoreview is clean, all 34 metrics/key/outbound cases pass (38 before removing the copied/repeated demonstrations), full changed checks pass, and exact-head CI is green. The removed circuit, health and reconnect demonstrations never invoked those bus owners. Metrics callback/state/counter coverage remains, including an explicit half-open snapshot, and direct bus circuit/health proof is recorded as a follow-up. Production +0/-0; rename-aware tests +112/-235 including moved cases. Proceeding through the native landing gates under the requested maintainer test-maintenance batch. |
|
Merged via squash.
|
What problem does this PR solve?
The Nostr integration test file exercises only the metrics owner. Three cases demonstrate copied reconnect/circuit/health logic without invoking the bus, and a separate metrics loop emits 10,000 identical events without testing an additional boundary.
Why this approach?
Move the metrics cases to their owner-named test file, consolidate metrics fuzz coverage there, and delete the copied demonstrations and repeated emission loop. Preserve counter, callback, reset, malformed input, gauge and relay snapshot checks, and assert the real metrics half-open state explicitly. Key fuzz tests and actual bus outbound tests remain separate.
User impact
Test-only cleanup. Production +0/-0; rename-aware test diff +112/-235, including moved cases. This removes four low-value cases and 10,000 redundant emissions; it does not change relay behavior or claim a measured elapsed-time improvement.
Evidence
The original metrics/fuzz/outbound selection passed all 38 tests. The replacement selection passes all 34 tests: 21 metrics, 11 key fuzz and two actual outbound bus cases. Full changed-file checks and Codex autoreview pass.
node scripts/run-vitest.mjs extensions/nostr/src/metrics.test.ts extensions/nostr/src/nostr-bus.fuzz.test.ts extensions/nostr/src/nostr-bus.outbound.test.tsFollow-up: add direct bus-owner evidence for circuit thresholds, half-open recovery and health-ranked relay selection. The deleted hand-written demonstrations never covered those owner paths; the retained metrics state assertions do not substitute for relay integration proof.