High-Priority Sprint: Code Quality & Test Coverage Improvements#65
Merged
pfrederiksen merged 2 commits intomainfrom Jan 12, 2026
Merged
High-Priority Sprint: Code Quality & Test Coverage Improvements#65pfrederiksen merged 2 commits intomainfrom
pfrederiksen merged 2 commits intomainfrom
Conversation
…tions Extracted 4 helper methods from monolithic _render_details(): - _render_compute_section() - CPU, Memory, GPU (52 lines) - _render_network_section() - Network info (16 lines) - _render_storage_section() - Storage, EBS, Architecture, Additional Info (53 lines) - _render_pricing_section() - All pricing info (145 lines) Main _render_details() now orchestrates at 50 lines instead of 286. All 986 tests pass. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Added 3 new tests for async pricing background workers: - test_fetch_pricing_background_handles_shutdown - test_retry_pricing_skips_when_shutting_down - test_retry_pricing_with_no_failed_instances Coverage improved from 40% (178/443 lines) to 49% (218/443 lines). Added 40 lines of coverage focusing on shutdown handling and edge cases. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completed high-priority code quality improvements focusing on refactoring monolithic functions and improving test coverage for critical TUI components.
Changes
1. Refactor instance_detail.py (287 lines → 50-line orchestrator)
Broke down the monolithic
_render_details()method into 4 focused helper methods:_render_compute_section()- CPU, Memory, GPU resources (52 lines)_render_network_section()- Network information (16 lines)_render_storage_section()- Storage, EBS, Architecture, Additional Info (53 lines)_render_pricing_section()- All pricing information (145 lines)Benefits:
2. Add Async Pricing Worker Tests (app.py coverage: 40% → 49%)
Added 3 new tests for async background pricing workers:
test_fetch_pricing_background_handles_shutdown- Graceful shutdown handlingtest_retry_pricing_skips_when_shutting_down- Retry shutdown safetytest_retry_pricing_with_no_failed_instances- Empty retry list handlingCoverage Improvements:
Test Results
All 989 tests pass, including:
Notes
Checklist
\ud83e\udd16 Generated with Claude Code