-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Use -noBuild
in second build steps of test jobs
#39998
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,8 @@ $env:BUILD_REPOSITORY_NAME="aspnetcore" | |
$env:SYSTEM_TEAMPROJECT="aspnetcore" | ||
|
||
Write-Host -ForegroundColor Yellow "If running tests that need the shared Fx, run './build -pack -all' before this." | ||
Write-Host -ForegroundColor Yellow "And if packing for a different platform, add '/p:CrossgenOutput=false'." | ||
Write-Host -ForegroundColor Yellow "If everything is up-to-date, add '/p:NoBuild=true' to this command." | ||
Write-Host -ForegroundColor Yellow "Or, if only the test project is out-of-date, add '/p:BuildProjectReferences=false'." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @BrennanConroy these possibilities should speed up use of this script even more than setting |
||
|
||
$HelixQueues = $HelixQueues -replace ";", "%3B" | ||
dotnet msbuild $Project /t:Helix /p:TargetArchitecture="$TargetArchitecture" ` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,8 @@ | |
<ProjectReference Include="..\..\shared\Mvc.Core.TestCommon\Microsoft.AspNetCore.Mvc.Core.TestCommon.csproj" /> | ||
<ProjectReference Include="..\WebSites\*\*.csproj" | ||
Exclude="..\WebSites\ControllersFromServicesClassLibrary\ControllersFromServicesClassLibrary.csproj; | ||
..\WebSites\RazorBuildWebSite.*\RazorBuildWebSite.*.csproj" /> | ||
..\WebSites\RazorBuildWebSite.*\RazorBuildWebSite.*.csproj; | ||
..\WebSites\RazorPagesClassLibrary\RazorPagesClassLibrary.csproj" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor nit I noticed while in the neighbourhood |
||
|
||
<Reference Include="AngleSharp" /> | ||
<Reference Include="System.Net.Http" /> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Project> | ||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.targets))\Directory.Build.targets" /> | ||
|
||
<!-- Work around https://github.com/dotnet/sdk/issues/23777. Reset ContentWithTargetPath items if not building. --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ugly bug I noticed while working on this PR and this workaround likely doesn't cover all the real-world cases. /cc @marcpopMSFT @dsplaisted |
||
<Target Name="RemoveCshtmlFiles" | ||
BeforeTargets="GetCopyToPublishDirectoryItems" | ||
Condition=" '$(RazorCompileOnPublish)' != false AND '$(NoBuild)' == true "> | ||
<ItemGroup> | ||
<ContentWithTargetPath> | ||
<CopyToPublishDirectory Condition=" '%(Extension)' == '.cshtml' ">None</CopyToPublishDirectory> | ||
</ContentWithTargetPath> | ||
</ItemGroup> | ||
</Target> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
<Project> | ||
|
||
<ItemGroup> | ||
<Content Include="..\Common.FunctionalTests\Infrastructure\*.config" CopyToOutputDirectory="PreserveNewest" /> | ||
</ItemGroup> | ||
|
||
<Target Name="BuildAssets" AfterTargets="Build" Condition="'$(ExcludeFromBuild)' != 'true'"> | ||
<MSBuild Projects="@(ProjectReference)" Targets="PublishTestsAssets" SkipNonexistentTargets="true" BuildInParallel="True"> | ||
<Target Name="CopyAssets" BeforeTargets="Publish" Condition=" '$(ExcludeFromBuild)' != true "> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. doing the two parts in separate targets worked when There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any noticeable change here in behavior that we need to be aware of or is this just implementation details? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nothing I could detect because the published files from the test assets aren't used in local tests. |
||
<MSBuild Projects="@(ProjectReference)" | ||
Targets="PublishTestsAssets" | ||
SkipNonexistentTargets="true" | ||
BuildInParallel="True"> | ||
<Output TaskParameter="TargetOutputs" ItemName="PublishedTestAsset" /> | ||
</MSBuild> | ||
</Target> | ||
|
||
<Target Name="CopyAssets" AfterTargets="Publish" Condition="'@(PublishedTestAsset->Count())' != '0'"> | ||
|
||
<ItemGroup> | ||
<ItemGroup Condition=" @(PublishedTestAsset->Count()) != 0 "> | ||
<_FilesToCopy Include="%(PublishedTestAsset.Path)\**\*"> | ||
<DestinationDir>$(PublishDir)\%(PublishedTestAsset.Identity)\</DestinationDir> | ||
</_FilesToCopy> | ||
</ItemGroup> | ||
|
||
<Copy SourceFiles="@(_FilesToCopy)" DestinationFiles="@(_FilesToCopy->'%(DestinationDir)%(RecursiveDir)%(FileName)%(Extension)')" /> | ||
|
||
<Copy SourceFiles="@(_FilesToCopy)" | ||
Condition=" @(PublishedTestAsset->Count()) != 0 " | ||
DestinationFiles="@(_FilesToCopy->'%(DestinationDir)%(RecursiveDir)%(FileName)%(Extension)')" /> | ||
</Target> | ||
|
||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,11 @@ | |
|
||
<ItemGroup Condition="'$(OS)' == 'Windows_NT'"> | ||
<TestAssetPublishProfile Include="Portable" Properties="TargetFramework=$(DefaultNetCoreTargetFramework)" /> | ||
<TestAssetPublishProfile Condition="'$(TargetArchitecture)' != 'arm'" Include="Standalone-x64" Properties="RuntimeIdentifier=win-x64;" /> | ||
|
||
<!-- ReferenceTestTasks is workaround for https://github.com/dotnet/sdk/issues/2482 --> | ||
<TestAssetPublishProfile Include="Standalone-x64" | ||
Condition=" '$(TargetArchitecture)' != 'arm' " | ||
Properties="RuntimeIdentifier=win-x64;ReferenceTestTasks=false" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
|
@@ -59,4 +63,13 @@ | |
</PackageReference> | ||
<Reference Include="xunit.assert" /> | ||
</ItemGroup> | ||
|
||
<!-- Repeat Build target for win-x64 to allow later Publish w/ NoBuild=true. --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just confirming that this already covers the Win32/arm64 cases as well, or if I'll need to revisit this section for arm64 later There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you add an arm64 profile to the |
||
<Target Name="BuildX64" | ||
BeforeTargets="Build" | ||
Condition=" '$(RuntimeIdentifier)' != 'win-x64' AND '$(TargetArchitecture)' != 'arm' "> | ||
<MSBuild Projects="$(MSBuildProjectFullPath)" | ||
Properties="RuntimeIdentifier=win-x64;ReferenceTestTasks=false" | ||
Targets="Build" /> | ||
</Target> | ||
</Project> |
Uh oh!
There was an error while loading. Please reload this page.