Skip to content

jenkins test #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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