Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated tests for changes in PR Azure/azure-rest-api-specs#18609 (#28063
Browse files Browse the repository at this point in the history
)

* Generated SDK

* added tests, playback recordings for VM and VMSS application profile

(cherry picked from commit c08e89b426bb6dd41b9a37ecb3d42ad172509f89)

* Fixed and re-recoded galley application and gallery application version tests

* Added changes that were created by SDK generation for dedicated HostGroup, but unrelated to my Swagger changes

* added changes to SdkInfo_ComputeManagementClient.cs and compute_resource-management.txt file that were created by SDK generation.

* Undid changes to eng/mgmt/mgmtmetadata/compute_resource-manager.txt

* Undid changes to sdk\compute\Microsoft.Azure.Management.Compute\src\Generated\SdkInfo_ComputeManagementClient.cs

* Re-created the SDK withhout changes to gallery.json and undid changes to test.

* Added test recordings for VM and VMSS application profile.

* remove changes from tests that were not re-recorded

Co-authored-by: Theodore Chang <thchan@microsoft.com>
D1v38om83r and grizzlytheodore committed May 10, 2022
1 parent 0303743 commit 1165698
Showing 7 changed files with 7,438 additions and 1,332 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ public void VMApplicationProfile_Tests()
// when re-recording the test ensure that you use a valid packageReferenceId
// refer to https://microsoft.sharepoint.com/:w:/t/ComputeVM/EcYeD-HHrLZHpYyxo3iRCtkB-VeO8BuWE4dq4hoX9tlzEg?e=nOTgTu
// for how to create a valid VMApplication
new VMGalleryApplication("/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/bhbrahma/providers/Microsoft.Compute/galleries/bhbrahmaGallery/applications/go/versions/1.15.8")
new VMGalleryApplication("/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/bhbrahma/providers/Microsoft.Compute/galleries/bhbrahmaGallery/applications/go/versions/1.15.8", treatFailureAsDeploymentFailure: true, enableAutomaticUpgrade: true)
};

var vm1 = CreateVM(rgName, asName, storageAccountOutput, imageRef, out inputVM, (vm) =>
@@ -57,6 +57,9 @@ public void VMApplicationProfile_Tests()
Assert.NotNull(getVMResponse.ApplicationProfile);
Assert.NotNull(getVMResponse.ApplicationProfile.GalleryApplications);
Assert.Equal(1, getVMResponse.ApplicationProfile.GalleryApplications.Count);
VMGalleryApplication vmGalleryApplication = getVMResponse.ApplicationProfile.GalleryApplications[0];
Assert.True(vmGalleryApplication.TreatFailureAsDeploymentFailure);
Assert.True(vmGalleryApplication.EnableAutomaticUpgrade);
}
finally
{

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -147,7 +147,7 @@ public void TestVMScaleSetApplicationProfile()
{
// for recording the test ensure that a real galley application version exists at the location
// creating a gallery application version is beyond the sope of this test
new VMGalleryApplication("/subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/resourceGroups/bhbrahma/providers/Microsoft.Compute/galleries/bhbrahmaGallery/applications/go/versions/1.15.8")
new VMGalleryApplication("/subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/resourceGroups/bhbrahma/providers/Microsoft.Compute/galleries/bhbrahmaGallery/applications/go/versions/1.15.8", treatFailureAsDeploymentFailure: true, enableAutomaticUpgrade: true)
};

VirtualMachineScaleSet inputVMScaleSet;
@@ -172,6 +172,9 @@ public void TestVMScaleSetApplicationProfile()
Assert.NotNull(response.VirtualMachineProfile.ApplicationProfile);
Assert.NotNull(response.VirtualMachineProfile.ApplicationProfile.GalleryApplications);
Assert.Equal(1, response.VirtualMachineProfile.ApplicationProfile.GalleryApplications.Count);
VMGalleryApplication vmGalleryApplication = response.VirtualMachineProfile.ApplicationProfile.GalleryApplications[0];
Assert.True(vmGalleryApplication.TreatFailureAsDeploymentFailure);
Assert.True(vmGalleryApplication.EnableAutomaticUpgrade);
}
finally
{

0 comments on commit 1165698

Please sign in to comment.