Skip to content

Commit 73b6e72

Browse files
committed
Merge pull request #5 from hyonholee/dev
jenkins test
2 parents 64a9488 + e536f87 commit 73b6e72

File tree

6 files changed

+90
-52
lines changed

6 files changed

+90
-52
lines changed

AzurePowershell.Test.targets

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<HDInsightTestDebug>.\src\ServiceManagement\HDInsight\Commands.HDInsight.Test\bin\Debug\Microsoft.WindowsAzure.Commands.HDInsight.Test.dll</HDInsightTestDebug>
2323
<StorageTestDebug>.\src\ServiceManagement\Storage\Commands.Storage.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Storage.Test.dll</StorageTestDebug>
2424
<KeyVaultTestDebug>.\src\ResourceManager\KeyVault\Commands.KeyVault.Test\bin\Debug\Microsoft.Azure.Commands.KeyVault.Test.dll</KeyVaultTestDebug>
25-
<TestFilter>"!Functional&#x26;!Scenario&#x26;!AzureRTScenario&#x26;!Sequential&#x26;!PIRTest&#x26;!Preview&#x26;!ADDomain&#x26;!Network&#x26;!AzureRTUpload"</TestFilter>
25+
<TestFilter>"!Functional&#x26;!Scenario&#x26;!AzureRTScenario&#x26;!Sequential&#x26;!PIRTest&#x26;!Preview&#x26;!ADDomain&#x26;!Network&#x26;!AzureRTUpload&#x26;!AzureRTCleanUp"</TestFilter>
2626
<ScenarioTestFilter>All</ScenarioTestFilter>
2727
<OneSDKCITFilter>"OneSDK&#x26;CIT"</OneSDKCITFilter>
2828
<AzureRTAllTestFilter>"Functional|AzureRTScenario|Sequential|AzureRTUpload|Network"</AzureRTAllTestFilter>
@@ -307,6 +307,14 @@
307307
ContinueOnError="false" />
308308
</Target>
309309

310+
<Target Name="AzureRTCleanUp" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
311+
<Message Importance="high" Text="Running AzureRT clean up tests..." />
312+
<Delete Files="$(TestOutputDirectory)\RTCleanUpDebug.trx" />
313+
<Exec
314+
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /category:AzureRTCleanUp /resultsfile:$(TestOutputDirectory)\RTCleanUpDebug.trx"
315+
ContinueOnError="false" />
316+
</Target>
317+
310318
<!-- DSC extension related targets -->
311319
<Target Name="TestDSCExtension_x64">
312320
<Message Importance="high" Text="Running DSC extension BVT x64 tests..." />

src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Commands.ServiceManagement.Test.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@
175175
<Compile Include="FunctionalTests\AzureServiceExtensionTests.cs" />
176176
<Compile Include="FunctionalTests\AzureVhdTest.cs" />
177177
<Compile Include="FunctionalTests\BVTTest.cs" />
178+
<Compile Include="FunctionalTests\CleanUp.cs" />
178179
<Compile Include="FunctionalTests\ConfigDataInfo\ACLAction.cs" />
179180
<Compile Include="FunctionalTests\ConfigDataInfo\HostCaching.cs" />
180181
<Compile Include="FunctionalTests\ConfigDataInfo\InstanceSize.cs" />
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.VisualStudio.TestTools.UnitTesting;
16+
17+
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Test.FunctionalTests
18+
{
19+
[TestClass]
20+
public class ServiceManagementCleanUp : ServiceManagementTest
21+
{
22+
23+
/// <summary>
24+
/// Clean up any resouces left from tests
25+
/// </summary>
26+
[TestMethod(), TestCategory(Category.CleanUp), Priority(1), Owner("hylee"), Description("Clean up any resouces left from tests")]
27+
public void CleanUp()
28+
{
29+
vmPowershellCmdlets = new ServiceManagementCmdletTestHelper();
30+
try
31+
{
32+
vmPowershellCmdlets.RunPSScript("Get-AzureService | Remove-AzureService -Force");
33+
}
34+
catch
35+
{
36+
}
37+
38+
try
39+
{
40+
vmPowershellCmdlets.RunPSScript("Get-AzureDisk | Remove-AzureDisk");
41+
}
42+
catch
43+
{
44+
}
45+
46+
try
47+
{
48+
vmPowershellCmdlets.RunPSScript(@"Get-AzureVMImage | where {$_.Category -eq 'User'} | Remove-AzureVMImage");
49+
}
50+
catch
51+
{
52+
}
53+
54+
try
55+
{
56+
vmPowershellCmdlets.RunPSScript("Remove-AzureVNetConfig");
57+
}
58+
catch
59+
{
60+
}
61+
62+
try
63+
{
64+
vmPowershellCmdlets.RunPSScript("Get-AzureAffinityGroup | Remove-AzureAffinityGroup");
65+
}
66+
catch
67+
{
68+
}
69+
70+
try
71+
{
72+
vmPowershellCmdlets.RunPSScript("Get-AzureReservedIP | Remove-AzureReservedIP -Force");
73+
}
74+
catch
75+
{
76+
}
77+
}
78+
}
79+
}

src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/Constants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public class Category
2323
public const string Sequential = "Sequential";
2424
public const string Network = "Network";
2525
public const string Upload = "AzureRTUpload";
26+
public const string CleanUp = "AzureRTCleanUp";
2627
}
2728

2829
public class LoadBalancerDistribution

src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementTest.cs

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -89,56 +89,6 @@ public TestContext TestContext
8989
public static void AssemblyInit(TestContext context)
9090
{
9191
SetTestSettings();
92-
93-
vmPowershellCmdlets = new ServiceManagementCmdletTestHelper();
94-
95-
try
96-
{
97-
vmPowershellCmdlets.RunPSScript("Get-AzureService | Remove-AzureService -Force");
98-
}
99-
catch
100-
{
101-
}
102-
103-
try
104-
{
105-
vmPowershellCmdlets.RunPSScript("Get-AzureDisk | Remove-AzureDisk");
106-
}
107-
catch
108-
{
109-
}
110-
111-
try
112-
{
113-
vmPowershellCmdlets.RunPSScript(@"Get-AzureVMImage | where {$_.Category -eq 'User'} | Remove-AzureVMImage");
114-
}
115-
catch
116-
{
117-
}
118-
119-
try
120-
{
121-
vmPowershellCmdlets.RunPSScript("Remove-AzureVNetConfig");
122-
}
123-
catch
124-
{
125-
}
126-
127-
try
128-
{
129-
vmPowershellCmdlets.RunPSScript("Get-AzureAffinityGroup | Remove-AzureAffinityGroup");
130-
}
131-
catch
132-
{
133-
}
134-
135-
try
136-
{
137-
vmPowershellCmdlets.RunPSScript("Get-AzureReservedIP | Remove-AzureReservedIP -Force");
138-
}
139-
catch
140-
{
141-
}
14292
}
14393

14494
[AssemblyCleanup]

src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/Utilities.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Test.FunctionalTests
3838
{
3939
internal class Utilities
4040
{
41-
4241
#region Constants
4342

4443
public static string windowsAzurePowershellPath = Path.Combine(Environment.CurrentDirectory, "ServiceManagement\\Azure");

0 commit comments

Comments
 (0)