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

Update test code from .net core 2.1 to 3.1 #6486

Merged
merged 5 commits into from
Jan 6, 2022
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
7 changes: 7 additions & 0 deletions build/AzurePipelinesTemplates/MUX-BuildProject-Steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ steps:
echo parameters.buildOutputDir = '${{ parameters.buildOutputDir }}'
displayName: 'BuildProject: Display parameters'

- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
version: 3.1.415
installationPath: $(Agent.ToolsDirectory)/dotnet

- template: MUX-InstallWindowsSDK-Steps.yml

- template: MUX-InstallNuget-Steps.yml
Expand Down
16 changes: 1 addition & 15 deletions build/CopyFilesToStagingDir.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,7 @@ PublishFile -IfExists $FullBuildOutput\Microsoft.UI.Xaml\sdk\Microsoft.UI.Xaml.w
PublishFile -IfExists $FullBuildOutput\Microsoft.UI.Xaml\Generic.xaml $FullPublishDir\Microsoft.UI.Xaml\
PublishFile -IfExists $FullBuildOutput\Microsoft.UI.Xaml.Design\Microsoft.UI.Xaml.Design.dll $FullPublishDir\Microsoft.UI.Xaml.Design\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\Microsoft.UI.Xaml.FrameworkPackagePRI\Microsoft.UI.Xaml.pri $FullPublishDir\Microsoft.UI.Xaml.FrameworkPackagePRI\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.Test.TAEF\MUXControls.Test.dll $FullPublishDir\Test\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.Test.TAEF\MUXTestInfra.TAEF.dll $FullPublishDir\Test\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.Test.TAEF\Microsoft.Win32.Registry.dll $FullPublishDir\Test\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.Test.TAEF\Axe.Windows.Actions.dll $FullPublishDir\Test\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.Test.TAEF\Axe.Windows.Automation.dll $FullPublishDir\Test\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.Test.TAEF\Axe.Windows.Core.dll $FullPublishDir\Test\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.Test.TAEF\Axe.Windows.Desktop.dll $FullPublishDir\Test\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.Test.TAEF\Axe.Windows.Rules.dll $FullPublishDir\Test\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.Test.TAEF\Axe.Windows.RuleSelection.dll $FullPublishDir\Test\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.Test.TAEF\Axe.Windows.SystemAbstractions.dll $FullPublishDir\Test\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.Test.TAEF\Axe.Windows.Telemetry.dll $FullPublishDir\Test\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.Test.TAEF\Axe.Windows.Win32.dll $FullPublishDir\Test\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.Test.TAEF\Newtonsoft.Json.dll $FullPublishDir\Test\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.Test.TAEF\System.Drawing.Common.dll $FullPublishDir\Test\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.Test.TAEF\System.IO.Packaging.dll $FullPublishDir\Test\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.Test.TAEF\*.dll $FullPublishDir\Test\
PublishFile -IfExists $FullBuildOutput\Microsoft.UI.Xaml\WebView2Loader.dll $FullPublishDir\Test\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.ReleaseTest.TAEF\MUXControls.ReleaseTest.dll $FullPublishDir\Test\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.ReleaseTest.TAEF\WebView2Loader.dll $FullPublishDir\Test\
Expand Down
25 changes: 5 additions & 20 deletions build/Helix/PrepareHelixPayload.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $winuiHelixVer = $pkgVerData.SelectSingleNode("//packages/package[@id=`"Microsof
$mitaVer = $pkgVerData.SelectSingleNode("//packages/package[@id=`"microsoft.windows.apps.test`"]").version
$taefVer = $pkgVerData.SelectSingleNode("//packages/package[@id=`"TAEF.Redist.Wlk`"]").version
$muxcustomBuildTasksVer = $pkgVerData.SelectSingleNode("//packages/package[@id=`"MUXCustomBuildTasks`"]").version
$netCoreAppVer = $pkgVerData.SelectSingleNode("//packages/package[@id=`"runtime.win-$Platform.microsoft.netcore.app`"]").version
$netCoreAppVer = $pkgVerData.SelectSingleNode("//packages/package[@id=`"Microsoft.NETCore.App.Runtime.win-$Platform`"]").version

Write-Host "winuiHelixVer = $winuiHelixVer"
Write-Host "mitaVer = $mitaVer"
Expand All @@ -38,12 +38,11 @@ Write-Host "netCoreAppVer = $netCoreAppVer"

# Copy files from nuget packages
Copy-Item "$nugetPackagesDir\Microsoft.Internal.WinUI.Helix.$winuiHelixVer\scripts\test\*" $payloadDir
Copy-Item "$nugetPackagesDir\microsoft.windows.apps.test.$mitaVer\lib\netcoreapp2.1\*.dll" $payloadDir
Copy-Item "$nugetPackagesDir\taef.redist.wlk.$taefVer\build\Binaries\$Platform\*" $payloadDir
Copy-Item "$nugetPackagesDir\taef.redist.wlk.$taefVer\build\Binaries\$Platform\CoreClr\*" $payloadDir
New-Item -ItemType Directory -Force -Path "$payloadDir\.NETCoreApp2.1\"
Copy-Item "$nugetPackagesDir\runtime.win-$Platform.microsoft.netcore.app.$netCoreAppVer\runtimes\win-$Platform\lib\netcoreapp2.1\*" "$payloadDir\.NETCoreApp2.1\"
Copy-Item "$nugetPackagesDir\runtime.win-$Platform.microsoft.netcore.app.$netCoreAppVer\runtimes\win-$Platform\native\*" "$payloadDir\.NETCoreApp2.1\"
New-Item -ItemType Directory -Force -Path "$payloadDir\.netcoreapp3.1\"
Copy-Item "$nugetPackagesDir\Microsoft.NETCore.App.Runtime.win-$Platform.$netCoreAppVer\runtimes\win-$Platform\lib\netcoreapp3.1\*" "$payloadDir\.netcoreapp3.1\"
Copy-Item "$nugetPackagesDir\Microsoft.NETCore.App.Runtime.win-$Platform.$netCoreAppVer\runtimes\win-$Platform\native\*" "$payloadDir\.netcoreapp3.1\"
Copy-Item "$nugetPackagesDir\MUXCustomBuildTasks.$muxcustomBuildTasksVer\tools\$platform\WttLog.dll" $payloadDir

function Copy-If-Exists
Expand Down Expand Up @@ -81,21 +80,7 @@ function Copy-Recursively-If-Exists
}

# Copy files from the 'drop' artifact dir
Copy-Item "$repoDirectory\Artifacts\$ArtifactName\$Configuration\$Platform\Test\MUXControls.Test.dll" $payloadDir
Copy-Item "$repoDirectory\Artifacts\$ArtifactName\$Configuration\$Platform\Test\Microsoft.Win32.Registry.dll" "$payloadDir\.NETCoreApp2.1\"
Copy-Item "$repoDirectory\Artifacts\$ArtifactName\$Configuration\$Platform\Test\Axe.Windows.Actions.dll" "$payloadDir\.NETCoreApp2.1\"
Copy-Item "$repoDirectory\Artifacts\$ArtifactName\$Configuration\$Platform\Test\Axe.Windows.Automation.dll" "$payloadDir\.NETCoreApp2.1\"
Copy-Item "$repoDirectory\Artifacts\$ArtifactName\$Configuration\$Platform\Test\Axe.Windows.Core.dll" "$payloadDir\.NETCoreApp2.1\"
Copy-Item "$repoDirectory\Artifacts\$ArtifactName\$Configuration\$Platform\Test\Axe.Windows.Desktop.dll" "$payloadDir\.NETCoreApp2.1\"
Copy-Item "$repoDirectory\Artifacts\$ArtifactName\$Configuration\$Platform\Test\Axe.Windows.Rules.dll" "$payloadDir\.NETCoreApp2.1\"
Copy-Item "$repoDirectory\Artifacts\$ArtifactName\$Configuration\$Platform\Test\Axe.Windows.RuleSelection.dll" "$payloadDir\.NETCoreApp2.1\"
Copy-Item "$repoDirectory\Artifacts\$ArtifactName\$Configuration\$Platform\Test\Axe.Windows.SystemAbstractions.dll" "$payloadDir\.NETCoreApp2.1\"
Copy-Item "$repoDirectory\Artifacts\$ArtifactName\$Configuration\$Platform\Test\Axe.Windows.Telemetry.dll" "$payloadDir\.NETCoreApp2.1\"
Copy-Item "$repoDirectory\Artifacts\$ArtifactName\$Configuration\$Platform\Test\Axe.Windows.Win32.dll" "$payloadDir\.NETCoreApp2.1\"
Copy-Item "$repoDirectory\Artifacts\$ArtifactName\$Configuration\$Platform\Test\Newtonsoft.Json.dll" "$payloadDir\.NETCoreApp2.1\"
Copy-Item "$repoDirectory\Artifacts\$ArtifactName\$Configuration\$Platform\Test\System.Drawing.Common.dll" "$payloadDir\.NETCoreApp2.1\"
Copy-Item "$repoDirectory\Artifacts\$ArtifactName\$Configuration\$Platform\Test\System.IO.Packaging.dll" "$payloadDir\.NETCoreApp2.1\"
Copy-Item "$repoDirectory\Artifacts\$ArtifactName\$Configuration\$Platform\Test\MUXTestInfra.TAEF.dll" $payloadDir
Copy-Item "$repoDirectory\Artifacts\$ArtifactName\$Configuration\$Platform\Test\*.dll" $payloadDir
Copy-If-Exists "$repoDirectory\Artifacts\$ArtifactName\$Configuration\$Platform\Test\MUXExperimental.Test.dll" $payloadDir
Copy-If-Exists "$repoDirectory\Artifacts\$ArtifactName\$Configuration\$Platform\Test\WebView2Loader.dll" $payloadDir
Copy-If-Exists "$repoDirectory\Artifacts\$ArtifactName\$Configuration\$Platform\AppxPackages\MUXControlsTestApp_Test\*" $payloadDir
Expand Down
5 changes: 2 additions & 3 deletions build/Helix/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
<packages>
<package id="MUXCustomBuildTasks" version="1.0.74" targetFramework="native" />
<package id="TAEF.Redist.Wlk" version="10.31.180822002" targetFramework="native" />
<package id="microsoft.windows.apps.test" version="1.0.181203002" targetFramework="native" />
<package id="runtime.win-x86.microsoft.netcore.app" version="2.1.0" targetFramework="native" />
<package id="runtime.win-x64.microsoft.netcore.app" version="2.1.0" targetFramework="native" />
<package id="Microsoft.NETCore.App.Runtime.win-x64" version="3.1.21" targetFramework="native" />
<package id="Microsoft.NETCore.App.Runtime.win-x86" version="3.1.21" targetFramework="native" />
<package id="Microsoft.Internal.WinUI.Helix" version="0.0.2.4" targetFramework="native" />
</packages>
4 changes: 2 additions & 2 deletions test/MUXControls.Test/MSTest/MUXControls.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v2.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.1</TargetFrameworkVersion>
<RuntimeIdentifiers>win-x86;win-x64;win-arm;win-arm64</RuntimeIdentifiers>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
Expand Down
57 changes: 12 additions & 45 deletions test/MUXControls.Test/TAEF/MUXControls.Test.TAEF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,16 @@
<DefineConstants>$(DefineConstants);USING_TAEF</DefineConstants>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v2.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.1</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<RuntimeIdentifiers>win-x86;win-x64;win-arm;win-arm64</RuntimeIdentifiers>
<!-- The binaries we're building against are managed, so which platform's folder they come out of is immaterial.
For simplicity's sake, we'll always get them from the x86 folder, but the CoreClr binaries are the same everywhere. -->
<TaefRootDirectory>$(NuGetPackageRoot)taef.redist.wlk\10.31.180822002\build\Binaries\x86\CoreClr\</TaefRootDirectory>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Axe.Windows" Version="1.0.4" GeneratePathProperty="True"/>
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1018-prerelease" />
</ItemGroup>
<ItemGroup>
<Reference Include="TE.Managed">
<HintPath>$(TaefRootDirectory)TE.Managed.dll</HintPath>
Expand All @@ -35,46 +30,18 @@
<HintPath>$(TaefRootDirectory)Wex.Logger.Interop.dll</HintPath>
</Reference>
</ItemGroup>
<!-- If we include the razzle includes in the csproj, VS raises warnings about referenced components not being found even if
it's gated with the condition that we're building with build.exe. To avoid that, we'll add the razzle includes
in a props file that is only included when we're building with build.exe, which makes VS never see them.
Similarly, the non-razzle includes confuse the razzle MSBuild, even though it's marked with a condition that should
cause it to be excluded. -->
<Import Project="RazzleIncludes.props" Condition="$(BuildingWithBuildExe) == 'true'" />
<Import Project="NonRazzleIncludes.props" Condition="$(BuildingWithBuildExe) != 'true'" />

<ItemGroup>
<PackageReference Include="Axe.Windows" Version="1.0.4" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1018-prerelease" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
<PackageReference Include="Microsoft.Windows.Apps.Test" Version="1.0.181205002" />
<PackageReference Include="TAEF.Redist.Wlk" Version="10.31.180822002" />
</ItemGroup>

<Import Project="..\MUXControls.Test.Shared.projitems" />
<ItemGroup>
<ProjectReference Include="..\..\testinfra\MUXTestInfra\TAEF\MUXTestInfra.TAEF.csproj" />
</ItemGroup>
<Import Project="..\MUXControls.Test.Shared.targets" />
<!-- Sdk="Microsoft.NET.Sdk" doesn't do anything in Razzle, so we need to manually include the C# targets file there. -->
<Import Project="$(CSharpTargetsFilePath)" Condition="$(BuildingWithBuildExe) == 'true'" />
<Import Project="$(NTMAKEENV)\UniversalTest\Microsoft.TestInfrastructure.UniversalTest.props" Condition="$(BuildingWithBuildExe) == 'true'" />
<Target Name="Binplace"
AfterTargets="Build"
Outputs="@(BinplaceItemCopied)">
<ItemGroup>
<BinplaceItem Include="$(PkgMicrosoft_Win32_Registry)\runtimes\win\lib\netstandard2.0\Microsoft.Win32.Registry.dll" />
<BinplaceItem Include="$(NuGetPackageRoot)\axe.windows\1.0.4\lib\netstandard20\Axe.Windows.Automation.dll" />
<BinplaceItem Include="$(NuGetPackageRoot)\axe.windows\1.0.4\lib\netstandard20\Axe.Windows.Actions.dll" />
<BinplaceItem Include="$(NuGetPackageRoot)\axe.windows\1.0.4\lib\netstandard20\Axe.Windows.Core.dll" />
<BinplaceItem Include="$(NuGetPackageRoot)\axe.windows\1.0.4\lib\netstandard20\Axe.Windows.Desktop.dll" />
<BinplaceItem Include="$(NuGetPackageRoot)\axe.windows\1.0.4\lib\netstandard20\Axe.Windows.Rules.dll" />
<BinplaceItem Include="$(NuGetPackageRoot)\axe.windows\1.0.4\lib\netstandard20\Axe.Windows.RuleSelection.dll" />
<BinplaceItem Include="$(NuGetPackageRoot)\axe.windows\1.0.4\lib\netstandard20\Axe.Windows.SystemAbstractions.dll" />
<BinplaceItem Include="$(NuGetPackageRoot)\axe.windows\1.0.4\lib\netstandard20\Axe.Windows.Telemetry.dll" />
<BinplaceItem Include="$(NuGetPackageRoot)\axe.windows\1.0.4\lib\netstandard20\Axe.Windows.Win32.dll" />
<BinplaceItem Include="$(NuGetPackageRoot)\newtonsoft.json\12.0.3\lib\netstandard2.0\Newtonsoft.Json.dll" />
<BinplaceItem Include="$(NuGetPackageRoot)\system.drawing.common\4.7.0\runtimes\win\lib\netcoreapp2.0\System.Drawing.Common.dll" />
<BinplaceItem Include="$(NuGetPackageRoot)\system.io.packaging\4.7.0\lib\netstandard2.0\System.IO.Packaging.dll" />
</ItemGroup>
<PropertyGroup>
<BinplaceDestination>$(OutDir)</BinplaceDestination>
</PropertyGroup>
<Copy SourceFiles="@(BinplaceItem)"
DestinationFiles="@(BinplaceItem->'$(BinplaceDestination)\%(Destination)\%(RecursiveDir)%(Filename)%(Extension)')"
SkipUnchangedFiles="true">
<Output TaskParameter="CopiedFiles" ItemName="BinplaceItemCopied" />
</Copy>
</Target>
</Project>

This file was deleted.

9 changes: 0 additions & 9 deletions test/MUXControls.Test/TAEF/NonRazzleIncludes.props

This file was deleted.

Loading