Skip to content

Prune redundant tests and clean up stale docs - #415

Draft
spalen0 wants to merge 2 commits into
mainfrom
remove-test
Draft

spalen0 wants to merge 2 commits into
mainfrom
remove-test

Conversation

@spalen0

@spalen0 spalen0 commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Removes tests that duplicate other tests, only restate config, or make real network calls. Fixes or merges docs that had fallen out of sync with the code.

Tests: rebased on main (#414). 1752 passed / 6 skipped → 1724 passed / 4 skipped (30 fewer tests; the 2 fewer skips were Tally tests). The suite still runs in about 13s.

Tests

  • Deleted tests/test_tally.py. It made real DNS/HTTP calls to api.tally.xyz on every CI run and loaded .env, which goes against the "tests never make real calls" rule in conftest.py.
  • Removed duplicate tests:
    • Timelock alert-key tests in test_timelock_alerts.py; test_alert_protocol_keys.py checks every timelock key.
    • get_contract_label backend-order tests in test_source_context.py; it's a thin wrapper and test_address_resolver.py covers the same order.
  • Replaced three weak KNOWN_SELECTORS checks (not empty / 0x prefix / has parentheses) with one test that recomputes every selector from its signature.
  • Removed tests that only restate config:
    • Hardcoded LLM model names: now read from _PROVIDER_DEFAULTS, and the test still checks that anthropic gets the Anthropic provider.
    • Per-asset pegged registry values.
    • The HyperEVM OUSD vault address.
    • The 3Jane timelock entry.
    • Literal severity enum values.
  • Merged the four per-severity emoji tests and the two silent-default tests into one test with subtests (test_alert.py); merged the LOW and MEDIUM dispatch-skip tests (test_dispatch.py).
  • Removed the unused utils/tenderly/alerts_with_timelock.json; nothing references it.

Docs

  • api/README.md: was a stale copy of deploy/alerts-api.md (no /v1/monitoring); it now points there.
  • CONTRIBUTING.md: fixed nonexistent utils/logging.py and utils/http.py (now logger.py and http_client.py) and the cache description (SQLite, not files).
  • README.md: adds the missing 3Jane and Stablecoins entries and links to the monitoring site as the source of truth.
  • deploy/emergency-dispatch-demo.md: replaced the out-of-date protocol table (7 listed vs. many more in code) with a pointer to DISPATCHABLE_PROTOCOLS.
  • protocols/timelock/README.md:
    • The address table was missing 2 of 23 timelocks; replaced it with a pointer to TIMELOCK_LIST.
    • The "How to Add" section duplicated SKILL.md; it now links there.
    • Removed links to a nonexistent detils.md and fixed relative paths.
  • protocols/timelock/SKILL.md: takes over the useful notes from the README (chain registration, bot-token fallback, ALERT_HISTORY_PROTOCOLS) and fixes script paths.

Left as-is on purpose

  • Per-selector golden tests in test_morpho_v2_decoders.py: each tests a different decoder branch.
  • Disk-persistence tests in swiss_knife, source_context and calldata: each checks that module's own rule for which errors are temporary and shouldn't be cached.

Follow-up

protocols/timelock/SKILL.md is not loaded by Claude Code from its current location. It needs to move to .claude/skills/add-timelock-monitoring/SKILL.md; I didn't have permission to write there in this session.

Test plan

  • uv run pytest tests/: 1724 passed, 4 skipped
  • uv run ruff check ., uv run ruff format --check ., uv run ty check
  • All relative links in changed docs resolve

🤖 Generated with Claude Code

spalen0 and others added 2 commits October 6, 2026 05:47
- Delete tests/test_tally.py (live HTTP/DNS calls against api.tally.xyz)
- Drop timelock key tests already covered by test_alert_protocol_keys.py
- Drop get_contract_label tests duplicating test_address_resolver.py
- Replace weak KNOWN_SELECTORS sanity checks with a keccak integrity check
- Read LLM default models from _PROVIDER_DEFAULTS instead of hardcoding them
- Drop registry/config assertions that restate pegged assets, Morpho, timelocks
- Merge per-severity alert emoji/silence and dispatch skip tests
- Remove unused utils/tenderly/alerts_with_timelock.json

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- api/README.md now points to deploy/alerts-api.md instead of a stale copy
- CONTRIBUTING: fix utils/logger.py and utils/http_client.py paths, Python 3.12+, SQLite-backed cache
- CLAUDE.md: defer setup/style to CONTRIBUTING, use uv run, add test command
- README: add 3Jane and Stablecoins, link monitoring site as source of truth
- Dispatch doc: point to DISPATCHABLE_PROTOCOLS instead of a stale table
- Timelock README: replace drifted address table and duplicate how-to with pointers,
  drop broken detils.md links, fix relative paths; SKILL.md absorbs the extra notes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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