Repository navigation
test: guard dashboard query cost and host-less workshops - #3072
Merged
Merged
Conversation
The host assertions added in #3066 only checked the resolved sponsor, so dropping the preload in DashboardQuery would restore a per-card query and leave the suite green. Count SQL statements while reading the attributes a dashboard card renders for one and four cards, require a non-zero baseline, and pin the two host-less cases: only non-host sponsors resolves to nil, and no sponsor rows renders without breakage. Closes #3071
mroderick
force-pushed
the
3071-dashboard-query-specs
branch
from
November 2, 2026 12:20
0578ea3 to
3fa3586
Compare
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.
The host assertions from #3066 cannot catch a regression: dropping
preload(workshop_host: :sponsor)leaves them green while restoring a per-card query on the dashboard. They also say nothing about workshops with no host. This PR closes both gaps inspec/queries/dashboard_query_spec.rb.Summary
hostfor one and four dashboard cards and requires the same SQL statement count. Removing the preload now fails it.hostto nil.hostto nil.Review notes
Focus on both guards.
sql.active_recordevents, excluding schema and transaction statements, and compares one workshop against four (the query caps at 10).workshop_no_sponsorbecause a physical workshop normally requires a host. Check that the fixtures match how real sponsor-less workshops are created.I deliberately left the events request-level guards alone; they already cover the
/events/upcomingrender path.