Skip to content

Add test recordings for Az.Relationships module#29460

Merged
VeryEarly merged 2 commits into
Azure:mainfrom
meghanagupta95:meghana/updatetests-relationships
Apr 28, 2026
Merged

Add test recordings for Az.Relationships module#29460
VeryEarly merged 2 commits into
Azure:mainfrom
meghanagupta95:meghana/updatetests-relationships

Conversation

@meghanagupta95

Copy link
Copy Markdown
Member

Description

Add recorded test cases for all Az.Relationships cmdlets.

24 tests recorded covering DependencyOf and ServiceGroupMember relationship CRUD operations:

  • Get-AzRelationshipsDependencyOfRelationship (Get, GetViaIdentity)
  • Get-AzRelationshipsServiceGroupMemberRelationship (Get, GetViaIdentity)
  • New-AzRelationshipsDependencyOfRelationship (CreateExpanded, Subscription, ServiceGroup target, JSON, error cases)
  • New-AzRelationshipsServiceGroupMemberRelationship (CreateExpanded, Subscription, JSON, JsonFile, error cases)
  • Remove-AzRelationshipsDependencyOfRelationship (Delete, DeleteViaIdentity)
  • Remove-AzRelationshipsServiceGroupMemberRelationship (Delete, DeleteViaIdentity)
  • Update-AzRelationshipsDependencyOfRelationship (UpdateExpanded, UpdateViaIdentity)
  • Update-AzRelationshipsServiceGroupMemberRelationship (UpdateExpanded, UpdateViaIdentity)

Tests use parent service group /providers/Microsoft.Management/serviceGroups/SDKTestsSG for all relationship operations.

Files Changed

  • 8 new .Recording.json files for playback test support
  • Updated env.json with test environment variables
  • Updated ChangeLog.md

Record all 24 test cases for DependencyOf and ServiceGroupMember
relationship cmdlets (Get, New, Remove, Update) using Record mode
against live Azure services with parent service group SDKTestsSG.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 27, 2026 14:41
@azure-client-tools-bot-prd

Copy link
Copy Markdown
Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds recorded playback assets to support automated tests for the Az.Relationships module cmdlets.

Changes:

  • Added multiple .Recording.json files covering CRUD operations for DependencyOf and ServiceGroupMember relationships.
  • Updated test env.json with concrete IDs/names used by the recordings.
  • Updated module ChangeLog.md to note the addition of test recordings.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/Relationships/Relationships/ChangeLog.md Documents the addition of test recordings in the upcoming release notes.
src/Relationships/Relationships.Autorest/test/env.json Defines test variables/IDs referenced by the recordings.
src/Relationships/Relationships.Autorest/test/Update-AzRelationshipsServiceGroupMemberRelationship.Recording.json Adds playback recordings for update scenarios (expanded + via identity).
src/Relationships/Relationships.Autorest/test/Update-AzRelationshipsDependencyOfRelationship.Recording.json Adds playback recordings for dependency relationship update scenarios.
src/Relationships/Relationships.Autorest/test/Remove-AzRelationshipsServiceGroupMemberRelationship.Recording.json Adds playback recordings for delete scenarios (expanded + via identity).
src/Relationships/Relationships.Autorest/test/Remove-AzRelationshipsDependencyOfRelationship.Recording.json Adds playback recordings for dependency relationship delete scenarios.
src/Relationships/Relationships.Autorest/test/New-AzRelationshipsDependencyOfRelationship.Recording.json Adds playback recordings for create scenarios (multiple parameter sets + error case).
src/Relationships/Relationships.Autorest/test/Get-AzRelationshipsServiceGroupMemberRelationship.Recording.json Adds playback recordings for get scenarios (by name + via identity).
src/Relationships/Relationships.Autorest/test/Get-AzRelationshipsDependencyOfRelationship.Recording.json Adds playback recordings for get scenarios (by name + via identity).

Comment on lines +2 to +6
"SgmRelNameForNewSub": "sgmrelsubodg1kq",
"SgmRelNameToDelete": "sgmreldelodg1kq",
"SgmRelNameForNewJson": "sgmreljsonodg1kq",
"SgmTargetId": "/providers/Microsoft.Management/serviceGroups/SDKTestsSG",
"DepResourceGroupResourceUri": "/subscriptions/453e692a-e16d-441c-bce6-10753115561d/resourceGroups/rg-rel-dep-odg1kq",

Copilot AI Apr 27, 2026

Copy link

Choose a reason for hiding this comment

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

Hardcoding real subscription/tenant GUIDs and fully-qualified resource URIs in env.json can unintentionally publish environment-specific identifiers and makes playback brittle outside this exact environment. Prefer keeping SubscriptionId / Tenant empty (or using repository-standard variable placeholders) and populating them via CI/test harness at runtime; likewise consider storing only short names (RG name, relationship name) and composing full resource IDs in the test setup.

Copilot uses AI. Check for mistakes.
"SgmRelNameToDelete": "",
"SgmRelNameToDeleteViaIdentity": ""
"SgmRelNameToUpdate": "sgmreluptodg1kq",
"SubscriptionId": "453e692a-e16d-441c-bce6-10753115561d",

Copilot AI Apr 27, 2026

Copy link

Choose a reason for hiding this comment

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

Hardcoding real subscription/tenant GUIDs and fully-qualified resource URIs in env.json can unintentionally publish environment-specific identifiers and makes playback brittle outside this exact environment. Prefer keeping SubscriptionId / Tenant empty (or using repository-standard variable placeholders) and populating them via CI/test harness at runtime; likewise consider storing only short names (RG name, relationship name) and composing full resource IDs in the test setup.

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +32
"SubscriptionResourceUri": "/subscriptions/453e692a-e16d-441c-bce6-10753115561d",
"Tenant": "72f988bf-86f1-41af-91ab-2d7cd011db47",
"SgmResourceGroupResourceUri": "/subscriptions/453e692a-e16d-441c-bce6-10753115561d/resourceGroups/rg-rel-sgm-odg1kq"

Copilot AI Apr 27, 2026

Copy link

Choose a reason for hiding this comment

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

Hardcoding real subscription/tenant GUIDs and fully-qualified resource URIs in env.json can unintentionally publish environment-specific identifiers and makes playback brittle outside this exact environment. Prefer keeping SubscriptionId / Tenant empty (or using repository-standard variable placeholders) and populating them via CI/test harness at runtime; likewise consider storing only short names (RG name, relationship name) and composing full resource IDs in the test setup.

Copilot uses AI. Check for mistakes.
"x-ba-restapi": [ "3.2026.0404.1" ],
"x-ms-request-id": [ "westus2:5514a57d-4db7-4691-a47f-3cb197541758" ],
"mise-correlation-id": [ "1b7980da-fe08-42c5-a44f-fe7c6df1c4fd" ],
"x-ms-operation-identifier": [ "tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=2c4638e2-9343-4565-be89-cbdad9762f57/westus2/83d0da14-342f-4ac0-9ecb-7941eff6b9ba" ],

Copilot AI Apr 27, 2026

Copy link

Choose a reason for hiding this comment

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

The recordings include unsanitized identifiers (tenantId, objectId, subscriptionId, targetTenant, etc.) in headers and payloads. This increases the risk of leaking internal identifiers and can also reduce reusability of recordings across environments. Add/extend test-proxy sanitizers (or the repo’s equivalent recording sanitization rules) to replace these values with deterministic placeholders and re-record so the committed playback assets do not contain real GUIDs.

Copilot uses AI. Check for mistakes.
"Content-Type": [ "application/json; charset=utf-8" ],
"Expires": [ "-1" ]
},
"Content": "{\"properties\":{\"targetId\":\"/providers/Microsoft.Management/serviceGroups/SDKTestsSG\",\"sourceId\":\"/subscriptions/453e692a-e16d-441c-bce6-10753115561d/resourceGroups/rg-rel-sgm-odg1kq\",\"targetTenant\":\"72f988bf-86f1-41af-91ab-2d7cd011db47\",\"metadata\":{\"sourceType\":\"Microsoft.Resources/subscriptions/resourceGroups\",\"targetType\":\"Microsoft.Management/serviceGroups\"},\"originInformation\":{\"relationshipOriginType\":\"UserExplicitlyCreated\"},\"provisioningState\":\"Succeeded\"},\"id\":\"/subscriptions/453e692a-e16d-441c-bce6-10753115561d/resourceGroups/rg-rel-sgm-odg1kq/providers/Microsoft.Relationships/serviceGroupMember/sgmreluptodg1kq\",\"name\":\"sgmreluptodg1kq\",\"type\":\"Microsoft.Relationships/serviceGroupMember\"}",

Copilot AI Apr 27, 2026

Copy link

Choose a reason for hiding this comment

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

The recordings include unsanitized identifiers (tenantId, objectId, subscriptionId, targetTenant, etc.) in headers and payloads. This increases the risk of leaking internal identifiers and can also reduce reusability of recordings across environments. Add/extend test-proxy sanitizers (or the repo’s equivalent recording sanitization rules) to replace these values with deterministic placeholders and re-record so the committed playback assets do not contain real GUIDs.

Copilot uses AI. Check for mistakes.
@VeryEarly

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines successfully started running 3 pipeline(s).

@VeryEarly

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines successfully started running 3 pipeline(s).

@VeryEarly VeryEarly merged commit 4735ce0 into Azure:main Apr 28, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants