Skip to content

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
@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
- 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-3 branch from 31de126 to 3dd08e2 Compare August 20, 2025 15:02
@hugodutka hugodutka force-pushed the hugodutka/dbauthz-mock-4 branch from 78eafa2 to 4dfcb32 Compare August 20, 2025 15:02
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