Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore(coderd/database/dbauthz): migrate TestSystemFunctions to mocked DB#19301

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
hugodutka merged 5 commits intomainfromhugodutka/dbauthz-mock-3
Aug 29, 2025

Conversation

hugodutka
Copy link
Contributor

@hugodutkahugodutka requested a review fromEmyrkAugust 11, 2025 18:35
@hugodutkahugodutkaforce-pushed thehugodutka/dbauthz-mock-2 branch fromb615cb1 tod5f03c2CompareAugust 14, 2025 08:24
@hugodutkahugodutkaforce-pushed thehugodutka/dbauthz-mock-3 branch frombf65b40 to31de126CompareAugust 14, 2025 08:24
Base automatically changed fromhugodutka/dbauthz-mock-2 tomainAugust 20, 2025 14:10
@hugodutkahugodutkaforce-pushed thehugodutka/dbauthz-mock-3 branch from31de126 to3dd08e2CompareAugust 20, 2025 15:02
@dannykoppingdannykopping requested review fromdannykopping and removed request forEmyrkAugust 27, 2025 13:09
dbm.EXPECT().GetProvisionerJobByID(gomock.Any(),j.ID).Return(j,nil).AnyTimes()
dbm.EXPECT().GetWorkspaceBuildByJobID(gomock.Any(),j.ID).Return(b,nil).AnyTimes()
dbm.EXPECT().GetWorkspaceByID(gomock.Any(),b.WorkspaceID).Return(ws,nil).AnyTimes()
dbm.EXPECT().GetProvisionerJobTimingsByJobID(gomock.Any(),j.ID).Return([]database.ProvisionerJobTiming{},nil).AnyTimes()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This doesn't return any of the objects which the test is purporting to validate.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Seems like it's not needed since we use the job to authz the call 👍

hugodutkaand others added4 commitsAugust 29, 2025 10:16
- Convert many System functions to s.Mocked with gomock- Add expectations for read/update/create/delete system paths- Fix UpdateWorkspaceBuildCostByID expectation (returns error)
- Migrate AcquireProvisionerJob and ProvisionerJob update helpers- Convert InsertWorkspaceAgent/UpsertWorkspaceApp and related to s.Mocked- Keep RBAC assertions consistent
Signed-off-by: Danny Kopping <danny@coder.com>
Copy link
Contributor

@dannykoppingdannykopping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

dbm.EXPECT().GetProvisionerJobByID(gomock.Any(),j.ID).Return(j,nil).AnyTimes()
dbm.EXPECT().GetWorkspaceBuildByJobID(gomock.Any(),j.ID).Return(b,nil).AnyTimes()
dbm.EXPECT().GetWorkspaceByID(gomock.Any(),b.WorkspaceID).Return(ws,nil).AnyTimes()
dbm.EXPECT().GetProvisionerJobTimingsByJobID(gomock.Any(),j.ID).Return([]database.ProvisionerJobTiming{},nil).AnyTimes()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Seems like it's not needed since we use the job to authz the call 👍

@hugodutkahugodutka merged commit7365da1 intomainAug 29, 2025
25 of 26 checks passed
@hugodutkahugodutka deleted the hugodutka/dbauthz-mock-3 branchAugust 29, 2025 09:04
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 29, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@dannykoppingdannykoppingdannykopping approved these changes

Assignees

@hugodutkahugodutka

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@hugodutka@dannykopping

[8]ページ先頭

©2009-2025 Movatter.jp