discourse/spec/support
Ted Johansson d446cc7318
FIX: Fix scheduled targeted problem checks (#35696)
Scheduled problem checks with multiple targets are not honouring the
`run_every` configuration.

For checks with multiple targets, all targets are checked in a single
instance of the problem check. However, we have one problem check
tracker per target.

This mismatch results in the `#ready_to_run?` method always creating a
tracker with no target when being checked.

This commit fixes that by:

**Expect checks to operate on a single target.**

This change makes it so that instances of a `ProblemCheck` class are
initialized with a target. So instead of 1-N we now have an N-N
relationship between checks and trackers.

Each instance can access their `target` through an attribute of the same
name.

This also means problem checks are back to returning a singular
`Problem` or `nil`, instead of `[Problem]` or `[]`.

For scheduled checks, this means that `ScheduleProblemChecks` now
enqueues `N` jobs (where `N` is the number of targets) per check instead
of `1` job per check.

**Update existing targeted checks to operate on a single target.**

This is essentially just removing the loop inside the check.
2025-11-10 10:09:14 +08:00
..
locales DEV: Upgrade Rails to version 7.1 2024-07-04 10:58:21 +02:00
shared_examples FEATURE: Themeable site settings (#32233) 2025-07-16 11:00:21 +10:00
backups_helpers.rb DEV: Add backup helpers for specs (#28394) 2024-08-16 14:51:57 +10:00
bookmarkable_helper.rb DEV: Change Bookmarkable registration to DiscoursePluginRegistry (#20556) 2023-03-08 10:39:12 +10:00
concurrency.rb DEV: Fix various rubocop lints (#24749) 2023-12-06 23:25:00 +01:00
diagnostics_helper.rb DEV: track client ids published to message bus (#32878) 2025-05-23 14:23:50 +10:00
discourse_connect_support_helpers.rb DEV: Improvements to DiscourseConnect spec helpers (#35173) 2025-10-03 14:53:56 +01:00
discourse_event_helper.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
dom_matcher.rb DEV: Update minitest to 5.19.0 (#22821) 2023-07-27 12:18:40 +02:00
fake_bookmark_hashtag_data_source.rb DEV: Introduce enabled? API to hashtag data sources (#22632) 2023-07-18 09:39:01 +10:00
fake_logger.rb DEV: Upgrade Rails to version 7.1 2024-07-04 10:58:21 +02:00
fake_s3.rb DEV: Bump aws-sdk-core in prep for aws-sdk-mediaconvert (#33250) 2025-06-20 16:41:01 -06:00
fast_image_helpers.rb
final_destination_helper.rb Revert "DEV: Allow webmock to intercept FinalDestination::HTTP requests (#20575)" (#20576) 2023-03-08 11:26:32 +08:00
helpers.rb FEATURE: Upcoming changes part 1 (#34617) 2025-10-30 10:46:14 +10:00
i18n_helpers.rb DEV: Upgrade Rails to version 7.1 2024-07-04 10:58:21 +02:00
imap_helper.rb DEV: lint against Layout/EmptyLineBetweenDefs (#24914) 2023-12-15 23:46:04 +08:00
integration_helpers.rb DEV: Finish renaming secure_session to server_session 2025-09-23 10:35:02 +02:00
match_html_matcher.rb DEV: Remove invalid parsing options (#30545) 2025-01-03 13:17:49 +01:00
mock_git_importer.rb SECURITY: Expand and improve SSRF Protections (#18815) 2022-11-01 16:33:17 +00:00
negated_matcher.rb DEV: Don’t use change { … }.by(0) in specs 2022-07-26 10:34:15 +02:00
omniauth_helpers.rb DEV: More system specs for signup/login (#27150) 2024-05-23 10:01:05 -03:00
onebox_helpers.rb DEV: Introduce core features system specs for plugins 2025-03-27 12:12:01 +01:00
problem_check_matcher.rb FIX: Fix scheduled targeted problem checks (#35696) 2025-11-10 10:09:14 +08:00
rate_limit_matcher.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
sample_plugin_site_settings.yml FEATURE: Upcoming changes part 1 (#34617) 2025-10-30 10:46:14 +10:00
service_matchers.rb DEV: Display better output when inspecting service steps 2024-12-12 15:21:10 +01:00
sidekiq_helpers.rb FIX: send email to normalized email owner when hiding emails (#23524) 2023-09-12 11:06:35 +10:00
site_settings_helpers.rb DEV: Avoid leaking new site setting states in test environment (#21713) 2023-05-25 07:53:57 +08:00
system_helpers.rb UX: close lightbox on backdrop tap on mobile (#35571) 2025-10-27 10:23:16 +04:00
test_second_factor_action.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
time_matcher.rb DEV: support nil values in the eq_time matcher (#22116) 2023-06-20 19:06:40 +04:00
topic_guardian_can_see_consistency_check.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
ts_vector_matcher.rb FIX: domain searches not working properly for URLs (#20136) 2023-02-03 09:55:28 +11:00
uploads_helpers.rb DEV: Refactor test-specific setting overrides into rails_helper.rb (#35594) 2025-10-27 10:14:56 +00:00
webauthn_integration_helpers.rb DEV: Refactor webauthn to support passkeys (1/3) (#23586) 2023-10-03 14:59:28 -04:00