Skip to content

test: cover 5 low-coverage modules (closes ROADMAP L2578 executor → all repos ≥80%)#172

Merged
cipher813 merged 1 commit into
mainfrom
test/zero-coverage-analysis-260512
May 12, 2026
Merged

test: cover 5 low-coverage modules (closes ROADMAP L2578 executor → all repos ≥80%)#172
cipher813 merged 1 commit into
mainfrom
test/zero-coverage-analysis-260512

Conversation

@cipher813
Copy link
Copy Markdown
Owner

Summary

  • Closes ROADMAP L2578 entirely — executor was the last repo below 80%
  • Executor overall coverage: 76.30% → 80.03%
  • Test suite: 684 → 755 passing (+71 tests)
  • All new tests use mocked IBKRClient / boto3 / subprocess / urllib — no IB Gateway, no S3, no real AWS credentials

Coverage delta

Module Before After Notes
executor/config_loader.py 46.2% 100% 5 tests; path-resolution + no-silent-fallback guarantee
executor/price_monitor.py 22.4% 100% 21 tests; PriceMonitor lifecycle + tick aggregation + live/delayed field fallback
executor/bracket_orders.py 7.8% 98% 8 tests; market-BUY + trailing stop happy/partial/timeout/qualify-failure
executor/emergency_shutdown.py 0% 97% 12 tests; paper-account-only hard-exit + cascading failure resilience
executor/trade_logger.py 59.1% 100% 23 tests; full schema + idempotent migrations + entry-lookup helpers + S3 backup

ROADMAP L2578 status after this PR

All 6 repos at or above the 80% target:

Repo Before this arc After
Backtester 77.7% 80.3% (PR #198)
Predictor 74.9% 80.1% (PR #150)
Executor 76.3% 80.0% (this PR)
Data 82% already ≥80%
Research 80% already ≥80%
Dashboard 86% already ≥80%

Notes

  • executor/liquidate_all.py was excluded. It uses bare imports (from ibkr import IBKRClient, from trade_logger import ...) that only resolve when the file is run as a script from the executor/ directory; import executor.liquidate_all fails with ModuleNotFoundError. Would require a small refactor to package-qualified imports before becoming unit-testable. Not in scope for this coverage push.
  • executor/bracket_orders.py:117 is an unreachable else branch (the upstream terminal_states set already covers every value the prior elif checks against). Pinned at 98% rather than 100%.

Test plan

  • pytest -q — 755 passed
  • pytest --cov=. --cov-report=term-missing — overall 80.03%
  • No production-code changes
  • No S3 / IB Gateway / network / AWS-credential dependencies in any new test
  • No new dependencies in requirements.txt

🤖 Generated with Claude Code

… executor)

Coverage 76.30% → 80.03% (target 80%). Suite 684 → 755 (+71 tests).

New test modules:
- tests/test_config_loader.py       ( 5 tests, 100% module cov)
- tests/test_price_monitor.py       (21 tests, 100% module cov)
- tests/test_bracket_orders.py      ( 8 tests,  98% module cov; 1 unreachable else branch)
- tests/test_emergency_shutdown.py  (12 tests,  97% module cov)
- tests/test_trade_logger.py        (23 tests, 100% module cov)

All new tests use mocked IBKRClient / boto3 / subprocess / urllib —
no IB Gateway, no S3, no real AWS credentials required. Trade-logger
tests use tmp_path sqlite for isolation.

`liquidate_all.py` skipped: bare imports (`from ibkr import ...`) only
resolve when run as a script from the executor/ directory, not as a
package module. Would need a refactor before unit-testable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cipher813 cipher813 merged commit 46a8892 into main May 12, 2026
1 check passed
@cipher813 cipher813 deleted the test/zero-coverage-analysis-260512 branch May 12, 2026 22:00
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