Skip to content

chore(coderd/database/dbauthz): migrate the Notifications and Prebuilds tests to use mocked DB #19302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: hugodutka/dbauthz-mock-3
Choose a base branch
from

Conversation

hugodutka
Copy link
Contributor

Related to coder/internal#869

@hugodutka hugodutka changed the title chore(coderd/database/dbauthz): migrate TestNotifications and TestPrebuilds to use mocked DB chore(coderd/database/dbauthz): migrate the Notifications and Prebuilds tests to use mocked DB Aug 11, 2025
@hugodutka hugodutka requested a review from Emyrk August 11, 2025 18:35
- Replace Subtest with Mocked and set gomock expectations
- Use testutil.Fake + gofakeit to generate data
- Add necessary GetInboxNotificationByID expectation for read-status updates
- Keeps RBAC assertions identical; suite passes locally with GOCACHE
- Replace Subtest with Mocked and add gomock expectations
- Mock underlying calls used by querier (e.g., GetTemplateVersionByID, GetPresetByID, GetTemplateByID)
- Preserve RBAC assertions and expected returns/errors
- Verified by running TestMethodTestSuite/TestPrebuilds locally with GOCACHE
@hugodutka hugodutka force-pushed the hugodutka/dbauthz-mock-4 branch from c20f829 to 78eafa2 Compare August 14, 2025 08:24
@hugodutka hugodutka force-pushed the hugodutka/dbauthz-mock-3 branch from bf65b40 to 31de126 Compare August 14, 2025 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant