Skip to content

Commit 70fae4b

Browse files
author
Aashish Rajaram Salokhe
committed
Merge remote-tracking branch 'upstream/master'
2 parents c9f70e4 + 7b55679 commit 70fae4b

File tree

450 files changed

+2839661
-1104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

450 files changed

+2839661
-1104
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Azure PowerShell specific
2+
Net472Tests/
23
artifacts/
34
src/Stack/
45
src/local-artifacts/*

build.proj

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,20 @@
4848
<LibraryRoot>$(MSBuildThisFileDirectory)</LibraryRoot>
4949
<LibrarySourceFolder>$(LibraryRoot)src</LibrarySourceFolder>
5050
<LibraryToolsFolder>$(LibraryRoot)tools</LibraryToolsFolder>
51-
<LocalFeedFolder>$(LibraryToolsFolder)\LocalFeed</LocalFeedFolder>
51+
<LibraryArtifactsFolder>$(LibraryRoot)artifacts</LibraryArtifactsFolder>
52+
<LocalFeedFolder>$(LibraryToolsFolder)/LocalFeed</LocalFeedFolder>
5253
<Configuration Condition=" '$(Configuration)' != 'Release'">Debug</Configuration>
5354
<CodeSign>false</CodeSign>
5455
<!--Set this true only if you want to test the code sign workflow locally-->
5556
<DelaySign Condition =" '$(DelaySign)' == '' ">false</DelaySign>
5657
<SignedOutputRootDir>$(LibraryRoot)signed</SignedOutputRootDir>
57-
<PackageDirectory>$(LibraryRoot)\artifacts</PackageDirectory>
58-
<TestOutputDirectory>$(PackageDirectory)\Test</TestOutputDirectory>
58+
<PackageDirectory>$(LibraryRoot)artifacts</PackageDirectory>
59+
<TestOutputDirectory>$(PackageDirectory)/Test</TestOutputDirectory>
5960
<BuildInParallel Condition="'$(BuildInParallel)' == ''">true</BuildInParallel>
6061
<NuGetPublishingSource Condition=" '$(NuGetPublishingSource)' == '' ">$(LibrarySourceFolder)</NuGetPublishingSource>
6162
<Scope Condition="$(Scope) == ''" >All</Scope>
62-
<BuildTasksPath>$(LibraryToolsFolder)\BuildPackagesTask\Microsoft.Azure.Build.Tasks\bin\$(Configuration)</BuildTasksPath>
63-
<StackPackageFolder>$(LibrarySourceFolder)\Stack</StackPackageFolder>
63+
<BuildTasksPath>$(LibraryToolsFolder)/BuildPackagesTask/Microsoft.Azure.Build.Tasks/bin/$(Configuration)</BuildTasksPath>
64+
<StackPackageFolder>$(LibrarySourceFolder)/Stack</StackPackageFolder>
6465
<NetCore Condition="'$(NetCore)' != 'true'">false</NetCore>
6566
</PropertyGroup>
6667

@@ -130,7 +131,7 @@
130131
<Message Importance="high" Text="Cleaning Cmdlets..." />
131132

132133
<!-- Clean out the NuGet cache -->
133-
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Remove-Item -Path (Join-Path ($env:USERPROFILE) .nuget packages) -Recurse -Force -Confirm:$false -ErrorAction Ignore&quot;" ContinueOnError="WarnAndContinue" IgnoreExitCode="true" />
134+
<Exec Command="dotnet nuget locals global-packages --clear" ContinueOnError="WarnAndContinue" IgnoreExitCode="true" />
134135

135136
<!-- Remove Package, Publish, bin, obj, and TestResults directories -->
136137
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Remove-Item -Path $(PackageDirectory) -Recurse -Force -Confirm:$false -ErrorAction Ignore&quot;" ContinueOnError="WarnAndContinue" IgnoreExitCode="true" />
@@ -378,10 +379,14 @@
378379
<PropertyGroup Condition="'$(ExcludeAuthenticators)' == 'true'">
379380
<AuthenticatorExclusions>$(LibraryRoot)src/**/Authenticators.csproj;</AuthenticatorExclusions>
380381
</PropertyGroup>
382+
<PropertyGroup Condition="'$(Framework)' == ''">
383+
<Framework>netcoreapp2.0</Framework>
384+
</PropertyGroup>
381385

382386
<CallTarget Targets="BinScopeCheck" Condition="'$(OnPremiseBuild)'" />
383387
<CallTarget Targets="RunPoliCheck" Condition="'$(OnPremiseBuild)'" />
384388

389+
<Message Importance="High" Text="Creating test output directory at '$(TestOutputDirectory)'" />
385390
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
386391
<Exec Command="dotnet new sln -n Azure.PowerShell --force" />
387392
<ItemGroup>
@@ -397,15 +402,41 @@
397402
<Exec Command="dotnet sln Azure.PowerShell.sln add $(LibraryRoot)tools/ScenarioTest.ResourceManager/ScenarioTest.ResourceManager.csproj $(LibraryRoot)tools/TestFx/TestFx.csproj" />
398403
<!-- https://github.com/Microsoft/msbuild/issues/3157#issuecomment-378002971 -->
399404
<!-- https://github.com/xunit/xunit/issues/1154#issuecomment-405366373 -->
400-
<Exec Command="dotnet test Azure.PowerShell.sln --filter &quot;AcceptanceType=CheckIn%26RunType!=DesktopOnly&quot; --configuration $(Configuration) --framework netcoreapp2.0 --logger trx" />
405+
<Exec Command="dotnet test Azure.PowerShell.sln --filter &quot;AcceptanceType=CheckIn%26RunType!=DesktopOnly&quot; --configuration $(Configuration) --framework netcoreapp2.0 --logger trx --results-directory &quot;$(TestOutputDirectory)&quot;" />
406+
407+
<OnError ExecuteTargets="TestFailureErrorMessage" />
408+
</Target>
401409

410+
<Target Name="TestNet472">
411+
<Message Importance="high" Text="Running check in tests..." />
412+
<PropertyGroup>
413+
<AuthExclusions>$(LibraryRoot)src/**/Authenticators.csproj;</AuthExclusions>
414+
<AutomationExclusions>$(LibraryRoot)src/**/Automation.Test.csproj;</AutomationExclusions>
415+
<StorageExclusions>$(LibraryRoot)src/**/Storage.Test.csproj;</StorageExclusions>
416+
</PropertyGroup>
417+
418+
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
419+
<Exec Command="dotnet new sln -n Azure.PowerShell --force" />
402420
<ItemGroup>
403-
<TestResults Include="$(LibraryRoot)src/**/TestResults/*.trx" />
421+
<ModuleCsprojFiles Include="$(LibraryRoot)src/**/*.csproj" Exclude="$(AuthExclusions);$(AutomationExclusions);$(StorageExclusions)"/>
404422
</ItemGroup>
405-
<Copy SourceFiles="@(TestResults)" DestinationFolder="$(TestOutputDirectory)" />
406-
423+
<!-- https://stackoverflow.com/a/35477012/294804 -->
424+
<ItemGroup>
425+
<ModuleCsprojFilesRelative Include="@(ModuleCsprojFiles)">
426+
<RelativePath>$([MSBuild]::MakeRelative($(LibraryRoot), %(ModuleCsprojFiles.FullPath)))</RelativePath>
427+
</ModuleCsprojFilesRelative>
428+
</ItemGroup>
429+
<Exec Command="dotnet sln Azure.PowerShell.sln add @(ModuleCsprojFilesRelative->'%(RelativePath)', ' ')" />
430+
<Exec Command="dotnet sln Azure.PowerShell.sln add $(LibraryRoot)tools/ScenarioTest.ResourceManager/ScenarioTest.ResourceManager.csproj $(LibraryRoot)tools/TestFx/TestFx.csproj" />
431+
<!-- https://github.com/Microsoft/msbuild/issues/3157#issuecomment-378002971 -->
432+
<!-- https://github.com/xunit/xunit/issues/1154#issuecomment-405366373 -->
433+
<Exec Command="dotnet build Azure.PowerShell.sln --configuration $(Configuration)" />
434+
<Exec Command="dotnet new console -n Net472Tests" />
435+
<Exec Command="dotnet add Net472Tests package xunit.runner.console --version 2.4.0" />
436+
<Exec Command="dotnet restore --packages ./artifacts/tools -f --no-cache Net472Tests" />
437+
<Exec Command="$(PowerShellCommandPrefix) &quot;$(LibraryToolsFolder)/TestNet472Modules.ps1 -TestExecPath '$(LibraryArtifactsFolder)/tools/xunit.runner.console/2.4.0/tools/net472/xunit.console.exe' &quot;" />
407438
<OnError ExecuteTargets="TestFailureErrorMessage" />
408-
</Target>
439+
</Target>
409440

410441
<Target Name="TestFailureErrorMessage">
411442
<Error Text="Test failures occured, check the files in artifacts/Test" />
@@ -429,4 +460,4 @@
429460
<Error Text="PoliCheck failed with a Severity 1 issue, please check the report at in artifacts/PoliCheck-Scan.html" />
430461
</Target>
431462

432-
</Project>
463+
</Project>

0 commit comments

Comments
 (0)