Back to Source Monitor

Sub-Module Unit Tests & Shared Concern Tests

.vbw-planning/milestones/07-rails-audit-and-refactoring/06-test-infrastructure/03-SUMMARY.md

0.13.01.7 KB
Original Source

What Was Built

Created isolated unit tests for the extracted FeedFetcher sub-modules (AdaptiveInterval, SourceUpdater) that were refactored in Phase 3 but never received dedicated test files. Created a SharedLoggableTests module that validates the Loggable concern contract and included it in all 3 log model test files (FetchLog, ScrapeLog, HealthCheckLog). Added 64 new tests across 5 new/updated files. Full suite passes at 1622 runs, 0 failures.

Commits

  • 370e21e test(06-03): add AdaptiveInterval isolated unit tests
  • cd36b9f test(06-03): add SourceUpdater isolated unit tests
  • 3023863 test(06-03): add SharedLoggableTests module for Loggable concern
  • fe92094 test(06-03): include SharedLoggableTests in all log model tests

Tasks Completed

  • Create AdaptiveInterval unit tests (18 tests)
  • Create SourceUpdater unit tests (22 tests)
  • Create SharedLoggableTests module (9 shared tests)
  • Include SharedLoggableTests in log model tests (3 files, 46 total tests)

Files Modified

  • test/lib/source_monitor/fetching/feed_fetcher/adaptive_interval_test.rb -- new, 18 tests covering interval calculations, bounds, jitter, edge cases
  • test/lib/source_monitor/fetching/feed_fetcher/source_updater_test.rb -- new, 22 tests covering success/failure updates, log creation, metadata, recovery
  • test/support/shared_loggable_tests.rb -- new, shared module with 9 Loggable concern contract tests
  • test/models/source_monitor/fetch_log_test.rb -- added SharedLoggableTests include + build_loggable factory
  • test/models/source_monitor/scrape_log_test.rb -- added SharedLoggableTests include + build_loggable factory
  • test/models/source_monitor/health_check_log_test.rb -- new, SharedLoggableTests + 4 model-specific tests

Deviations

None.