From 4c31dc72148a255c60a0e096d02b2fde37d4f68a Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Fri, 6 Jan 2023 11:54:13 +0100 Subject: [PATCH 1/4] Removing non-compressed test runs --- azure-pipelines.yml | 58 --------------------------------------------- 1 file changed, 58 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d2590b5ba6c..a64be1080f3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -280,64 +280,6 @@ stages: helixRepo: dotnet/fsharp jobs: - # Windows - - job: Windows - pool: - # The PR build definition sets this variable: - # WindowsMachineQueueName=Windows.vs2022.amd64.open - # and there is an alternate build definition that sets this to a queue that is always scouting the - # next preview of Visual Studio. - name: $(DncEngPublicBuildPool) - demands: ImageOverride -equals $(WindowsMachineQueueName) - timeoutInMinutes: 120 - strategy: - maxParallel: 4 - matrix: - desktop_release: - _configuration: Release - _testKind: testDesktop - coreclr_release: - _configuration: Release - _testKind: testCoreclr - fsharpqa_release: - _configuration: Release - _testKind: testFSharpQA - vs_release: - _configuration: Release - _testKind: testVs - steps: - - checkout: self - clean: true - - script: eng\CIBuild.cmd -configuration $(_configuration) -$(_testKind) - displayName: Build / Test - - task: PublishTestResults@2 - displayName: Publish Test Results - inputs: - testResultsFormat: 'NUnit' - testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)' - continueOnError: true - condition: ne(variables['_testKind'], 'testFSharpQA') - - task: PublishBuildArtifacts@1 - displayName: Publish Test Logs - inputs: - PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\$(_configuration)' - ArtifactName: 'Windows $(_configuration) $(_testKind) test logs' - publishLocation: Container - continueOnError: true - condition: failed() - - script: dotnet build $(Build.SourcesDirectory)/eng/DumpPackageRoot/DumpPackageRoot.csproj - displayName: Dump NuGet cache contents - condition: failed() - - task: PublishBuildArtifacts@1 - displayName: Publish NuGet cache contents - inputs: - PathtoPublish: '$(Build.SourcesDirectory)\artifacts\NugetPackageRootContents' - ArtifactName: 'NuGetPackageContents Windows $(_testKind)' - publishLocation: Container - continueOnError: true - condition: failed() - # Windows With Compressed Metadata - job: WindowsCompressedMetadata pool: From 89ee7ae04ac0f82c757d475aeaa005b8bfcc8d74 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Fri, 6 Jan 2023 11:56:12 +0100 Subject: [PATCH 2/4] Removing non-compressed trimming test --- azure-pipelines.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a64be1080f3..19aaeaac0ab 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -591,8 +591,6 @@ stages: matrix: compressed_metadata: _kind: "-compressAllMetadata" - classic_metadata: - _kind: "" variables: - name: _BuildConfig value: Release From 29e2a9a714456f9c62010985f6df5200d0d13bf4 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Fri, 6 Jan 2023 15:06:26 +0100 Subject: [PATCH 3/4] Moving FsharpSuite to background job invocation --- eng/Build.ps1 | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 98a71be0b07..0da0a040121 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -287,7 +287,7 @@ function VerifyAssemblyVersionsAndSymbols() { } } -function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [string]$testadapterpath, [boolean] $noTestFilter = $false) { +function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [string]$testadapterpath, [boolean] $noTestFilter = $false, [boolean] $asBackgroundJob = $false) { $dotnetPath = InitializeDotNetCli $dotnetExe = Join-Path $dotnetPath "dotnet.exe" $projectName = [System.IO.Path]::GetFileNameWithoutExtension($testProject) @@ -308,16 +308,26 @@ function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [str $args += " --filter TestCategory!=PullRequest" } - Write-Host("$args") - Exec-Console $dotnetExe $args + + if ($asBackgroundJob) { + Write-Host("Starting on the background: $args") + Write-Host("------------------------------------") + $bgJob = Start-Job -ScriptBlock { + & $using:dotnetExe test $using:testProject -c $using:configuration -f $using:targetFramework -v n --test-adapter-path $using:testadapterpath --logger "nunit;LogFilePath=$using:testLogPath" /bl:$using:testBinLogPath --blame --results-directory $using:ArtifactsDir\TestResults\$using:configuration + } + return $bgJob + } else{ + Write-Host("$args") + Exec-Console $dotnetExe $args + } } -function TestUsingXUnit([string] $testProject, [string] $targetFramework, [string]$testadapterpath) { - TestUsingMsBuild -testProject $testProject -targetFramework $targetFramework -testadapterpath $testadapterpath -noTestFilter $true +function TestUsingXUnit([string] $testProject, [string] $targetFramework, [string]$testadapterpath, [boolean] $asBackgroundJob = $false) { + TestUsingMsBuild -testProject $testProject -targetFramework $targetFramework -testadapterpath $testadapterpath -noTestFilter $true -asBackgroundJob $asBackgroundJob } -function TestUsingNUnit([string] $testProject, [string] $targetFramework, [string]$testadapterpath) { - TestUsingMsBuild -testProject $testProject -targetFramework $targetFramework -testadapterpath $testadapterpath -noTestFilter $false +function TestUsingNUnit([string] $testProject, [string] $targetFramework, [string]$testadapterpath, [boolean] $asBackgroundJob = $false) { + TestUsingMsBuild -testProject $testProject -targetFramework $targetFramework -testadapterpath $testadapterpath -noTestFilter $false -asBackgroundJob $asBackgroundJob } function Prepare-TempDir() { @@ -517,23 +527,33 @@ try { $coreclrTargetFramework = "net7.0" if ($testDesktop) { + $bgJob = TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" -asBackgroundJob $true + TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -noTestFilter $true TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.UnitTests\" TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\" TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Build.UnitTests\" TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\" - TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" + + # Collect output from background jobs + Wait-job $bgJob | out-null + Receive-Job $bgJob } if ($testCoreClr) { + $bgJob = TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" -asBackgroundJob $true + TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.UnitTests\" TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\" TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Build.UnitTests\" TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\" - TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" + + # Collect output from background jobs + Wait-job $bgJob | out-null + Receive-Job $bgJob } if ($testFSharpQA) { From 23fb74b0f27e0e4d0cf83d96269b4e0f7430049a Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Fri, 6 Jan 2023 19:49:51 +0100 Subject: [PATCH 4/4] Put trimming without metadata compression back --- azure-pipelines.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 19aaeaac0ab..a64be1080f3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -591,6 +591,8 @@ stages: matrix: compressed_metadata: _kind: "-compressAllMetadata" + classic_metadata: + _kind: "" variables: - name: _BuildConfig value: Release