Skip to content

Dev #184

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

Closed
wants to merge 12 commits into from
Closed

Dev #184

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
22 changes: 0 additions & 22 deletions AzurePowershell.Test.targets
Original file line number Diff line number Diff line change
Expand Up @@ -32,35 +32,13 @@
<AzureRTSeqAllFilter>"AzureRTUpload|Sequential|Network"</AzureRTSeqAllFilter>
</PropertyGroup>

<ItemGroup>
<XUnitTests Include=".\src\Common\Commands.Common.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Common.Test.dll"/>
<XUnitTests Include=".\src\ResourceManager\Sql\Commands.Sql.Test\bin\Debug\Microsoft.Azure.Commands.Sql.Test.dll"/>
<XUnitTests Include=".\src\ServiceManagement\Services\Commands.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Test.dll"/>
<XUnitTests Include=".\src\ResourceManager\Resources\Commands.Resources.Test\bin\Debug\Microsoft.Azure.Commands.Resources.Test.dll"/>
<XUnitTests Include=".\src\ResourceManager\DataFactories\Commands.DataFactories.Test\bin\Debug\Microsoft.Azure.Commands.DataFactories.Test.dll"/>
<XUnitTests Include=".\src\ResourceManager\StreamAnalytics\Commands.StreamAnalytics.Test\bin\Debug\Microsoft.Azure.Commands.StreamAnalytics.Test.dll"/>
<XUnitTests Include=".\src\ResourceManager\Batch\Commands.Batch.Test\bin\Debug\Microsoft.Azure.Commands.Batch.Test.dll"/>
<XUnitTests Include=".\src\ResourceManager\KeyVault\Commands.KeyVault.Test\bin\Debug\Microsoft.Azure.Commands.KeyVault.Test.dll"/>
<XUnitTests Include=".\src\ServiceManagement\ManagedCache\Commands.ManagedCache.Test\bin\Debug\Microsoft.Azure.Commands.ManagedCache.Test.dll"/>
<XUnitTests Include=".\src\Common\Commands.ScenarioTest\bin\Debug\Microsoft.WindowsAzure.Commands.ScenarioTest.dll"/>
<XUnitTests Include=".\src\ServiceManagement\RecoveryServices\Commands.RecoveryServices.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServices.Test.dll"/>
<XUnitTests Include=".\src\ServiceManagement\StorSimple\Commands.StorSimple.Test\bin\Debug\Microsoft.WindowsAzure.Commands.StorSimple.Test.dll"/>
</ItemGroup>

<Target Name="InvokeMSTest">
<!--Remove existing test result; otherwsie mstest will error-->
<Delete Files="$(_testResult)"/>
<Exec
Command="MSTest.exe /testcontainer:$(_testAssembly) /testsettings:$(_testSettings) /category:$(_testFilter) /resultsfile:$(_testResult)"
ContinueOnError="false" />
</Target>

<Target Name="InvokeXUnit">
<Message Importance="high" Text="Running XUnit tests" />
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
<Xunit.Runner.MSBuild.xunit Assemblies="@(XUnitTests)" Html="$(TestOutputDirectory)\xunit.tests.dll.html" Verbose="true"
ExcludeTraits="$(XUnitExcludedTrait)" MaxParallelThreads="0" ParallelizeAssemblies="false" ParallelizeTestCollections="false"/>
</Target>

<Target Name="BeforeRunTests">
<Message Importance="high" Text="You are required to have installed a version of Visual Studio with support for MSTest (and MSTest on your path)." />
Expand Down
7 changes: 1 addition & 6 deletions build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<TestOutputDirectory>$(PublishDirectory)\TestResults</TestOutputDirectory>
<DebugBuildConfig>Configuration=Debug;Platform=Any CPU</DebugBuildConfig>
<ReleaseBuildConfig>Configuration=Release;Platform=Any CPU</ReleaseBuildConfig>
<BuildInParallel Condition="'$(BuildInParallel)' == ''">true</BuildInParallel>
</PropertyGroup>
<ItemGroup>
<AzurePowerShellSln Include=".\src\AzurePowerShell.sln" />
Expand Down Expand Up @@ -105,13 +104,11 @@
Projects="@(AzurePowerShellSln)"
Targets="Build"
Properties="$(DebugBuildConfig)"
BuildInParallel="$(BuildInParallel)"
ContinueOnError="false" />
<MSBuild
Projects="@(AzurePowerShellSln)"
Targets="Build"
Properties="$(ReleaseBuildConfig)"
BuildInParallel="$(BuildInParallel)"
ContinueOnError="false" />
</Target>

Expand Down Expand Up @@ -163,7 +160,6 @@
Projects="@(AzurePowerShellSln)"
Targets="Build"
Properties="$(ReleaseBuildConfig)"
BuildInParallel="$(BuildInParallel)"
ContinueOnError="false" />
</Target>

Expand All @@ -174,7 +170,6 @@
Projects="@(AzurePowerShellSln)"
Targets="Build"
Properties="$(DebugBuildConfig)"
BuildInParallel="$(BuildInParallel)"
ContinueOnError="false" />
</Target>

Expand All @@ -188,7 +183,7 @@
<!-- Run checkin tests for each pull request -->
<Target Name="Test" DependsOnTargets="BuildDebug;BeforeRunTests">
<Message Importance="high" Text="Running check in tests..." />
<CallTarget Targets="InvokeXUnit; TestHDInsight; TestServiceManagement; TestServiceManagementExtensions; TestSqlDatabase; TestStorage; TestDSCExtension_x64"/>
<CallTarget Targets="KeyVaultTests; SqlTests; CommonTests; TestManagement; TestHDInsight; TestManagedCache; TestServiceManagement; TestServiceManagementExtensions; TestSqlDatabase; TestStorage; TestResourceManager; MockedScenarioTests; TestDSCExtension_x64; TestBatch; TestDataFactoryManager; TestRecoveryServices; TestStreamAnalyticsManager; TestStorSimple"/>
</Target>

<!-- Run Full switch with scenario tests -->
Expand Down
24 changes: 3 additions & 21 deletions setup/azurecmdfiles.wxi
Original file line number Diff line number Diff line change
Expand Up @@ -1527,24 +1527,15 @@
<Component Id="cmp8CDB44BA783FF24C94CDFC5D12066BB1" Guid="*">
<File Id="fil2C73256F76E79B695523A2B3C4C845E9" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.WindowsAzure.Commands.Common.dll" />
</Component>
<Component Id="cmpA0A697DEB7822A0EC30F3D359EE930A6" Guid="*">
<File Id="fil528A48BB87B57E0D131C279CAD156D2B" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.WindowsAzure.Common.dll" />
</Component>
<Component Id="cmpBE209ED6509A7E857FD9F9078051DC6A" Guid="*">
<File Id="fil96FD7FA0CBEE96E0C0239408CD5651A9" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.WindowsAzure.Common.NetFramework.dll" />
<Component Id="cmpD7A9F76B2346156CA8F83F41A302B714" Guid="*">
<File Id="fil0218D7505353104A9DB742A55A839351" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.WindowsAzure.Management.dll" />
</Component>
<Component Id="cmp4D3E383B38EF4392E70E981B7CA033D7" Guid="*">
<File Id="fil3D6B846AC421D38C5A9CB40A58B058B6" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.WindowsAzure.Management.SiteRecovery.dll" />
</Component>
<Component Id="cmp50D44814DFFEA762A53D9DEDCE48F689" Guid="*">
<File Id="fil80C14207B99E14F4567B92038EDC8715" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.WindowsAzure.Management.Storage.dll" />
</Component>
<Component Id="cmp439E7C155DEEFC3877653E4ED11F66AC" Guid="*">
<File Id="filE3D7ECC5C92739687FAA34CCE9DFB4A3" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Newtonsoft.Json.dll" />
</Component>
<Component Id="cmp9B4CB06D327ECA8FA60032F98004D8BA" Guid="*">
<File Id="filC935CDA00FB3E840369825B599C84E28" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Security.Cryptography.dll" />
</Component>
<Component Id="cmp5278A11908DC26651A78E55522C71DF3" Guid="*">
<File Id="fil3C9995984C13EAB542D813B85C917916" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\System.Net.Http.Extensions.dll" />
</Component>
Expand All @@ -1554,11 +1545,6 @@
<Component Id="cmp2A0B3E88742D800F88F70A714BAC94B5" Guid="*">
<File Id="fil8B5C2678B7FAC0061799DCBFF4AFE27E" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\System.Net.Http.Primitives.dll" />
</Component>
<Directory Id="dirB2E733E5A07F5CBD9FFA437A83782545" Name="lib">
<Component Id="cmpE3495C0DD75A31199E40EAA7E5128E6C" Guid="*">
<File Id="fil269C9C56525316A4AB13CC9240BF5FE6" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\lib\Security.Cryptography.dll" />
</Component>
</Directory>
</Directory>
<Directory Id="dir5A14F7172D6373ACE47493BAD054EEF3" Name="Services">
<Component Id="cmp5F55270F607737A772BFBE2D8F6B76E4" Guid="*">
Expand Down Expand Up @@ -2967,16 +2953,12 @@
<ComponentRef Id="cmpFFEE4D9645AEA846AF41897FD2135E02" />
<ComponentRef Id="cmp2F6E4C6B8006898EFE87C88921C1B6BA" />
<ComponentRef Id="cmp8CDB44BA783FF24C94CDFC5D12066BB1" />
<ComponentRef Id="cmpA0A697DEB7822A0EC30F3D359EE930A6" />
<ComponentRef Id="cmpBE209ED6509A7E857FD9F9078051DC6A" />
<ComponentRef Id="cmpD7A9F76B2346156CA8F83F41A302B714" />
<ComponentRef Id="cmp4D3E383B38EF4392E70E981B7CA033D7" />
<ComponentRef Id="cmp50D44814DFFEA762A53D9DEDCE48F689" />
<ComponentRef Id="cmp439E7C155DEEFC3877653E4ED11F66AC" />
<ComponentRef Id="cmp9B4CB06D327ECA8FA60032F98004D8BA" />
<ComponentRef Id="cmp5278A11908DC26651A78E55522C71DF3" />
<ComponentRef Id="cmp4ED39EDE761ED68263635882802FB1B5" />
<ComponentRef Id="cmp2A0B3E88742D800F88F70A714BAC94B5" />
<ComponentRef Id="cmpE3495C0DD75A31199E40EAA7E5128E6C" />
<ComponentRef Id="cmp5F55270F607737A772BFBE2D8F6B76E4" />
<ComponentRef Id="cmp9EF03D7C53CEE400751AD1905625B82B" />
<ComponentRef Id="cmpC4F524A9EBF63DAC78B9678CF113D652" />
Expand Down
8 changes: 1 addition & 7 deletions src/AzurePowershell.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
VisualStudioVersion = 12.0.30723.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8531411A-0137-4E27-9C5E-49E07C245048}"
ProjectSection(SolutionItems) = preProject
Expand Down Expand Up @@ -163,8 +163,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Insights", "Resour
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Insights.Test", "ResourceManager\Insights\Commands.Insights.Test\Commands.Insights.Test.csproj", "{469F20E0-9D40-41AD-94C3-B47AD15A4C00}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Websites", "ResourceManager\Websites\Commands.Websites\Commands.Websites.csproj", "{80A92297-7C92-456B-8EE7-9FB6CE30149D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -399,10 +397,6 @@ Global
{469F20E0-9D40-41AD-94C3-B47AD15A4C00}.Debug|Any CPU.Build.0 = Debug|Any CPU
{469F20E0-9D40-41AD-94C3-B47AD15A4C00}.Release|Any CPU.ActiveCfg = Release|Any CPU
{469F20E0-9D40-41AD-94C3-B47AD15A4C00}.Release|Any CPU.Build.0 = Release|Any CPU
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath>
<Reference Include="Microsoft.Azure.ResourceManager">
<HintPath>..\..\packages\Microsoft.Azure.Management.Resources.2.14.1-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Edm, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll</HintPath>
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Commands.Common.Storage/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.14.1-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.0.8-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.12.0-preview" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<HintPath>..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.ResourceManager">
<HintPath>..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath>
<HintPath>..\..\packages\Microsoft.Azure.Management.Resources.2.14.1-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
44 changes: 0 additions & 44 deletions src/Common/Commands.Common.Test/Common/ProfileCmdltsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -517,50 +517,6 @@ public void SelectAzureSubscriptionByNameUpdatesProfile()
Assert.Equal(azureSubscription2.Id, cmdlt.Profile.Context.Subscription.Id);
}

[Fact]
public void SelectAzureSubscriptionByNameWithoutAccountPreservesTheAccount()
{
SetupDefaultProfile();
SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();

// Setup
cmdlt.CommandRuntime = commandRuntimeMock;
cmdlt.SetParameterSet("SelectSubscriptionByNameParameterSet");
cmdlt.SubscriptionName = azureSubscription2.Name;

// Act
cmdlt.InvokeBeginProcessing();
cmdlt.ExecuteCmdlet();
cmdlt.InvokeEndProcessing();

// Verify
Assert.NotNull(cmdlt.Profile.Context.Subscription);
Assert.Equal(azureSubscription2.Account, cmdlt.Profile.Context.Subscription.Account);
Assert.Equal(azureSubscription2.Id, cmdlt.Profile.Context.Subscription.Id);
}

[Fact]
public void SelectAzureSubscriptionByIdWithoutAccountPreservesTheAccount()
{
SetupDefaultProfile();
SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();

// Setup
cmdlt.CommandRuntime = commandRuntimeMock;
cmdlt.SetParameterSet("SelectSubscriptionByIdParameterSet");
cmdlt.SubscriptionId = azureSubscription2.Id.ToString();

// Act
cmdlt.InvokeBeginProcessing();
cmdlt.ExecuteCmdlet();
cmdlt.InvokeEndProcessing();

// Verify
Assert.NotNull(cmdlt.Profile.Context.Subscription);
Assert.Equal(azureSubscription2.Account, cmdlt.Profile.Context.Subscription.Account);
Assert.Equal(azureSubscription2.Id, cmdlt.Profile.Context.Subscription.Id);
}

[Fact]
public void SelectAzureSubscriptionWithoutPassthroughDoesNotPrint()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Commands.Common.Test/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.14.1-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.0.8-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.12.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.0.5513.27084-prerelease" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
Expand Down
13 changes: 13 additions & 0 deletions src/Common/Commands.Common/AzurePSCmdlet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ private void InitializeProfile()
}
}

/// <summary>
/// Gets or initializes the azure profile
/// </summary>
protected AzureProfile GetOrInitializeAzureProfile()
{
if (this.Profile == null)
{
this.InitializeProfile();
}

return this.Profile;
}

/// <summary>
/// End processing. Flush messages in tracing interceptor and save profile.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Commands.Common/Commands.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</Reference>
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath>
<HintPath>..\..\packages\Microsoft.Azure.Management.Resources.2.14.1-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Edm, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll</HintPath>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Common/Commands.Common/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.14.1-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.0.8-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.12.0-preview" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" />
Expand Down
Loading