Skip to content

Fixed mock tests failures in Resource. #1459

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 10 commits into from
Dec 11, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ app.config
*.user
*.sln.docstates
*.lock.json
launchSettings.json
.vs/
artifacts/

Expand Down
107 changes: 53 additions & 54 deletions build.proj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!--
Available Targets:

/t:Clean
Removes temporary build outputs.

/t:Build
Builds assemblies.

Expand All @@ -17,14 +17,14 @@
Code sign binaries, mainly for official release. Default is false.

/p:CodeSign=True;DelaySign=True
Test the code sign workflow locally.
Test the code sign workflow locally.

/p:Scope
'ServiceManagement': service management
'AzureStorage': storage data plane cmdlets
'Subfolder under src\ResourceManager': An individual cmdlet module
By default, it builds all
-->
-->

<!-- Define build properties -->
<PropertyGroup>
Expand All @@ -47,13 +47,13 @@
</PropertyGroup>
<ItemGroup>
<CmdletSolutionsToBuild Include=".\src\CLU.sln" Condition=" '$(Scope)' == 'all' "/>
<CmdletSolutionsToBuild Include=".\src\ResourceManager\$(Scope)\*.sln"
<CmdletSolutionsToBuild Include=".\src\ResourceManager\$(Scope)\*.sln"
Condition=" '$(Scope)' != 'all' and '$(Scope)' != 'ServiceManagement' and '$(Scope)' != 'AzureStorage' "/>
<CmdletSolutionsToBuild Include=".\src\ServiceManagement\ServiceManagement.sln"
Condition=" '$(Scope)' == 'ServiceManagement' or '$(Scope)' == 'AzureStorage' "/>
<SetupSln Include=".\setup\azurepowershell.sln" />
</ItemGroup>

<!--
CI build related
-->
Expand All @@ -67,10 +67,10 @@
<UsingTask Condition=" $(OnPremiseBuild) " TaskName="CorporateValidation" AssemblyFile="$(CIToolsPath)\Microsoft.WindowsAzure.Tools.Build.Tasks.OnPremise.dll" />
<Import Condition=" $(OnPremiseBuild) " Project="$(CIToolsPath)\Microsoft.WindowsAzure.Build.OnPremise.msbuild" />

<UsingTask
<UsingTask
AssemblyFile="$(MSBuildProjectDirectory)\src\packages\xunit.MSBuild.2.0.0.0\tools\xunit.runner.msbuild.dll"
TaskName="Xunit.Runner.MSBuild.xunit" />

<!-- Clean the build in all configurations -->
<Target Name="Clean">
<Message Importance="high" Text="Cleaning Cmdlets..." ContinueOnError="false" />
Expand All @@ -79,7 +79,7 @@
Targets="Clean"
Properties="Configuration=$(Configuration);Platform=Any CPU"
ContinueOnError="false" />

<!-- Delete the publish files -->
<Message Importance="high" Text="Cleaning publish files..." ContinueOnError="false" />
<ItemGroup>
Expand All @@ -104,14 +104,14 @@
Directories="$(PackageDirectory)"
ContinueOnError="false" />
</Target>

<PropertyGroup>
<NuGetCommand>$(MSBuildProjectDirectory)\tools\NuGet.exe</NuGetCommand>
<NuGetRestoreConfigFile>$(MSBuildProjectDirectory)\restore.config</NuGetRestoreConfigFile>
<NuGetRestoreConfigSwitch>-ConfigFile &quot;$(NuGetRestoreConfigFile)&quot;</NuGetRestoreConfigSwitch>
<PowerShellCommand>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe</PowerShellCommand>
</PropertyGroup>

<!--
Force nuget package restore so that packages that include .targets files
don't need to be checked into source control.
Expand All @@ -122,7 +122,7 @@
<NuGetCache Include="$(LOCALAPPDATA)\NuGet\Cache\*.nupkg"/>
</ItemGroup>
<Delete Files="@(NuGetCache)" />-->

<Delete Files="$(NuGetRestoreConfigFile)" />
<WriteLinesToFile
File="$(NuGetRestoreConfigFile)"
Expand All @@ -133,12 +133,12 @@
<Exec Command="$(NuGetCommand) sources add -Name LocalFeed -Source &quot;$(MSBuildProjectDirectory)\tools\LocalFeed&quot; $(NuGetRestoreConfigSwitch)"/>

<!-- Restore packages -->
<Exec Command="$(NuGetCommand) restore %(CmdletSolutionsToBuild.FullPath) $(NuGetRestoreConfigSwitch)"
<Exec Command="$(NuGetCommand) restore %(CmdletSolutionsToBuild.FullPath) $(NuGetRestoreConfigSwitch)"
ContinueOnError="false" />

<!--Restore the xunit runner needed to run unit tests-->
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\packages.config -PackagesDirectory $(MSBuildProjectDirectory)\packages" />

<Delete Files="$(NuGetRestoreConfigFile)" />
</Target>

Expand All @@ -153,45 +153,45 @@
<_CLUProjects Include="$(CLURootDir)\**\project.json"
Exclude="$(CLURootDir)\*.Test\project.json"></_CLUProjects>
</ItemGroup>
<Exec Command="dnu build" WorkingDirectory="%(_CLUProjects.RootDir)%(_CLUProjects.Directory)" />
<Exec Command="dnu build" WorkingDirectory="%(_CLUProjects.RootDir)%(_CLUProjects.Directory)" />

<!--<Message Importance="high" Text="Building Cmdlets..." />
<MSBuild
Projects="@(CmdletSolutionsToBuild)"
Targets="Build"
Properties="Configuration=$(Configuration);Platform=Any CPU"
BuildInParallel="$(BuildInParallel)"
BuildInParallel="$(BuildInParallel)"
ContinueOnError="false" />

<CallTarget Targets="CodeSignBinaries" Condition=" '$(CodeSign)' == 'true' " />

<Message Importance="high" Text="Building Setup..." />-->

<!--<MSBuild
Projects="@(SetupSln)"
Targets="Build"
Properties="Configuration=$(Configuration);Platform=Any CPU"
ContinueOnError="false"
ContinueOnError="false"
Condition=" '$(Scope)' == 'all' "/>
<CallTarget Targets="CodeSignInstaller"

<CallTarget Targets="CodeSignInstaller"
Condition=" '$(CodeSign)' == 'true' and '$(Scope)' == 'all'" /> -->
</Target>
<!--TODO: once CLU stablizes, see whether we need invoke 'clean' target.

<!--TODO: once CLU stablizes, see whether we need invoke 'clean' target.
Dnx uses dynamic compilation, 'clean' is unnecessary -->
<Target
Name="Full"
DependsOnTargets="Build;Test" />

<Target Name="BuildMsBuildTask" DependsOnTargets="RestoreNugetPackages">
<MSBuild Projects="$(LibraryToolsFolder)\BuildPackagesTask\Microsoft.Azure.Build.Tasks.csproj"
Targets="Build" Properties="Configuration=Debug;Platform=AnyCPU" />
</Target>

<UsingTask TaskName="ValidateStrongNameSignatureTask" AssemblyFile="$(LibraryToolsFolder)\Microsoft.Azure.Build.Tasks.dll" />
<UsingTask TaskName="FilterOutAutoRestLibraries" AssemblyFile="$(LibraryToolsFolder)\Microsoft.Azure.Build.Tasks.dll" />
<UsingTask TaskName="FilterOutAutoRestLibraries" AssemblyFile="$(LibraryToolsFolder)\Microsoft.Azure.Build.Tasks.dll" />

<Target Name="CodeSignBinaries">
<PropertyGroup>
<!--public token associated with MSSharedLibKey.snk-->
Expand All @@ -202,28 +202,28 @@
</GetFrameworkSdkPath>

<!-- Copying shortcut to be signed -->
<Copy SourceFiles="$(LibraryRoot)tools\AzureRM\AzureRM.psd1"
<Copy SourceFiles="$(LibraryRoot)tools\AzureRM\AzureRM.psd1"
DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)" />
<Copy SourceFiles="$(LibraryRoot)tools\AzureRM\AzureRM.psm1"
<Copy SourceFiles="$(LibraryRoot)tools\AzureRM\AzureRM.psm1"
DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)" />

<ItemGroup>
<DelaySignedAssembliesToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft*Azure*Commands*.dll" />
<DelaySignedAssembliesToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft.Azure.Common.Extensions.dll" />
<ScriptsToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\*.ps1" />
<ScriptsToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\*.psm1" />
<ScriptsToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\*.ps1xml" />
</ItemGroup>
<Message Importance="high" Text="$(LibrarySourceFolder)\Package\$(Configuration) does not contains any files to sign. Code sign will skip."

<Message Importance="high" Text="$(LibrarySourceFolder)\Package\$(Configuration) does not contains any files to sign. Code sign will skip."
Condition="'@(DelaySignedAssembliesToSign)' == ''" />

<ValidateStrongNameSignatureTask
WindowsSdkPath="$(WindowsSdkPath)"
Assembly="%(DelaySignedAssembliesToSign.Identity)"
ExpectedTokenSignature="$(StrongNameToken)"
ExpectedDelaySigned="true"
ContinueOnError="false"
ContinueOnError="false"
Condition="'@(DelaySignedAssembliesToSign)' != ''"/>

<CodeSigningTask
Expand All @@ -236,7 +236,7 @@
SigningLogPath="$(LibraryRoot)\signing.log"
ToolsPath="$(CIToolsPath)"
Condition="!$(DelaySign) and '@(DelaySignedAssembliesToSign)' != ''"/>

<CodeSigningTask
Description="Microsoft Azure PowerShell"
Keywords="Microsoft Azure PowerShell"
Expand All @@ -246,23 +246,23 @@
Certificates="10006"
SigningLogPath="$(LibraryRoot)\signing-scripts.log"
ToolsPath="$(CIToolsPath)"
Condition="!$(DelaySign) and '@(ScriptsToSign)' != ''"/>
Condition="!$(DelaySign) and '@(ScriptsToSign)' != ''"/>

<ValidateStrongNameSignatureTask
WindowsSdkPath="$(WindowsSdkPath)"
Assembly="%(DelaySignedAssembliesToSign.Identity)"
ExpectedTokenSignature="$(StrongNameToken)"
ExpectedDelaySigned="false"
ContinueOnError="false"
ContinueOnError="false"
Condition="!$(DelaySign) and '@(DelaySignedAssembliesToSign)' != ''"/>

<!-- Copying signed shortcut back -->
<Copy SourceFiles="$(LibrarySourceFolder)\Package\$(Configuration)\AzureRM.psd1"
<Copy SourceFiles="$(LibrarySourceFolder)\Package\$(Configuration)\AzureRM.psd1"
DestinationFolder="$(LibraryRoot)tools\AzureRM" />
<Copy SourceFiles="$(LibrarySourceFolder)\Package\$(Configuration)\AzureRM.psm1"
<Copy SourceFiles="$(LibrarySourceFolder)\Package\$(Configuration)\AzureRM.psm1"
DestinationFolder="$(LibraryRoot)tools\AzureRM" />
</Target>

<Target Name="CodeSignInstaller">
<PropertyGroup>
<!--public token associated with MSSharedLibKey.snk-->
Expand All @@ -275,8 +275,8 @@
<ItemGroup>
<InstallersToSign Include="$(LibraryRoot)\setup*\build\**\*.msi" />
</ItemGroup>
<Message Importance="high" Text="$(LibraryRoot)\setup does not contains any installers to sign. Code sign will skip."

<Message Importance="high" Text="$(LibraryRoot)\setup does not contains any installers to sign. Code sign will skip."
Condition="'@(InstallersToSign)' == ''" />

<CodeSigningTask
Expand All @@ -287,12 +287,12 @@
SigningLogPath="$(LibraryRoot)\msi-signing.log"
Certificates="10006"
ToolsPath="$(CIToolsPath)"
Condition="!$(DelaySign) and '@(InstallersToSign)' != ''"/>
Condition="!$(DelaySign) and '@(InstallersToSign)' != ''"/>

<!--If we are testing locally then we copy the binaries and do not submit to the code sign server-->
<Copy SourceFiles="@(InstallersToSign)" DestinationFolder="signed" Condition="$(DelaySign)" />
</Target>

<!-- Publish all packages -->
<Target Name="Publish">
<Error Condition=" '$(NuGetKey)' == '' " Text="You must provide the NuGetKey parameter to the build: /p:NuGetKey=YOUR_PUBLISHING_KEY" />
Expand All @@ -304,29 +304,28 @@
<RunTestLive Condition="'$(RunTestLive)' == ''">false</RunTestLive>
<XUnitIncludedTrait Condition="!$(RunTestLive)">AcceptanceType=CheckIn</XUnitIncludedTrait>
</PropertyGroup>

<!-- Note: all testing related target should go to 'AzurePowershell.test.targets' file except the one used by CI run -->
<Import Project="$(MSBuildThisFileDirectory)AzurePowershell.test.targets"/>

<!-- Run checkin tests for each pull request -->
<Target Name="Test" DependsOnTargets="BeforeRunTests">
<Message Importance="high" Text="Running check in tests..." />
<ItemGroup>
<!--Exclude 1 test projects still in progress with build failures-->
<_CLUTestProjects Include="$(CLURootDir)\*.Test\project.json"
Exclude="$(CLURootDir)\Microsoft.Azure.Commands.Resources.Test\project.json">
<_CLUTestProjects Include="$(CLURootDir)\*.Test\project.json">
</_CLUTestProjects>
</ItemGroup>
<Exec Command="dnu build" WorkingDirectory="%(_CLUTestProjects.RootDir)%(_CLUTestProjects.Directory)" />
<Exec Command="dnx test" WorkingDirectory="%(_CLUTestProjects.RootDir)%(_CLUTestProjects.Directory)" />
<!--<CallTarget Targets="InvokeXUnit"/>-->
</Target>

<!-- Run Full switch with scenario tests -->
<Target
Name="FullWithScenarioTests"
DependsOnTargets="Clean;Build;Test;RunOneSDKCIT" />

<!-- Run live tests and record mocks -->
<Target
Name="RunLiveTests"
Expand Down

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions src/CLU/Commands.Common/Properties/launchSettings.json

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion src/CLU/Commands.ResourceManager.Cmdlets/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"System.Threading": "4.0.11-beta-23516",
"System.Threading.Tasks": "4.0.11-beta-23516",
"System.Threading.Thread": "4.0.0-beta-23516",
"Microsoft.Azure.Management.Resources": "3.1.1-preview",
"Microsoft.Azure.Management.Resources": "3.3.0-preview",
"Microsoft.Extensions.Caching.Memory": "1.0.0-rc1-final"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Microsoft.Azure.Management.Resources.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;

namespace Microsoft.Azure.Commands.ScenarioTest
{
public static class PageExtensions
{
public static void SetItemValue<T> (this Page<T> pagableObj, List<T> collection) {
var property = typeof(Page<T>).GetProperty("Items", BindingFlags.Instance | BindingFlags.NonPublic);
property.SetValue(pagableObj, collection);
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"Commands.Common": "",
"Commands.Common.Authentication": "",
"Commands.ResourceManager.Common": "",
"Microsoft.Azure.Management.Resources": "3.1.1-preview",
"Microsoft.Azure.Management.Resources": "3.3.0-preview",
"Microsoft.IdentityModel.Clients.ActiveDirectory": "3.6.210231457-alpha",
"Microsoft.Rest.ClientRuntime": "1.5.0",
"Microsoft.Rest.ClientRuntime.Azure": "2.1.0",
Expand Down

This file was deleted.

This file was deleted.

Loading