Skip to content
Snippets Groups Projects

add database.DB interface to facilitate mocking out stores

Merged Warren Gifford requested to merge cc/database-interface into main

Created by: camdencheek

This adds the database.DB interface to facilitate mocking out the behavior of stores. The idea here is outlined in #26113. Essentially, rather than passing around dbutil.DB and wrapping it like database.Repos(db), we'd instead make Repos() a method on the database interface, allowing us to mock out its return value.

The lines changed is large, but the actually interesting changes are small. I've highlighted them with comments, and the commits in this PR are largely independent, but the change as a whole doesn't make much sense without hooking it up to anything, so this also includes changing a few tests to use the injected mocks instead of the global replacement mocks.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading