Skip to content

Commit

Permalink
Merge pull request #5 from hyonholee/dev
Browse files Browse the repository at this point in the history
jenkins test
  • Loading branch information
AzureRT committed Feb 6, 2015
2 parents 64a9488 + e536f87 commit 73b6e72
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 52 deletions.
10 changes: 9 additions & 1 deletion AzurePowershell.Test.targets
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<HDInsightTestDebug>.\src\ServiceManagement\HDInsight\Commands.HDInsight.Test\bin\Debug\Microsoft.WindowsAzure.Commands.HDInsight.Test.dll</HDInsightTestDebug>
<StorageTestDebug>.\src\ServiceManagement\Storage\Commands.Storage.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Storage.Test.dll</StorageTestDebug>
<KeyVaultTestDebug>.\src\ResourceManager\KeyVault\Commands.KeyVault.Test\bin\Debug\Microsoft.Azure.Commands.KeyVault.Test.dll</KeyVaultTestDebug>
<TestFilter>"!Functional&#x26;!Scenario&#x26;!AzureRTScenario&#x26;!Sequential&#x26;!PIRTest&#x26;!Preview&#x26;!ADDomain&#x26;!Network&#x26;!AzureRTUpload"</TestFilter>
<TestFilter>"!Functional&#x26;!Scenario&#x26;!AzureRTScenario&#x26;!Sequential&#x26;!PIRTest&#x26;!Preview&#x26;!ADDomain&#x26;!Network&#x26;!AzureRTUpload&#x26;!AzureRTCleanUp"</TestFilter>
<ScenarioTestFilter>All</ScenarioTestFilter>
<OneSDKCITFilter>"OneSDK&#x26;CIT"</OneSDKCITFilter>
<AzureRTAllTestFilter>"Functional|AzureRTScenario|Sequential|AzureRTUpload|Network"</AzureRTAllTestFilter>
Expand Down Expand Up @@ -307,6 +307,14 @@
ContinueOnError="false" />
</Target>

<Target Name="AzureRTCleanUp" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT clean up tests..." />
<Delete Files="$(TestOutputDirectory)\RTCleanUpDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /category:AzureRTCleanUp /resultsfile:$(TestOutputDirectory)\RTCleanUpDebug.trx"
ContinueOnError="false" />
</Target>

<!-- DSC extension related targets -->
<Target Name="TestDSCExtension_x64">
<Message Importance="high" Text="Running DSC extension BVT x64 tests..." />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
<Compile Include="FunctionalTests\AzureServiceExtensionTests.cs" />
<Compile Include="FunctionalTests\AzureVhdTest.cs" />
<Compile Include="FunctionalTests\BVTTest.cs" />
<Compile Include="FunctionalTests\CleanUp.cs" />
<Compile Include="FunctionalTests\ConfigDataInfo\ACLAction.cs" />
<Compile Include="FunctionalTests\ConfigDataInfo\HostCaching.cs" />
<Compile Include="FunctionalTests\ConfigDataInfo\InstanceSize.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Test.FunctionalTests
{
[TestClass]
public class ServiceManagementCleanUp : ServiceManagementTest
{

/// <summary>
/// Clean up any resouces left from tests
/// </summary>
[TestMethod(), TestCategory(Category.CleanUp), Priority(1), Owner("hylee"), Description("Clean up any resouces left from tests")]
public void CleanUp()
{
vmPowershellCmdlets = new ServiceManagementCmdletTestHelper();
try
{
vmPowershellCmdlets.RunPSScript("Get-AzureService | Remove-AzureService -Force");
}
catch
{
}

try
{
vmPowershellCmdlets.RunPSScript("Get-AzureDisk | Remove-AzureDisk");
}
catch
{
}

try
{
vmPowershellCmdlets.RunPSScript(@"Get-AzureVMImage | where {$_.Category -eq 'User'} | Remove-AzureVMImage");
}
catch
{
}

try
{
vmPowershellCmdlets.RunPSScript("Remove-AzureVNetConfig");
}
catch
{
}

try
{
vmPowershellCmdlets.RunPSScript("Get-AzureAffinityGroup | Remove-AzureAffinityGroup");
}
catch
{
}

try
{
vmPowershellCmdlets.RunPSScript("Get-AzureReservedIP | Remove-AzureReservedIP -Force");
}
catch
{
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class Category
public const string Sequential = "Sequential";
public const string Network = "Network";
public const string Upload = "AzureRTUpload";
public const string CleanUp = "AzureRTCleanUp";
}

public class LoadBalancerDistribution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,56 +89,6 @@ public TestContext TestContext
public static void AssemblyInit(TestContext context)
{
SetTestSettings();

vmPowershellCmdlets = new ServiceManagementCmdletTestHelper();

try
{
vmPowershellCmdlets.RunPSScript("Get-AzureService | Remove-AzureService -Force");
}
catch
{
}

try
{
vmPowershellCmdlets.RunPSScript("Get-AzureDisk | Remove-AzureDisk");
}
catch
{
}

try
{
vmPowershellCmdlets.RunPSScript(@"Get-AzureVMImage | where {$_.Category -eq 'User'} | Remove-AzureVMImage");
}
catch
{
}

try
{
vmPowershellCmdlets.RunPSScript("Remove-AzureVNetConfig");
}
catch
{
}

try
{
vmPowershellCmdlets.RunPSScript("Get-AzureAffinityGroup | Remove-AzureAffinityGroup");
}
catch
{
}

try
{
vmPowershellCmdlets.RunPSScript("Get-AzureReservedIP | Remove-AzureReservedIP -Force");
}
catch
{
}
}

[AssemblyCleanup]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Test.FunctionalTests
{
internal class Utilities
{

#region Constants

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

0 comments on commit 73b6e72

Please sign in to comment.