Skip to content

Commit 04532d2

Browse files
committed
Remove unneeded tests.
TestUpdateElasticPoolAdvisor fails because the underlying service feature has been disabled. TestElasticPoolMetricGet does not have any coverage of AzureRM.Sql cmdlets, it is intented to be testing metrics cmdlets.
1 parent f9376e6 commit 04532d2

File tree

7 files changed

+1
-12380
lines changed

7 files changed

+1
-12380
lines changed

src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.csproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,6 @@
421421
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.AdvisorTests\TestUpdateDatabaseAdvisor.json">
422422
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
423423
</None>
424-
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.AdvisorTests\TestUpdateElasticPoolAdvisor.json">
425-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
426-
</None>
427424
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.AdvisorTests\TestUpdateServerAdvisor.json">
428425
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
429426
</None>
@@ -622,9 +619,6 @@
622619
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.ElasticPoolCrudTests\TestElasticPoolGet.json">
623620
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
624621
</None>
625-
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.ElasticPoolCrudTests\TestElasticPoolMetricGet.json">
626-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
627-
</None>
628622
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.ElasticPoolCrudTests\TestElasticPoolRemove.json">
629623
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
630624
</None>

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/AdvisorTests.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,6 @@ public void TestGetElasticPoolAdvisor()
113113
RunPowerShellTest("Test-GetElasticPoolAdvisor");
114114
}
115115

116-
[Fact(Skip = "Fails when run live due to HTTP 500 error on PATCH .../Microsoft.Sql/servers/{serverName}/elasticPools/{poolName}/advisors/CreateIndex?api-version=2015-05-01-preview")]
117-
[Trait(Category.AcceptanceType, Category.CheckIn)]
118-
public void TestUpdateElasticPoolAdvisor()
119-
{
120-
RunPowerShellTest("Test-UpdateElasticPoolAdvisor");
121-
}
122-
123116
#endregion
124117
}
125118
}

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/AdvisorTests.ps1

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -336,35 +336,6 @@ function Test-GetElasticPoolAdvisor
336336
}
337337
}
338338

339-
<#
340-
.SYNOPSIS
341-
Tests updating a elastic pool advisor
342-
#>
343-
function Test-UpdateElasticPoolAdvisor
344-
{
345-
# Setup
346-
$rg = Create-ResourceGroupForTest
347-
$ep = SetupElasticPool $rg
348-
349-
try
350-
{
351-
$response = Set-AzureRmSqlElasticPoolAdvisorAutoExecuteStatus `
352-
-ResourceGroupName $ep.ResourceGroupName `
353-
-ServerName $ep.ServerName `
354-
-ElasticPoolName $ep.ElasticPoolName `
355-
-AdvisorName CreateIndex `
356-
-AutoExecuteStatus Disabled
357-
Assert-NotNull $response
358-
ValidateElasticPool $response $ep
359-
ValidateAdvisorProperties $response
360-
}
361-
finally
362-
{
363-
# Cleanup
364-
Remove-ResourceGroupForTest $rg
365-
}
366-
}
367-
368339
<#
369340
.SYNOPSIS
370341
Setup Server for tests

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/ElasticPoolCrudTests.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using Microsoft.Azure.Commands.ScenarioTest.SqlTests;
16-
using Microsoft.Azure.ServiceManagemenet.Common.Models;
17-
using Microsoft.Azure.Test.HttpRecorder;
1816
using Microsoft.WindowsAzure.Commands.ScenarioTest;
19-
using Microsoft.WindowsAzure.Commands.Utilities.Common;
17+
using RestTestFramework = Microsoft.Rest.ClientRuntime.Azure.TestFramework;
2018
using Xunit;
2119
using Xunit.Abstractions;
2220

@@ -49,17 +47,6 @@ public void TestElasticPoolGet()
4947
RunPowerShellTest("Test-GetElasticPool");
5048
}
5149

52-
[Fact]
53-
[Trait(Category.AcceptanceType, Category.CheckIn)]
54-
public void TestElasticPoolMetricGet()
55-
{
56-
// Test cannot be re-recorded because it has hardcoded server name
57-
if (TestMockSupport.RunningMocked)
58-
{
59-
RunPowerShellTest("Test-GetElasticPoolMetric");
60-
}
61-
}
62-
6350
[Fact]
6451
[Trait(Category.AcceptanceType, Category.CheckIn)]
6552
public void TestElasticPoolRemove()

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/ElasticPoolCrudTests.ps1

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -146,33 +146,6 @@ function Test-GetElasticPool
146146
}
147147
}
148148

149-
<#
150-
.SYNOPSIS
151-
Tests getting an elastic pool metric
152-
#>
153-
function Test-GetElasticPoolMetric
154-
{
155-
# This test requires that an elastic pool has been created and has metrics ready
156-
# To prevent requiring putting something like a Sleep(10 minutes) in the code
157-
# this test requires the server/elastic pool be pre-created with metrics data available.
158-
159-
# Setup and retrieve the existing pool
160-
$rgName = "test-group"
161-
$serverName = "groupserver1"
162-
$elasticPoolName = "testpool2"
163-
164-
$ep1 = Get-AzureRmSqlElasticPool -ServerName $serverName -ResourceGroupName $rgName `
165-
-ElasticPoolName $elasticPoolName
166-
Assert-NotNull $ep1
167-
168-
# Get pool metrics with all values
169-
# Introducing breaking change that requires -MetricNames csv-list as parameter for this call (disabling this part of the test as done before)
170-
#$metrics = $ep1 | Get-AzureRmMetric -TimeGrain "0:5:0" -StartTime "2015-04-22T16:00:00Z" -EndTime "2015-04-22T17:00:00Z"
171-
#Assert-NotNull $metrics
172-
#Assert-True { $metrics.Count -gt 0 }
173-
}
174-
175-
176149
<#
177150
.SYNOPSIS
178151
Tests removing an elastic pool

0 commit comments

Comments
 (0)