Skip to content

Commit 3cf2e88

Browse files
committed
Add IncludeAllResources for remove cmdlet
1 parent 978b243 commit 3cf2e88

File tree

11 files changed

+351914
-72307
lines changed

11 files changed

+351914
-72307
lines changed

src/ResourceManager/MachineLearningCompute/Commands.MachineLearningCompute.Test/Commands.MachineLearningCompute.Test.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
6060
<Private>True</Private>
6161
</Reference>
62-
<Reference Include="Microsoft.Azure.Management.MachineLearningCompute, Version=0.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
63-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.MachineLearningCompute.0.2.0\lib\net452\Microsoft.Azure.Management.MachineLearningCompute.dll</HintPath>
62+
<Reference Include="Microsoft.Azure.Management.MachineLearningCompute, Version=0.3.0.0, Culture=neutral, processorArchitecture=MSIL">
63+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.MachineLearningCompute.0.3.0\lib\net452\Microsoft.Azure.Management.MachineLearningCompute.dll</HintPath>
6464
</Reference>
6565
<Reference Include="Microsoft.Azure.Management.ResourceManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6666
<HintPath>..\..\..\packages\Microsoft.Azure.Management.ResourceManager.1.6.0-preview\lib\net452\Microsoft.Azure.Management.ResourceManager.dll</HintPath>
@@ -173,6 +173,9 @@
173173
<None Include="SessionRecords\Microsoft.Azure.Commands.MachineLearningCompute.Test.ScenarioTests.MLCTests\TestNewGetRemove.json">
174174
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
175175
</None>
176+
<None Include="SessionRecords\Microsoft.Azure.Commands.MachineLearningCompute.Test.ScenarioTests.MLCTests\TestRemoveIncludeAllResources.json">
177+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
178+
</None>
176179
<None Include="SessionRecords\Microsoft.Azure.Commands.MachineLearningCompute.Test.ScenarioTests.MLCTests\TestSet.json">
177180
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
178181
</None>

src/ResourceManager/MachineLearningCompute/Commands.MachineLearningCompute.Test/ScenarioTests/MLCTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,12 @@ public void TestSet()
4343
{
4444
TestController.NewInstance.RunPsTest(this.interceptor, "Test-Set");
4545
}
46+
47+
[Fact]
48+
[Trait(Category.AcceptanceType, Category.CheckIn)]
49+
public void TestRemoveIncludeAllResources()
50+
{
51+
TestController.NewInstance.RunPsTest(this.interceptor, "Test-RemoveIncludeAllResources");
52+
}
4653
}
4754
}

src/ResourceManager/MachineLearningCompute/Commands.MachineLearningCompute.Test/ScenarioTests/MLCTests.ps1

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Creates a local operationalization cluster for use in tests.
3939
function GetDefaultLocalClusterProperties
4040
{
4141
$location = "East US 2 EUAP"
42-
$clusterType = "West Central US"
42+
$clusterType = "Local"
4343
$description = "Deployed from powershell"
4444

4545
$cluster = New-Object Microsoft.Azure.Management.MachineLearningCompute.Models.OperationalizationCluster `
@@ -302,4 +302,27 @@ function Test-Set
302302

303303
# Cleanup
304304
TeardownTest -ResourceGroupName $resourceGroupName
305-
}
305+
}
306+
307+
function Test-RemoveIncludeAllResources
308+
{
309+
$resourceGroupName = GetUniqueName("mlcrp-cmdlet-test-remove-all")
310+
$clusterName = GetUniqueName("mlcrp-cmdlet-test-remove-all")
311+
312+
SetupTest $resourceGroupName
313+
314+
# Create the cluster
315+
$cluster = GetDefaultLocalClusterProperties
316+
$createdCluster = New-AzureRmMlOpCluster -ResourceGroupName $resourceGroupName -Name $clusterName -Cluster $cluster
317+
318+
# Get the managed by resource group name before deleting
319+
$managedByResourceGroupName = GetManagedByResourceGroupName -ResourceGroupName $resourceGroupName
320+
321+
# Delete the cluster
322+
Remove-AzureRmMlOpCluster -ResourceGroupName $resourceGroupName -Name $clusterName -IncludeAllResources
323+
324+
Assert-Throws ( Get-AzureRmResourceGroup -ResourceGroupName $managedByResourceGroupName )
325+
326+
# Cleanup
327+
Remove-AzureRmResourceGroup -ResourceGroupName $resourceGroupName -Force
328+
}

src/ResourceManager/MachineLearningCompute/Commands.MachineLearningCompute.Test/SessionRecords/Microsoft.Azure.Commands.MachineLearningCompute.Test.ScenarioTests.MLCTests/TestNewGetRemove.json

Lines changed: 260011 additions & 72280 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)