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 File, Group, APIKey, AuditLogs, and ConnectionLogs tests to mocked db#19299

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
Emyrk merged 7 commits intomainfromhugodutka/dbauthz-mock-1
Aug 13, 2025

Conversation

@hugodutka
Copy link
Contributor

…with dbmock and gofakeit\n- Add expectations for GetFileByHashAndCreator, GetFileByID, GetFileIDByTemplateVersionID, InsertFile\n- Seed data with testutil.Fake\n\nRefs:coder/internal#869\nCo-authored-by: hugodutka <28019628+hugodutka@users.noreply.github.com>
@hugodutkahugodutka changed the titlechore(coderd/database/dbauthz): migrate File, Group, APIKey, AuditLogs, and ConnectionLogs to mocked dbchore(coderd/database/dbauthz): migrate File, Group, APIKey, AuditLogs, and ConnectionLogs tests to mocked dbAug 11, 2025
@hugodutkahugodutka requested a review fromEmyrkAugust 11, 2025 17:53
…ubtests to s.Mocked\n- Seed data with testutil.Fake and gofakeit\n- Add gomock expectations for Group methods\n\nCo-authored-by: hugodutka <28019628+hugodutka@users.noreply.github.com>
… API key subtests to s.Mocked\n- Add gomock expectations for API key and external auth link methods\n\nCo-authored-by: hugodutka <28019628+hugodutka@users.noreply.github.com>
…logs tests to s.Mocked\n- Add gomock expectations for authorized and non-authorized code paths\n\nCo-authored-by: hugodutka <28019628+hugodutka@users.noreply.github.com>
…onnection log tests to s.Mocked\n- Add gomock expectations (authorized and non-authorized paths)\n\nCo-authored-by: hugodutka <28019628+hugodutka@users.noreply.github.com>
@hugodutkahugodutkaforce-pushed thehugodutka/dbauthz-mock-1 branch from48918d5 to1ff8f54CompareAugust 11, 2025 17:56
params:= database.GetGroupsParams{OrganizationID:g.OrganizationID,HasMemberID:gm.UserID}
row:= database.GetGroupsRow{Group:g,OrganizationName:o.Name,OrganizationDisplayName:o.DisplayName}
dbm.EXPECT().GetGroups(gomock.Any(),params).Return([]database.GetGroupsRow{row},nil).AnyTimes()
check.Args(params).Asserts(rbac.ResourceSystem,policy.ActionRead,g,policy.ActionRead).FailSystemObjectChecks()
Copy link
Member

Choose a reason for hiding this comment

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

FailSystemObjectChecks TIL!

@EmyrkEmyrk merged commite10f29c intomainAug 13, 2025
26 checks passed
@EmyrkEmyrk deleted the hugodutka/dbauthz-mock-1 branchAugust 13, 2025 14:30
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 13, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@EmyrkEmyrkEmyrk approved these changes

Assignees

@hugodutkahugodutka

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@hugodutka@Emyrk

[8]ページ先頭

©2009-2025 Movatter.jp