.vbw-planning/codebase/TESTING.md
SOURCE_MONITOR_TEST_WORKERS)test/test_helper.rb)COVERAGE env is set:test ActiveJob queue adapter by defaulttest/fixtures/test/vcr_cassettes/SourceMonitor.reset_configuration!test/test_prof.rb)TestProf::BeforeAll::Minitest for before_all blocks (shared expensive setup)SourceMonitor::TestProfSupport::SetupOnce -- setup_once alias for before_allSourceMonitor::TestProfSupport::InlineJobs -- with_inline_jobs helperTestProf::MinitestSample -- SAMPLE/SAMPLE_GROUPS env var support for focused runscreate_source!(attributes = {}) -- factory method for creating test sourceswith_queue_adapter(adapter) -- temporarily switch ActiveJob adapter| Category | File Count | Path | Purpose |
|---|---|---|---|
| Unit (lib) | ~75 | test/lib/source_monitor/ | Lib module tests |
| Model | ~10 | test/models/source_monitor/ | Model validation, scopes, behavior |
| System | 6 | test/system/ | Browser-driven end-to-end tests |
| Integration | 4 | test/integration/ | Engine mounting, navigation, packaging |
| Example | 4 | test/examples/ | Template and adapter examples |
| Task | 2 | test/tasks/ | Rake task tests |
| Mailer | 1 | test/mailers/ | Application mailer test |
| Module | 1 | test/source_monitor_test.rb | Top-level module tests |
Total: ~124 test files
Tests mirror the source directory structure:
test/lib/source_monitor/
configuration_test.rb
feedjira_configuration_test.rb
instrumentation_test.rb
health/
health_module_test.rb
source_health_check_test.rb
source_health_monitor_test.rb
source_health_reset_test.rb
pagination/
paginator_test.rb
scraping/
bulk_result_presenter_test.rb
bulk_source_scraper_test.rb
enqueuer_test.rb
item_scraper_test.rb
item_scraper/
adapter_resolver_test.rb
persistence_test.rb
scheduler_test.rb
state_test.rb
setup/
bundle_installer_test.rb
cli_test.rb
dependency_checker_test.rb
detectors_test.rb
gemfile_editor_test.rb
initializer_patcher_test.rb
install_generator_test.rb
migration_installer_test.rb
node_installer_test.rb
prompter_test.rb
requirements_test.rb
workflow_test.rb
verification/
action_cable_verifier_test.rb
printer_test.rb
runner_test.rb
solid_queue_verifier_test.rb
telemetry_logger_test.rb
turbo_streams/
stream_responder_test.rb
release/
runner_test.rb
test/dummy/)Full Rails application used as the host app for testing:
config/database.yml)config/solid_queue.yml, config/queue.yml)config/cable.yml)SourceMonitor::SponsoredSource (tests model extensions)DummySourceMonitor::SourceExtensionsUser model for testing authenticationnpm run build)bin/test-coverage)bin/check-diff-coverage)test/integration/release_packaging_test.rb specificallycron: "30 6 * * *")sql.active_recordbin/check-test-prof-metrics)refuse_coverage_drop :line prevents regressionsconfig/coverage_baseline.json (lists uncovered lines per file)SOURCE_MONITOR_SKIP_COVERAGE env var to disable coverage collection# :nocov: annotations used for defensive/fallback code pathsSourceMonitor.reset_configuration! in setup:test adapter; with_inline_jobs for synchronous executionSecureRandom.hex for unique fixturescreate_source! with save!(validate: false) for flexible test databin/check-setup-tests ensures all setup files have corresponding tests