Skip to content
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

[keyvault] fix test recording sanitizers #22911

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

gracewilcox
Copy link
Member

@gracewilcox gracewilcox commented May 16, 2024

#22869

Fixing tests to be compatible in playback mode with the new test sanitizers

@gracewilcox gracewilcox marked this pull request as ready for review May 30, 2024 16:09
require.NotNil(t, roleDefinition.Type)

if *roleDefinition.ID == *updatedDefinition.ID {
updatedDefinitionCount++
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 it would be nice to cover the pager in playback and you could do that if ID weren't sanitized, or you didn't assert on updatedDefinitionCount in playback. Either works but I'd probably disable the sanitizer because this ID isn't secret, then double check that there isn't some other ID which is secret.

@@ -48,7 +45,13 @@ func TestRoleDefinition(t *testing.T) {
// test create definition
createdDefinition, err := client.CreateOrUpdateRoleDefinition(context.Background(), scope, name, parameters, nil)
require.NoError(t, err)
require.Equal(t, name, *createdDefinition.Name)

if recording.GetRecordMode() == recording.PlaybackMode {
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest either removing the name sanitizer (should be this one, names in these tests aren't secret) or asserting only in recording & live modes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants