Skip to content
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

Remove Storage dependency from tests #8283

Merged
merged 5 commits into from
Jan 12, 2019
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using Microsoft.Azure.Management.Storage;
using Microsoft.Azure.Management.Storage.Version2017_10_01;
using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
using Microsoft.Azure.Test.HttpRecorder;
Expand Down Expand Up @@ -136,9 +136,6 @@ private void RunPowerShellTest(params string[] scripts)
"ScenarioTests\\Common.ps1",
"ScenarioTests\\" + GetType().Name + ".ps1",
_helper.RMProfileModule,
#if !NETSTANDARD
_helper.RMStorageDataPlaneModule,
#endif
_helper.GetRMModulePath("AzureRM.ApiManagement.psd1"),
"AzureRM.Storage.ps1",
"AzureRM.Resources.ps1");
Expand Down
8 changes: 4 additions & 4 deletions src/ApiManagement/ApiManagement.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2042
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApiManagement", "ApiManagement\Apicsproj", "{DC0A9742-DF36-48C9-BD2F-68D01AED6257}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApiManagement", "ApiManagement\ApiManagement.csproj", "{DC0A9742-DF36-48C9-BD2F-68D01AED6257}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{95C16AED-FD57-42A0-86C3-2CF4300A4817}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApiTest", "ApiTest\ApiTest.csproj", "{BEC9ECE9-A3D6-4B24-A682-1FA890647D9D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApiManagement.Test", "ApiManagement.Test\ApiManagement.Test.csproj", "{BEC9ECE9-A3D6-4B24-A682-1FA890647D9D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApiServiceManagement", "ApiServiceManagement\ApiServicecsproj", "{ED8BA708-AF42-4C08-9F4E-DAA1037797D5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApiManagement.ServiceManagement", "ApiManagement.ServiceManagement\ApiManagement.ServiceManagement.csproj", "{ED8BA708-AF42-4C08-9F4E-DAA1037797D5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApiServiceTest", "ApiServiceTest\ApiServiceTest.csproj", "{6448E795-3D02-4BDD-B0C7-AD0A2AFE3C8B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApiManagement.ServiceManagement.Test", "ApiManagement.ServiceManagement.Test\ApiManagement.ServiceManagement.Test.csproj", "{6448E795-3D02-4BDD-B0C7-AD0A2AFE3C8B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"
EndProject
Expand Down
19 changes: 1 addition & 18 deletions src/Compute/Compute.Test/Common/ComputeTestController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
using System.Linq;
using Microsoft.Azure.Management.Network;
using Microsoft.Azure.Management.KeyVault;
#if !NETSTANDARD
using Microsoft.Azure.Test;
using TestBase = Microsoft.Azure.Test.TestBase;
#endif
using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
using NetworkManagementClientInternal = Microsoft.Azure.Management.Internal.Network.Version2017_10_01.NetworkManagementClient;
Expand All @@ -36,7 +32,6 @@
using System.Runtime.Versioning;
using Microsoft.Azure.Management.Internal.Resources;
using CommonStorage = Microsoft.Azure.Management.Storage.Version2017_10_01;
using PublicStorage = Microsoft.Azure.Management.Storage;

namespace Microsoft.Azure.Commands.Compute.Test.ScenarioTests
{
Expand All @@ -46,8 +41,6 @@ public sealed class ComputeTestController : RMTestBase

public CommonStorage.StorageManagementClient StorageClient { get; private set; }

public PublicStorage.StorageManagementClient PublicStorageClient { get; private set; }

public ComputeManagementClient ComputeManagementClient { get; private set; }

public KeyVaultManagementClient KeyVaultManagementClient { get; private set; }
Expand Down Expand Up @@ -129,9 +122,6 @@ public void RunPsTestWorkflow(
"ScenarioTests\\ComputeTestCommon.ps1",
"ScenarioTests\\" + callingClassName + ".ps1",
_helper.RMProfileModule,
#if !NETSTANDARD
_helper.RMStorageDataPlaneModule,
#endif
_helper.GetRMModulePath("AzureRM.Compute.psd1"),
_helper.GetRMModulePath("AzureRM.Network.psd1"),
_helper.GetRMModulePath("AzureRM.KeyVault.psd1"),
Expand Down Expand Up @@ -161,16 +151,14 @@ private void SetupManagementClients(MockContext context)
NetworkManagementClientInternal = GetNetworkManagementClientInternal(context);
KeyVaultManagementClient = GetKeyVaultManagementClient(context);
ResourceManagementClient = GetResourceManagementClient(context);
PublicStorageClient = GetPublicStorageManagementClient(context);

_helper.SetupSomeOfManagementClients(
StorageClient,
ComputeManagementClient,
NetworkManagementClient,
NetworkManagementClientInternal,
KeyVaultManagementClient,
ResourceManagementClient,
PublicStorageClient);
ResourceManagementClient);
}

private static ResourceManagementClient GetResourceManagementClient(MockContext context)
Expand All @@ -183,11 +171,6 @@ private static CommonStorage.StorageManagementClient GetStorageManagementClient(
return context.GetServiceClient<CommonStorage.StorageManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
}

private static PublicStorage.StorageManagementClient GetPublicStorageManagementClient(MockContext context)
{
return context.GetServiceClient<PublicStorage.StorageManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
}

private static KeyVaultManagementClient GetKeyVaultManagementClient(MockContext context)
{
return context.GetServiceClient<KeyVaultManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ public void RunPsTestWorkflow(
"ScenarioTests\\" + callingClassName + ".ps1",
_helper.RMProfileModule,
_helper.GetRMModulePath(@"AzureRM.LogicApp.psd1"),
_helper.GetRMModulePath(@"AzureRM.Resources.psd1"),
"AzureRM.Resources.ps1");

try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
using System.Diagnostics;
using System.Linq;
using Microsoft.Azure.Commands.Common.Authentication;
using Microsoft.Azure.Management.Storage;
using Microsoft.Azure.Management.Storage.Version2017_10_01;
using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.Azure.Test.HttpRecorder;
using Microsoft.Rest;
Expand Down
2 changes: 1 addition & 1 deletion src/Media/Media.Test/ScenarioTests/TestController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
using System.Linq;
using Microsoft.Azure.Commands.Common.Authentication;
using Microsoft.Azure.Management.Media;
using Microsoft.Azure.Management.Storage;
using Microsoft.Azure.Management.Storage.Version2017_10_01;
using Microsoft.Azure.Test.HttpRecorder;
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
Expand Down
2 changes: 1 addition & 1 deletion src/Network/Network.Test/NetworkResourcesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
using Microsoft.Azure.Management.ContainerInstance;
using Microsoft.Azure.Management.Network;
using Microsoft.Azure.Management.Redis;
using Microsoft.Azure.Management.Storage;
using Microsoft.Azure.Management.OperationalInsights;
using Microsoft.Azure.Test.HttpRecorder;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
Expand All @@ -29,6 +28,7 @@
using Microsoft.Azure.Management.Internal.Resources;
using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
using Microsoft.Azure.Management.Storage.Version2017_10_01;

namespace Commands.Network.Test
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
using Microsoft.Azure.Management.Internal.Resources;
using Microsoft.Azure.Management.Network;
using Microsoft.Azure.Management.RecoveryServices;
using Microsoft.Azure.Management.Storage;
using Microsoft.Azure.Management.Storage.Version2017_10_01;
using Microsoft.Azure.ServiceManagement.Common.Models;

namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Test.ScenarioTests
Expand Down Expand Up @@ -140,10 +140,6 @@ public Collection<PSObject> RunPsTestWorkflow(
"ScenarioTests\\" + testFolderName + "\\" + callingClassName + ".ps1",
_helper.RMProfileModule,
_helper.GetRMModulePath("AzureRM.RecoveryServices.psd1"),
#if !NETSTANDARD
_helper.GetRMModulePath("AzureRM.RecoveryServices.Backup.psd1"),
_helper.RMStorageDataPlaneModule,
#endif
_helper.GetRMModulePath("AzureRM.Compute.psd1"),
_helper.GetRMModulePath("AzureRM.Network.psd1"),
"AzureRM.Storage.ps1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
using System.IO;
using System.Linq;
using TestEnvironmentFactory = Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestEnvironmentFactory;
using Microsoft.Azure.Management.Storage;
using Microsoft.Azure.Management.Storage.Version2017_10_01;
using System.Collections.Generic;
using System.Diagnostics;
using Microsoft.Azure.ServiceManagement.Common.Models;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ public class AdvancedThreatProtectionTests : SqlTestsBase
protected override void SetupManagementClients(RestTestFramework.MockContext context)
{
var sqlClient = GetSqlClient(context);
var publicstorageV2Client = GetPublicStorageManagementClient(context);
var storageV2Client = GetStorageManagementClient(context);
var newResourcesClient = GetResourcesClient(context);
Helper.SetupSomeOfManagementClients(sqlClient, publicstorageV2Client, storageV2Client, newResourcesClient);
Helper.SetupSomeOfManagementClients(sqlClient, storageV2Client, newResourcesClient);
}

public AdvancedThreatProtectionTests(ITestOutputHelper output) : base(output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ public class AuditingClassicStorageTests : SqlTestsBase
protected override void SetupManagementClients(RestTestFramework.MockContext context)
{
var sqlClient = GetSqlClient(context);
var publicstorageV2Client = GetPublicStorageManagementClient(context);
var storageV2Client = GetStorageManagementClient(context);
var newResourcesClient = GetResourcesClient(context);
Helper.SetupSomeOfManagementClients(sqlClient, publicstorageV2Client, storageV2Client, newResourcesClient);
Helper.SetupSomeOfManagementClients(sqlClient, storageV2Client, newResourcesClient);
}

public AuditingClassicStorageTests(ITestOutputHelper output) : base(output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ public class BlobAuditingClassicStorageTests : SqlTestsBase
protected override void SetupManagementClients(RestTestFramework.MockContext context)
{
var sqlClient = GetSqlClient(context);
var publicstorageV2Client = GetPublicStorageManagementClient(context);
var storageV2Client = GetStorageManagementClient(context);
var newResourcesClient = GetResourcesClient(context);
Helper.SetupSomeOfManagementClients(sqlClient, publicstorageV2Client, storageV2Client, newResourcesClient);
Helper.SetupSomeOfManagementClients(sqlClient, storageV2Client, newResourcesClient);
}

public BlobAuditingClassicStorageTests(ITestOutputHelper output) : base(output)
Expand Down
3 changes: 1 addition & 2 deletions src/Sql/Sql.Test/ScenarioTests/BlobAuditingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ public class BlobAuditingTests : SqlTestsBase
protected override void SetupManagementClients(RestTestFramework.MockContext context)
{
var sqlClient = GetSqlClient(context);
var publicstorageV2Client = GetPublicStorageManagementClient(context);
var storageV2Client = GetStorageManagementClient(context);
var newResourcesClient = GetResourcesClient(context);
Helper.SetupSomeOfManagementClients(sqlClient, publicstorageV2Client, storageV2Client, newResourcesClient);
Helper.SetupSomeOfManagementClients(sqlClient, storageV2Client, newResourcesClient);
}

public BlobAuditingTests(ITestOutputHelper output) : base(output)
Expand Down
6 changes: 0 additions & 6 deletions src/Sql/Sql.Test/ScenarioTests/SqlTestsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
using Microsoft.Azure.Management.Internal.Resources;
using Microsoft.Azure.Management.Sql;
using CommonStorage = Microsoft.Azure.Management.Storage.Version2017_10_01;
using PublicStorage = Microsoft.Azure.Management.Storage;
using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
using Xunit.Abstractions;
Expand Down Expand Up @@ -110,10 +109,5 @@ protected static CommonStorage.StorageManagementClient GetStorageManagementClien
return context.GetServiceClient<CommonStorage.StorageManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
}

protected static PublicStorage.StorageManagementClient GetPublicStorageManagementClient(MockContext context)
{
return context.GetServiceClient<PublicStorage.StorageManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ public class ThreatDetectionClassicStorageTests : SqlTestsBase
protected override void SetupManagementClients(RestTestFramework.MockContext context)
{
var sqlClient = GetSqlClient(context);
var publicstorageV2Client = GetPublicStorageManagementClient(context);
var storageV2Client = GetStorageManagementClient(context);
var newResourcesClient = GetResourcesClient(context);
Helper.SetupSomeOfManagementClients(sqlClient, publicstorageV2Client, storageV2Client, newResourcesClient);
Helper.SetupSomeOfManagementClients(sqlClient, storageV2Client, newResourcesClient);
}

public ThreatDetectionClassicStorageTests(ITestOutputHelper output) : base(output)
Expand Down
3 changes: 1 addition & 2 deletions src/Sql/Sql.Test/ScenarioTests/ThreatDetectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ public class ThreatDetectionTests : SqlTestsBase
protected override void SetupManagementClients(RestTestFramework.MockContext context)
{
var sqlClient = GetSqlClient(context);
var publicstorageV2Client = GetPublicStorageManagementClient(context);
var storageV2Client = GetStorageManagementClient(context);
var newResourcesClient = GetResourcesClient(context);
Helper.SetupSomeOfManagementClients(sqlClient, publicstorageV2Client, storageV2Client, newResourcesClient);
Helper.SetupSomeOfManagementClients(sqlClient, storageV2Client, newResourcesClient);
}

public ThreatDetectionTests(ITestOutputHelper output) : base(output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ public class VulnerabilityAssessmentTests : SqlTestsBase
protected override void SetupManagementClients(RestTestFramework.MockContext context)
{
var sqlClient = GetSqlClient(context);
var publicstorageV2Client = GetPublicStorageManagementClient(context);
var storageV2Client = GetStorageManagementClient(context);
var newResourcesClient = GetResourcesClient(context);
Helper.SetupSomeOfManagementClients(sqlClient, publicstorageV2Client, storageV2Client, newResourcesClient);
Helper.SetupSomeOfManagementClients(sqlClient, storageV2Client, newResourcesClient);
}

public VulnerabilityAssessmentTests(ITestOutputHelper output) : base(output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<PropertyGroup>
<PsModuleName>Management.Storage</PsModuleName>
<IncludeManagementStorage>false</IncludeManagementStorage>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)..\..\Az.Test.props" />
Expand Down
3 changes: 0 additions & 3 deletions src/Storage/Storage.Management.Test/TestController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ public void RunPsTestWorkflow(
var callingClassName = callingClassType.Split(new[] { "." }, StringSplitOptions.RemoveEmptyEntries).Last();
_helper.SetupModules(AzureModule.AzureResourceManager,
_helper.RMProfileModule,
#if !NETSTANDARD
_helper.RMStorageDataPlaneModule,
#endif
_helper.RMStorageModule,
"ScenarioTests\\Common.ps1",
"ScenarioTests\\" + callingClassName + ".ps1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
using Microsoft.Azure.Commands.Common.Authentication;
using Microsoft.Azure.Commands.ScenarioTest;
using Microsoft.Azure.Management.Authorization.Version2015_07_01;
using Microsoft.Azure.Management.Storage;
using Microsoft.Azure.Management.Storage.Version2017_10_01;
using Microsoft.Azure.Management.WebSites;
using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.Azure.Test.HttpRecorder;
Expand Down
7 changes: 3 additions & 4 deletions tools/Common.Netcore.Dependencies.Test.targets
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
<PrivateAssets Condition="'$(HideReferenceDependencies)' == 'true'">All</PrivateAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="Microsoft.Azure.PowerShell.ScenarioTest.ResourceManager" Version="1.1.12-preview" >
<PackageReference Include="Microsoft.Azure.PowerShell.ScenarioTest.ResourceManager" Version="1.1.13-preview" >
<PrivateAssets Condition="'$(HideReferenceDependencies)' == 'true'">All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Azure.PowerShell.TestFx" Version="1.1.12-preview" >
<PackageReference Include="Microsoft.Azure.PowerShell.TestFx" Version="1.1.13-preview" >
<PrivateAssets Condition="'$(HideReferenceDependencies)' == 'true'">All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down Expand Up @@ -52,13 +52,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Condition="'$(IncludeManagementStorage)' != 'false'" Include="Microsoft.Azure.Management.Storage" Version="8.1.1-preview" />
<PackageReference Include="Microsoft.IdentityModel.Clients.ActiveDirectory" Version="3.19.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
</ItemGroup>

<PropertyGroup>
<ScenarioTestToolsPath>$(NugetPackageRoot)microsoft.azure.powershell.scenariotest.resourcemanager\1.1.12-preview\tools\</ScenarioTestToolsPath>
<ScenarioTestToolsPath>$(NugetPackageRoot)microsoft.azure.powershell.scenariotest.resourcemanager\1.1.13-preview\tools\</ScenarioTestToolsPath>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading