Skip to content

[azadmin] add fakes support #24769

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

Merged
merged 3 commits into from
Jun 12, 2025
Merged

Conversation

gracewilcox
Copy link
Member

Part of #23355

@gracewilcox gracewilcox added KeyVault Client This issue points to a problem in the data-plane of the library. labels Jun 10, 2025
@gracewilcox gracewilcox marked this pull request as ready for review June 10, 2025 23:08
@Copilot Copilot AI review requested due to automatic review settings June 10, 2025 23:08
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds support for fake servers and comprehensive tests for both the RBAC and BackupRestore clients, along with necessary client changes to enable request dispatch via context.

  • Introduces fake.Server implementations and tests in rbac/fake and backup/fake packages
  • Updates client methods to set runtime.CtxAPINameKey for dispatch in test transports
  • Bumps dependencies, tooling (goimports), emitter versions, and adjusts coverage goals

Reviewed Changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
sdk/security/keyvault/azadmin/rbac/fake/server_test.go New RBAC fake server tests for Create/Get/Delete operations
sdk/security/keyvault/azadmin/rbac/fake/internal.go Generic tracker and utility functions for fake servers
sdk/security/keyvault/azadmin/rbac/client.go Client methods updated to use CtxAPINameKey in context for spans
sdk/security/keyvault/azadmin/backup/fake/server.go New Backup fake server with poller dispatch logic
sdk/security/keyvault/azadmin/backup/fake/internal.go Shared tracker implementation for backup fake server transport
Comments suppressed due to low confidence (2)

sdk/security/keyvault/azadmin/rbac/fake/server_test.go:20

  • [nitpick] The variable name is too generic and conflicts with builtins; consider renaming to testName or roleName for clarity.
name      = "name"

sdk/security/keyvault/azadmin/backup/fake/internal.go:36

  • Consider adding unit tests for newTracker, get, add, and remove methods to verify correct tracking behavior and thread safety under concurrent requests.
func newTracker[T any]() *tracker[T] {

@github-project-automation github-project-automation bot moved this from Untriaged to In Progress in Azure SDK for Key Vault Jun 12, 2025
@gracewilcox gracewilcox merged commit ea96f56 into Azure:main Jun 12, 2025
11 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Azure SDK for Key Vault Jun 12, 2025
@gracewilcox gracewilcox deleted the kv-fakes-admin branch June 12, 2025 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. KeyVault
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants