Skip to content

Increase unit test coverage#770

Merged
jsnmrs merged 2 commits intomainfrom
increase-test-coverage
Mar 1, 2026
Merged

Increase unit test coverage#770
jsnmrs merged 2 commits intomainfrom
increase-test-coverage

Conversation

@jsnmrs
Copy link
Copy Markdown
Owner

@jsnmrs jsnmrs commented Mar 1, 2026

Description

Un-skip database tests:

  • NewsModelsTest: 11 skips → 2 (getSite, getSites, getSitesRecent, streamPage, getStreamPageTotal, updateFeed now exercised)
  • AggroControllerTest: 15 skips → 0 (all controller methods now tested via CLI gate_check bypass)
  • FrontControllerUnitTest: 7 skips → 0 (about, sites, video endpoints now tested)
  • YoutubeModelsTest: 7 skips → 4 (getDuration tests now use mocked UtilityModels)

New test files:

  • ValidationServiceTest (26 tests): sanitizeSlug, validateVideoId, validateGateKey, sanitizeInt
  • SentryLogHandlerTest (17 tests): canHandle, mapLogLevelToSentry, cleanErrorMessage, handle
  • StorageConfigTest (7 tests): thumbnail paths, cleanup/archive age, default values

Improve existing tests:

  • ThumbnailServiceTest: 13 skips → 0 (private methods tested via reflection + temp files)
  • FeedControllerTest: 3 skips → 0 (switched to ServiceTestCase for news_feeds table)
  • AggroHelperTest: safe_file_write invalid path, csrf_action_form, file round-trip tests
  • ViewHelperTest: 3 skips → 0 (invalid date/timezone exception tests, edge cases)
  • SecurityFilterTest: 3 new after() method tests for security headers

Feature tests:

  • FrontControllerTest: 8 new feature tests (featured, sites, stream, video, sitemap, robots)

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🔧 Configuration change
  • 📦 Dependency update
  • 🧹 Code cleanup/refactor
  • 📝 Documentation
  • 🔥 Breaking change

Testing

  • Local development environment
  • CI/CD passes

PR Labels

Additional Notes

jsnmrs added 2 commits March 1, 2026 14:12
Un-skip database tests:
- NewsModelsTest: 11 skips → 2 (getSite, getSites, getSitesRecent, streamPage, getStreamPageTotal, updateFeed now exercised)
- AggroControllerTest: 15 skips → 0 (all controller methods now tested via CLI gate_check bypass)
- FrontControllerUnitTest: 7 skips → 0 (about, sites, video endpoints now tested)
- YoutubeModelsTest: 7 skips → 4 (getDuration tests now use mocked UtilityModels)

New test files:
- ValidationServiceTest (26 tests): sanitizeSlug, validateVideoId, validateGateKey, sanitizeInt
- SentryLogHandlerTest (17 tests): canHandle, mapLogLevelToSentry, cleanErrorMessage, handle
- StorageConfigTest (7 tests): thumbnail paths, cleanup/archive age, default values

Improve existing tests:
- ThumbnailServiceTest: 13 skips → 0 (private methods tested via reflection + temp files)
- FeedControllerTest: 3 skips → 0 (switched to ServiceTestCase for news_feeds table)
- AggroHelperTest: safe_file_write invalid path, csrf_action_form, file round-trip tests
- ViewHelperTest: 3 skips → 0 (invalid date/timezone exception tests, edge cases)
- SecurityFilterTest: 3 new after() method tests for security headers

Feature tests:
- FrontControllerTest: 8 new feature tests (featured, sites, stream, video, sitemap, robots)

Results: 523 tests (+59), 913 assertions (+172), 33 skips (was 86)
@jsnmrs jsnmrs added the patch label Mar 1, 2026
@jsnmrs jsnmrs merged commit cb6e82c into main Mar 1, 2026
2 checks passed
@jsnmrs jsnmrs deleted the increase-test-coverage branch March 1, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant