未验证 提交 eb9a5ab0 编写于 作者: V Viktor Hofer 提交者: GitHub

Run libraries package testing on build agent (#53905)

* Run libraries package testing on build agent

instead of on Helix as with recent changes the entire package testing
doesn't take more than 2 minutes. Helix created a work item per package
test even though it only took seconds and the average wait time for
a client was 10-15min.

Also cleaning up how the generated package test projects are restored
and incorporating a fix from Eric St John to not hard code the package
feeds.

* Expose useHelix argument
上级 197cfb60
......@@ -7,7 +7,6 @@
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Packaging" Version="$(MicrosoftDotNetBuildTasksPackagingVersion)" />
<PackageReference Include="Microsoft.DotNet.PackageTesting" Version="$(MicrosoftDotNetPackageTestingVersion)" />
<!-- enable source link in pkgproj -->
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
<PackageReference Include="Microsoft.SourceLink.AzureRepos.Git" Version="$(MicrosoftSourceLinkVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
......
......@@ -80,7 +80,6 @@ jobs:
- ${{ if eq(parameters.framework, 'allConfigurations') }}:
- _finalFrameworkArg: -allConfigurations
- _testModeArg: /p:TestAssemblies=false /p:TestPackages=true
- _extraHelixArguments: /p:TestPackages=true
- ${{ if eq(parameters.isOfficialAllConfigurations, true) }}:
- librariesBuildArtifactName: 'libraries_bin_official_allconfigurations'
......
......@@ -29,6 +29,7 @@ parameters:
variables: {}
pool: ''
runTests: false
useHelix: true
testScope: ''
testBuildPlatforms: []
......@@ -66,6 +67,7 @@ jobs:
variables:
- librariesTestsArtifactName: ${{ format('libraries_test_assets_{0}_{1}_{2}', parameters.osGroup, parameters.archType, parameters.buildConfig) }}
- _subset: libs
- _buildAction: ''
- _additionalBuildArguments: ''
- ${{ parameters.variables }}
......@@ -73,6 +75,9 @@ jobs:
# If platform is in testBuildPlatforms we build tests as well.
- ${{ if or(eq(parameters.runTests, true), containsValue(parameters.testBuildPlatforms, parameters.platform)) }}:
- _subset: libs+libs.tests
- ${{ if eq(parameters.useHelix, false) }}:
- _buildAction: -restore -build -test
- ${{ if eq(parameters.useHelix, true) }}:
- _additionalBuildArguments: /p:ArchiveTests=true
- ${{ parameters.variables }}
......@@ -92,6 +97,7 @@ jobs:
- script: $(_buildScript)
-subset $(_subset)
$(_buildAction)
$(_buildArguments)
$(_additionalBuildArguments)
displayName: Restore and Build Product
......@@ -136,7 +142,7 @@ jobs:
parameters:
name: Libraries_AllConfigurations
- ${{ if eq(parameters.runTests, true) }}:
- ${{ if and(eq(parameters.runTests, true), eq(parameters.useHelix, true)) }}:
- template: /eng/pipelines/libraries/helix.yml
parameters:
osGroup: ${{ parameters.osGroup }}
......
......@@ -128,7 +128,7 @@ jobs:
# windows x64
- ${{ if eq(parameters.platform, 'windows_x64') }}:
# netcoreapp
- ${{ if notIn(parameters.jobParameters.framework, 'allConfigurations', 'net48') }}:
- ${{ if notIn(parameters.jobParameters.framework, 'net48') }}:
- ${{ if and(eq(parameters.jobParameters.testScope, 'outerloop'), eq(parameters.jobParameters.runtimeFlavor, 'mono')) }}:
- Windows.81.Amd64.Open
- Windows.10.Amd64.Server19H1.Open
......@@ -152,14 +152,10 @@ jobs:
- ${{ if eq(parameters.jobParameters.framework, 'net48') }}:
- Windows.10.Amd64.Client19H1.Open
# AllConfigurations
- ${{ if eq(parameters.jobParameters.framework, 'allConfigurations') }}:
- Windows.10.Amd64.Server19H1.Open
# windows x86
- ${{ if eq(parameters.platform, 'windows_x86') }}:
# netcoreapp
- ${{ if notIn(parameters.jobParameters.framework, 'allConfigurations', 'net48') }}:
- ${{ if notIn(parameters.jobParameters.framework, 'net48') }}:
- ${{ if and(eq(parameters.jobParameters.testScope, 'outerloop'), eq(parameters.jobParameters.runtimeFlavor, 'mono')) }}:
- Windows.7.Amd64.Open
- Windows.10.Amd64.ServerRS5.Open
......
......@@ -758,11 +758,11 @@ jobs:
buildConfig: ${{ variables.debugOnPrReleaseOnRolling }}
platforms:
- windows_x64
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
jobParameters:
isFullMatrix: ${{ variables.isFullMatrix }}
framework: allConfigurations
runTests: true
useHelix: false
condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
......
<Project>
<PropertyGroup>
<DisableProjectRestore>true</DisableProjectRestore>
<DisableProjectRestore Condition="'$(MSBuildProjectName)' != 'testPackages'">true</DisableProjectRestore>
</PropertyGroup>
<Import Project="..\Directory.Build.props" />
......
<Project>
<Import Project="$(MSBuildThisFileDirectory)targetingpacks.targets" />
<Import Project="$(MSBuildThisFileDirectory)packageTest.targets" />
</Project>
<Project>
<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<RestoreUseStaticGraphEvaluation>true</RestoreUseStaticGraphEvaluation>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)Versions.props" />
<Import Project="Versions.props" />
<Import Project="netfxreference.props" />
</Project>
<Project>
<Import Project="targetingpacks.targets" />
<Import Project="packageTest.targets" />
</Project>
<Project>
<PropertyGroup>
<ImportDirectoryBuildProps>false</ImportDirectoryBuildProps>
<ImportDirectoryBuildTargets>false</ImportDirectoryBuildTargets>
<RestoreUseStaticGraphEvaluation>true</RestoreUseStaticGraphEvaluation>
<RestorePackagesPath>$(MSBuildThisFileDirectory)cache\</RestorePackagesPath>
</PropertyGroup>
<Import Project="Sdk.props" Sdk="Microsoft.Build.Traversal" />
<ItemGroup>
<ProjectReference Include="projects\**\*.csproj" />
</ItemGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.Build.Traversal" />
</Project>
\ No newline at end of file
......@@ -4,14 +4,6 @@
</PropertyGroup>
<PropertyGroup>
<RestoreSources>
https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json;
https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json;
https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json;
https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6-transport/nuget/v3/index.json;
$(LocalPackagesPath)
</RestoreSources>
<!-- Make sure the SDK raises the runtime items so that they are passed to conflict resolution -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<!-- Suppress any SYSLIB9000 errors, as in these cases restore/build would succeed, the failure would be at run-time -->
......@@ -38,7 +30,8 @@
</ItemGroup>
<Target Name="LogBeginTest">
<Target Name="LogBeginTest"
Condition="'$(TargetFramework)' != ''">
<Message Importance="High" Text="Testing $(TestPackageID) TFM=$(TargetFramework)" />
</Target>
......
<Project>
<Import Project="$(SupportFilesDir)netfxreference.props" />
<PropertyGroup>
<ShouldVerifyClosure>true</ShouldVerifyClosure>
<ShouldVerifyTypes>true</ShouldVerifyTypes>
......
<Project>
<Import Project="$(SupportFilesDir)netfxreference.props" />
<PropertyGroup>
<ShouldVerifyClosure>true</ShouldVerifyClosure>
<ShouldVerifyTypes>true</ShouldVerifyTypes>
......
<Project>
<PropertyGroup>
<DirectoryBuildPropsPath>$(SupportFilesDir)Directory.Build.props</DirectoryBuildPropsPath>
<DirectoryBuildTargetsPath>$(SupportFilesDir)Directory.Build.targets</DirectoryBuildTargetsPath>
</PropertyGroup>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>{TargetFrameworks}</TargetFrameworks>
<TestPackageId>{PackageId}</TestPackageId>
<!-- Restore settings -->
<RestorePackagesPath>{RestorePackagesPath}</RestorePackagesPath>
<RestoreAdditionalProjectSources>{RestoreAdditionalProjectSources}</RestoreAdditionalProjectSources>
<!-- Used in targetingpacks.targets -->
<NetCoreAppCurrentVersion>{NetCoreAppCurrentVersion}</NetCoreAppCurrentVersion>
<NetCoreAppCurrent>{NetCoreAppCurrent}</NetCoreAppCurrent>
<MicrosoftNetCoreAppFrameworkName>{MicrosoftNetCoreAppFrameworkName}</MicrosoftNetCoreAppFrameworkName>
<MicrosoftNetCoreAppRefPackDir>{MicrosoftNetCoreAppRefPackDir}</MicrosoftNetCoreAppRefPackDir>
<!-- Turn off end of life target framework checks as we intentionally build older .NETCoreApp configurations. -->
<CheckEolTargetFramework>false</CheckEolTargetFramework>
......@@ -24,5 +23,4 @@
<PackageReference Include="{PackageId}" Version="{PackageVersion}" />
</ItemGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
<Project DefaultTargets="Restore;Test">
<ItemGroup>
<PackagesToTest Condition="'$(PackagesToTest)' != ''" Include="$(PackagesToTest)" />
</ItemGroup>
<PropertyGroup>
<PackageTestProjectsDir Condition="'$(PackageTestProjectsDir)' == ''">$(MSBuildThisFileDirectory)..\projects</PackageTestProjectsDir>
<_projectProperties>SupportFilesDir=$(MSBuildThisFileDirectory);MicrosoftNetCoreAppRefPackDir=$(MicrosoftNetCoreAppRefPackDir)</_projectProperties>
<LocalPackagesPath Condition="'$(LocalPackagesPath)' == ''">$(MSBuildThisFileDirectory)\packages</LocalPackagesPath>
</PropertyGroup>
<Target Name="GetProjects">
<ItemGroup>
<Project Condition="'@(PackagesToTest)' == ''" Include="$(PackageTestProjectsDir)\**\*.csproj" />
<Project Condition="'@(PackagesToTest)' != ''" Include="$(PackageTestProjectsDir)\%(PackagesToTest.Identity)\**\*.csproj" />
</ItemGroup>
</Target>
<Target Name="Restore"
Inputs="@(Project)"
Outputs="@(Project->'%(RootDir)%(Directory)obj\project.assets.json')"
DependsOnTargets="GetProjects">
<MSBuild Projects="@(Project)" Targets="Restore" BuildInParallel="true" Properties="$(_projectProperties);LocalPackagesPath=$(LocalPackagesPath)" />
<Touch Files="@(Project->'%(RootDir)%(Directory)obj\project.assets.json')" />
</Target>
<Target Name="Test" DependsOnTargets="GetProjects">
<!-- We need to pass a dummy global property to force msbuild reevaluation after restoring the project to get implicit references added
and all generated props and targets imported in the test step. This is used to be able to call RestoreAndTest target when running in helix. -->
<MSBuild Projects="@(Project)" BuildInParallel="true" Properties="$(_projectProperties);ForceMsbuildEvaluation=true" />
</Target>
</Project>
\ No newline at end of file
<Project DefaultTargets="Build">
<Import Project="..\Directory.Build.props" />
<Project Sdk="Microsoft.Build.NoTargets">
<UsingTask TaskName="GetCompatiblePackageTargetFrameworks"
AssemblyFile="$(DotNetPackageTestingAssembly)"
Condition="'$(DotNetPackageTestingAssembly)' != ''" />
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.PackageTesting" Version="$(MicrosoftDotNetPackageTestingVersion)" />
<!-- Needed by packageTest.targets, could be moved into PackageTesting: https://github.com/dotnet/arcade/issues/7474. -->
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Packaging" Version="$(MicrosoftDotNetBuildTasksPackagingVersion)" />
</ItemGroup>
<PropertyGroup>
<PackageNamePattern>[a-zA-z\.]*\.</PackageNamePattern>
<TestDir>$(ArtifactsBinDir)testPackages\</TestDir>
<TestProjectDir>$(TestDir)projects\</TestProjectDir>
<TestPackageDir>$(TestDir)cache\</TestPackageDir>
<TestProjectName>dirs.proj</TestProjectName>
<ProjectTemplate>project.csproj.template</ProjectTemplate>
</PropertyGroup>
<ItemGroup>
......@@ -28,44 +43,28 @@
<TargetFrameworksToExclude Include="netcoreapp2.2" />
</ItemGroup>
<PropertyGroup>
<TestDir>$(ArtifactsBinDir)testPkg\</TestDir>
<TestSupportDir>$(TestDir)support\</TestSupportDir>
<TestProjectName>test.msbuild</TestProjectName>
<TestProject>$(TestSupportDir)$(TestProjectName)</TestProject>
<TestProjectDir>$(TestDir)projects\</TestProjectDir>
<TestPackageDir>$(ArtifactsBinDir)testPackages</TestPackageDir>
<TestDotNetPath>$(DotNetRoot)dotnet</TestDotNetPath>
<ProjectTemplate>project.csproj.template</ProjectTemplate>
</PropertyGroup>
<ItemGroup>
<!-- The main entry point file: test.msbuild -->
<TestSupportFile Include="$(TestProjectName)"
DestinationFolder="$(TestSupportDir)" />
<!-- The main entry point file. -->
<TestSupportFile Include="build\$(TestProjectName)"
DestinationFolder="$(TestDir)" />
<!-- msbuild support files and the packaging VerifyClosure assembly. -->
<TestSupportFile Include="$(RepositoryEngineeringDir)Versions.props;
<TestSupportFile Include="$(RepoRoot)global.json;
$(RepoRoot)NuGet.config;
$(RepositoryEngineeringDir)Versions.props;
$(RepositoryEngineeringDir)targetingpacks.targets;
$(LibrariesProjectRoot)shims\netfxreference.props;
packageTest.targets;
Directory.Build.props;
Directory.Build.targets"
DestinationFolder="$(TestSupportDir)" />
build\packageTest.targets;
build\Directory.Build.props;
build\Directory.Build.targets"
DestinationFolder="$(TestDir)" />
<TestSupportFile Include="$(PackagingTaskDir)..\..\**\*.*"
Exclude="$(PackagingTaskDir)..\..\*.*"
DestinationFolder="$(TestSupportDir)%(RecursiveDir)" />
DestinationFolder="$(TestDir)%(RecursiveDir)" />
<!-- frameworksettings and packagesettings -->
<TestSupportFile Include="frameworkSettings\**\*"
DestinationFolder="$(TestSupportDir)frameworkSettings\%(RecursiveDir)" />
DestinationFolder="$(TestDir)frameworkSettings\%(RecursiveDir)" />
<TestSupportFile Include="packageSettings\**\*"
DestinationFolder="$(TestSupportDir)packageSettings\%(RecursiveDir)" />
</ItemGroup>
<ItemGroup>
<CliEnvironment Include="DOTNET_CLI_TELEMETRY_OPTOUT=1" />
<CliEnvironment Include="DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1" />
<CliEnvironment Include="DOTNET_MULTILEVEL_LOOKUP=0" />
DestinationFolder="$(TestDir)packageSettings\%(RecursiveDir)" />
</ItemGroup>
<Target Name="CreateTestDir"
......@@ -75,8 +74,6 @@
<Copy SourceFiles="@(TestSupportFile)" DestinationFolder="%(TestSupportFile.DestinationFolder)" />
</Target>
<UsingTask TaskName="GetCompatiblePackageTargetFrameworks" AssemblyFile="$(DotNetPackageTestingAssembly)"/>
<Target Name="GetSupportedPackages">
<GetCompatiblePackageTargetFrameworks PackagePaths="@(TestPackagesPath)">
<Output TaskParameter="TestProjects" ItemName="SupportedPackage" />
......@@ -84,11 +81,10 @@
<ItemGroup>
<SupportedPackage>
<ProjectDir>$(TestProjectDir)%(Identity)/</ProjectDir>
<ProjectDir>$(TestProjectDir)%(Identity)\</ProjectDir>
</SupportedPackage>
<SupportedPackage>
<ProjectFile>%(ProjectDir)project.csproj</ProjectFile>
<AssetsFile>%(ProjectDir)obj/project.assets.json</AssetsFile>
</SupportedPackage>
</ItemGroup>
</Target>
......@@ -112,94 +108,36 @@
Inputs="@(TestPackagesPath);$(ProjectTemplate)"
Outputs="%(SupportedPackage.ProjectFile)">
<PropertyGroup>
<_projectDir>%(SupportedPackage.ProjectDir)/</_projectDir>
<_projectDir>%(SupportedPackage.ProjectDir)</_projectDir>
<_projectFile>%(SupportedPackage.ProjectFile)</_projectFile>
<_packageId>%(SupportedPackage.Identity)</_packageId>
<_packageVersion>%(SupportedPackage.Version)</_packageVersion>
<_projectTFMs>@(SupportedPackage->'%(TargetFrameworkShort)')</_projectTFMs>
</PropertyGroup>
<!-- Generate project.csproj from template. -->
<MakeDir Directories="$(_projectDir)" />
<!-- Update project.csproj template -->
<WriteLinesToFile
File="$(_projectFile)"
Lines="$([System.IO.File]::ReadAllText('$(ProjectTemplate)').Replace('{PackageId}', $(_packageId)).Replace('{PackageVersion}', $(_packageVersion)).Replace('{TargetFrameworks}', $(_projectTFMs)).Replace('{NetCoreAppCurrent}', $(NetCoreAppCurrent)).Replace('{NetCoreAppCurrentVersion}', $(NetCoreAppCurrentVersion)).Replace('{MicrosoftNetCoreAppFrameworkName}', $(MicrosoftNetCoreAppFrameworkName)))"
Lines="$([System.IO.File]::ReadAllText('$(ProjectTemplate)').Replace('{PackageId}', $(_packageId)).Replace('{PackageVersion}', $(_packageVersion)).Replace('{TargetFrameworks}', $(_projectTFMs)).Replace('{NetCoreAppCurrent}', $(NetCoreAppCurrent)).Replace('{NetCoreAppCurrentVersion}', $(NetCoreAppCurrentVersion)).Replace('{MicrosoftNetCoreAppFrameworkName}', $(MicrosoftNetCoreAppFrameworkName)).Replace('{MicrosoftNetCoreAppRefPackDir}', $(MicrosoftNetCoreAppRefPackDir)).Replace('{RestoreAdditionalProjectSources}', $(ArtifactsPackagesDir)).Replace('{RestorePackagesPath}', $(TestPackageDir)))"
Overwrite="true" />
<Message Text="Generated $(_projectFile)" />
</Target>
<Target Name="CopyProducedPackages">
<!-- Copy over package local cache to our helix runtime path -->
<Target Name="InvokeProjects"
DependsOnTargets="GenerateProjects"
AfterTargets="Build;Test">
<ItemGroup>
<_localPackages Include="$(ArtifactsShippingPackagesDir)*.nupkg"/>
<_localPackages Include="$(ArtifactsNonShippingPackagesDir)*.nupkg"/>
<TestProject Include="$(TestDir)$(TestProjectName)" Condition="'$(PackagesToTest)' == ''" />
<TestProject Include="%(SupportedPackage.ProjectFile)" Condition="'$(PackagesToTest)' != ''" />
</ItemGroup>
<Copy SourceFiles="@(_localPackages)"
UseHardlinksIfPossible="true"
DestinationFolder="$(TestSupportDir)packages" />
</Target>
<Target Name="ArchiveHelixItems"
DependsOnTargets="GenerateProjects;CopyProducedPackages"
Condition="'$(ArchiveTests)' == 'true'">
<MakeDir Directories="$(TestArchiveTestsRoot)" />
<ZipDirectory
SourceDirectory="$(TestProjectDir)%(SupportedPackage.Identity)"
DestinationFile="$(TestArchiveTestsRoot)%(SupportedPackage.Identity).zip"
Overwrite="true" />
<MakeDir Directories="$(TestArchiveRuntimeRoot)" />
<ZipDirectory
SourceDirectory="$(TestSupportDir)"
DestinationFile="$(TestArchiveRuntimeRoot)packages-testPayload-$(Configuration).zip"
Overwrite="true" />
<MSBuild Projects="@(TestProject)"
Properties="MSBuildRestoreSessionId=$([System.Guid]::NewGuid())"
Targets="Restore" />
<MSBuild Projects="@(TestProject)" />
</Target>
<Target Name="RestoreProjects"
DependsOnTargets="GenerateProjects"
Condition="'$(ArchiveTests)' != 'true'">
<PropertyGroup>
<TestRestoreCommand>"$(TestDotNetPath)"</TestRestoreCommand>
<TestRestoreCommand>$(TestRestoreCommand) restore</TestRestoreCommand>
<TestRestoreCommand>$(TestRestoreCommand) --packages "$(TestPackageDir)"</TestRestoreCommand>
<TestRestoreCommand>$(TestRestoreCommand) /p:LocalPackagesPath=$(ArtifactsPackagesDir)</TestRestoreCommand>
<TestRestoreCommand>$(TestRestoreCommand) /p:MicrosoftNetCoreAppRefPackDir=$(MicrosoftNetCoreAppRefPackDir)</TestRestoreCommand>
<TestRestoreCommand>$(TestRestoreCommand) /nr:false</TestRestoreCommand>
<TestRestoreCommand>$(TestRestoreCommand) /warnaserror</TestRestoreCommand>
<TestRestoreCommand Condition="'$(PackagesToTest)' != ''">$(TestRestoreCommand) /p:PackagesToTest=$(PackagesToTest)</TestRestoreCommand>
</PropertyGroup>
<Message Importance="High" Text="*** Restoring ***" />
<Exec Command="$(TestRestoreCommand) &quot;$(TestProject)&quot;" EnvironmentVariables="@(CliEnvironment)" StandardOutputImportance="High" />
</Target>
<Target Name="BuildProjects"
DependsOnTargets="RestoreProjects"
Condition="'$(ArchiveTests)' != 'true'">
<PropertyGroup>
<TestBuildCommand>"$(TestDotNetPath)"</TestBuildCommand>
<TestBuildCommand>$(TestBuildCommand) msbuild</TestBuildCommand>
<TestBuildCommand>$(TestBuildCommand) /t:Test</TestBuildCommand>
<TestBuildCommand>$(TestBuildCommand) /nr:false</TestBuildCommand>
<TestBuildCommand>$(TestBuildCommand) /warnaserror</TestBuildCommand>
<TestBuildCommand>$(TestBuildCommand) /p:MicrosoftNetCoreAppRefPackDir=$(MicrosoftNetCoreAppRefPackDir)</TestBuildCommand>
<TestBuildCommand Condition="'$(PackagesToTest)' != ''">$(TestBuildCommand) /p:PackagesToTest=$(PackagesToTest)</TestBuildCommand>
</PropertyGroup>
<Message Importance="High" Text="*** Testing *** %(SupportedPackage.Identity)" />
<Message Importance="High" Text="$(TestBuildCommand) &quot;$(TestProject)&quot;" />
<Exec Command="$(TestBuildCommand) &quot;$(TestProject)&quot;" EnvironmentVariables="@(CliEnvironment)" StandardOutputImportance="High" />
</Target>
<Target Name="Build" DependsOnTargets="BuildProjects;ArchiveHelixItems" />
<!-- define test to do nothing, for this project Build does all the testing -->
<Target Name="Test" />
<Import Project="..\Directory.Build.targets" />
</Project>
......@@ -16,13 +16,11 @@
<PropertyGroup>
<TargetFramework>$(NetCoreAppToolCurrent)</TargetFramework>
<BuildTargetFramework Condition="'$(TestPackages)' != 'true'">$([MSBuild]::ValueOrDefault('$(BuildTargetFramework)', '$(NetCoreAppCurrent)'))</BuildTargetFramework>
<BuildTargetFramework>$([MSBuild]::ValueOrDefault('$(BuildTargetFramework)', '$(NetCoreAppCurrent)'))</BuildTargetFramework>
<TargetsWindows Condition="'$(TargetOS)' == 'windows'">true</TargetsWindows>
<!-- The Helix correlation payload file -->
<TestArchiveRuntimeFile Condition="'$(TestPackages)' != 'true' and
'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)'">$(TestArchiveRuntimeRoot)test-runtime-$(NetCoreAppCurrentBuildSettings).zip</TestArchiveRuntimeFile>
<TestArchiveRuntimeFile Condition="'$(TestPackages)' == 'true'">$(TestArchiveRuntimeRoot)packages-testPayload-$(Configuration).zip</TestArchiveRuntimeFile>
<TestArchiveRuntimeFile Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)'">$(TestArchiveRuntimeRoot)test-runtime-$(NetCoreAppCurrentBuildSettings).zip</TestArchiveRuntimeFile>
<!-- Set the name of the scenario file. Note that this is only used in invocations where $(Scenario) is set
(which is when this project is invoked to call the "CreateOneScenarioTestEnvFile" target). -->
......@@ -157,8 +155,7 @@
DependsOnTargets="IncludeDumpDocsInTesthost;_CollectRuntimeInputs"
Inputs="@(_RuntimeInput);@(TestArchiveRuntimeDependency)"
Outputs="$(TestArchiveRuntimeFile)"
Condition="'$(TestPackages)' != 'true' and
'$(TargetsMobile)' != 'true' and
Condition="'$(TargetsMobile)' != 'true' and
'$(TestArchiveRuntimeFile)' != ''">
<!-- Compress the test files, testhost, and per-scenario scripts into a single ZIP file for sending to the Helix machines. -->
......
......@@ -53,43 +53,16 @@
<NeedsToBuildWasmAppsOnHelix Condition="'$(TargetOS)' == 'Browser' and '$(NeedsToBuildWasmAppsOnHelix)' == '' and '$(Scenario)' == 'BuildWasmApps'">true</NeedsToBuildWasmAppsOnHelix>
</PropertyGroup>
<PropertyGroup Condition="'$(TestPackages)' == 'true'">
<!-- Use Helix feature to include dotnet CLI for every workitem and add it to the path, this also gives us an isolated packages folder -->
<NeedsDotNetSdk>true</NeedsDotNetSdk>
<UseDotNetCliVersionFromGlobalJson>true</UseDotNetCliVersionFromGlobalJson>
<TestRunNamePrefix>packaging-</TestRunNamePrefix>
</PropertyGroup>
<PropertyGroup Condition="'$(HelixType)' == ''">
<!-- For PRs we want HelixType to be the same for all frameworks except package testing-->
<TestScope Condition="'$(TestScope)' == ''">innerloop</TestScope>
<HelixType>test/functional/cli/$(TestScope)/</HelixType>
<HelixType Condition="'$(TestPackages)' == 'true'">test/functional/packaging/</HelixType>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetOS)' == 'Browser' or '$(TargetOS)' == 'Android' or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'iOSSimulator' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'tvOSSimulator' or '$(TargetOS)' == 'MacCatalyst'">
<IncludeXHarnessCli>true</IncludeXHarnessCli>
</PropertyGroup>
<ItemGroup Condition="'$(TestPackages)' == 'true'">
<HelixPreCommand Include="set DOTNET_CLI_TELEMETRY_OPTOUT=1" />
<HelixPreCommand Include="set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1" />
<HelixPreCommand Include="set DOTNET_MULTILEVEL_LOOKUP=0" />
<!-- For package testing we need the live targeting pack available. -->
<HelixCorrelationPayload Include="$(MicrosoftNetCoreAppRefPackDir)" Destination="targetingpack" />
</ItemGroup>
<PropertyGroup Condition="'$(TestPackages)' == 'true'">
<HelixCommand>dotnet msbuild %HELIX_CORRELATION_PAYLOAD%\test.msbuild</HelixCommand>
<HelixCommand>$(HelixCommand) /bl:%HELIX_WORKITEM_UPLOAD_ROOT%\%HELIX_WORKITEM_FRIENDLYNAME%.package.test.binlog</HelixCommand>
<HelixCommand>$(HelixCommand) /warnaserror</HelixCommand>
<HelixCommand>$(HelixCommand) /p:PackageTestProjectsDir=%HELIX_WORKITEM_PAYLOAD%</HelixCommand>
<HelixCommand>$(HelixCommand) /p:LocalPackagesPath=%HELIX_CORRELATION_PAYLOAD%\packages\</HelixCommand>
<HelixCommand>$(HelixCommand) /p:MicrosoftNetCoreAppRefPackDir=%HELIX_CORRELATION_PAYLOAD%\targetingpack\</HelixCommand>
</PropertyGroup>
<ItemGroup Condition="'$(MonoEnvOptions)' != ''">
<HelixPreCommand Condition="'$(TargetsWindows)' == 'true' or '$(BrowserHost)' == 'windows'" Include="set MONO_ENV_OPTIONS='$(MonoEnvOptions)'" />
<HelixPreCommand Condition="'$(TargetsWindows)' != 'true' and '$(BrowserHost)' != 'windows'" Include="export MONO_ENV_OPTIONS='$(MonoEnvOptions)'" />
......@@ -413,7 +386,6 @@
</Target>
<Target Name="PrintBuildTargetFramework">
<Message Condition="'$(TestPackages)' != 'true'" Importance="High" Text="Build TargetFramework: $(BuildTargetFramework)" />
<Message Condition="'$(TestPackages)' == 'true'" Importance="High" Text="Doing Package Testing" />
<Message Importance="High" Text="Build TargetFramework: $(BuildTargetFramework)" />
</Target>
</Project>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册