From e6909547cbd1ddb1d8df3d00695c4bee97877971 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Tue, 29 Apr 2025 02:00:53 +0200 Subject: [PATCH 01/15] desktop 4 batches --- azure-pipelines-PR.yml | 98 +++++++++++++++++++-- eng/Build.ps1 | 8 ++ tests/FSharp.Test.Utilities/XunitHelpers.fs | 10 +++ 3 files changed, 110 insertions(+), 6 deletions(-) diff --git a/azure-pipelines-PR.yml b/azure-pipelines-PR.yml index bf59708bdb1..e3f56ac27dc 100644 --- a/azure-pipelines-PR.yml +++ b/azure-pipelines-PR.yml @@ -306,11 +306,13 @@ stages: name: $(DncEngPublicBuildPool) demands: ImageOverride -equals $(WindowsMachineQueueName) timeoutInMinutes: 120 + strategy: + parallel: 4 steps: - checkout: self clean: true - - script: eng\CIBuild.cmd -compressallmetadata -buildnorealsig -testDesktop -configuration Release + - script: eng\CIBuild.cmd -compressallmetadata -buildnorealsig -testDesktop -configuration Release -job $(System.JobPositionInPhase) env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. @@ -318,6 +320,15 @@ stages: NativeToolsOnMachine: true displayName: Build + - task: PublishTestResults@2 + displayName: Publish Test Results + inputs: + testResultsFormat: 'XUnit' + testRunTitle: WindowsNoRealsig_testDesktop $(System.JobPositionInPhase) + mergeTestResults: true + testResultsFiles: '*.xml' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/Release' + continueOnError: true - task: PublishBuildArtifacts@1 displayName: Publish Build BinLog condition: always() @@ -333,7 +344,7 @@ stages: continueOnError: true inputs: PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release' - ArtifactName: 'Windows Release WindowsNoRealsig_testDesktop process dumps' + ArtifactName: 'Windows Release WindowsNoRealsig_testDesktop process dumps $(System.JobPositionInPhase)' ArtifactType: Container parallel: true @@ -429,11 +440,8 @@ stages: demands: ImageOverride -equals $(WindowsMachineQueueName) timeoutInMinutes: 120 strategy: - maxParallel: 5 + maxParallel: 4 matrix: - desktop_release: - _configuration: Release - _testKind: testDesktop coreclr_release: _configuration: Release _testKind: testCoreclr @@ -537,6 +545,84 @@ stages: continueOnError: true condition: failed() + # Windows With Compressed Metadata Desktop + - job: WindowsCompressedMetadata + variables: + - name: XUNIT_LOGS + value: $(Build.SourcesDirectory)\artifacts\TestResults\Release + - name: __VSNeverShowWhatsNew + value: 1 + 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: + parallel: 4 + + steps: + - checkout: self + clean: true + + - script: eng\CIBuild.cmd -compressallmetadata -configuration Release -testDesktop -job $(System.JobPositionInPhase) + env: + DOTNET_DbgEnableMiniDump: 1 + DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. + DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp + NativeToolsOnMachine: true + displayName: Build / Test + + - task: PublishTestResults@2 + displayName: Publish Test Results + inputs: + testResultsFormat: 'XUnit' + testRunTitle: WindowsCompressedMetadata testDesktop $(System.JobPositionInPhase) + mergeTestResults: true + testResultsFiles: '*.xml' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/Release' + continueOnError: true + + - task: PublishBuildArtifacts@1 + displayName: Publish Tests BinLog + condition: always() + continueOnError: true + inputs: + PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/Release\Build.VisualFSharp.sln.binlog' + ArtifactName: 'Windows testDesktop test binlogs' + ArtifactType: Container + parallel: true + - task: PublishBuildArtifacts@1 + displayName: Publish Dumps + condition: failed() + continueOnError: true + inputs: + PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release' + ArtifactName: 'Windows testDesktop process dumps $(System.JobPositionInPhase)' + ArtifactType: Container + parallel: true + - task: PublishBuildArtifacts@1 + displayName: Publish Test Logs + inputs: + PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\Release' + ArtifactName: 'Windows testDesktop test logs $(System.JobPositionInPhase)' + publishLocation: Container + continueOnError: true + condition: always() + - 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 testDesktop' + publishLocation: Container + continueOnError: true + condition: failed() + # Mock official build - job: MockOfficial pool: diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 146372ecde6..24a4b450169 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -73,6 +73,7 @@ param ( [switch]$compressAllMetadata, [switch]$buildnorealsig = $true, [switch]$verifypackageshipstatus = $false, + [string]$job = "", [parameter(ValueFromRemainingArguments = $true)][string[]]$properties) Set-StrictMode -version 2.0 @@ -357,6 +358,10 @@ function VerifyAssemblyVersionsAndSymbols() { } function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [string]$testadapterpath, [boolean] $asBackgroundJob = $false, [string] $settings = "") { + if ($job) { + Write-Host("Testing batch: $job") + $filter = "" + } $dotnetPath = InitializeDotNetCli $dotnetExe = Join-Path $dotnetPath "dotnet.exe" $projectName = [System.IO.Path]::GetFileNameWithoutExtension($testProject) @@ -376,6 +381,9 @@ function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [str } $args += " $settings" + if ($job) { + $args += " --filter batch=$job" + } if ($asBackgroundJob) { Write-Host diff --git a/tests/FSharp.Test.Utilities/XunitHelpers.fs b/tests/FSharp.Test.Utilities/XunitHelpers.fs index 34a44df17ed..dfdf5557b5a 100644 --- a/tests/FSharp.Test.Utilities/XunitHelpers.fs +++ b/tests/FSharp.Test.Utilities/XunitHelpers.fs @@ -90,6 +90,14 @@ module TestCaseCustomizations = else testCase.TestMethod + let sha = Security.Cryptography.SHA256.Create() + + let addBatchTrait (testCase: ITestCase) = + let data = Text.Encoding.UTF8.GetBytes testCase.UniqueID + let hashCode = BitConverter.ToUInt32(sha.ComputeHash(data), 0) + let batch = hashCode % 4u + 1u + testCase.Traits.Add("batch", ResizeArray [ string batch ]) + type CustomTestCase = inherit XunitTestCase // xUinit demands this constructor for deserialization. @@ -109,6 +117,7 @@ type CustomTestCase = override testCase.Initialize () = base.Initialize() testCase.TestMethod <- TestCaseCustomizations.rewriteTestMethod testCase + TestCaseCustomizations.addBatchTrait testCase type CustomTheoryTestCase = inherit XunitTheoryTestCase @@ -127,6 +136,7 @@ type CustomTheoryTestCase = override testCase.Initialize () = base.Initialize() testCase.TestMethod <- TestCaseCustomizations.rewriteTestMethod testCase + TestCaseCustomizations.addBatchTrait testCase #endif From 2664d55a71d13cb604cffadf65c7d307bb9c79e7 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Tue, 29 Apr 2025 09:23:28 +0200 Subject: [PATCH 02/15] fix name --- azure-pipelines-PR.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-PR.yml b/azure-pipelines-PR.yml index e3f56ac27dc..b0b582aee1f 100644 --- a/azure-pipelines-PR.yml +++ b/azure-pipelines-PR.yml @@ -546,7 +546,7 @@ stages: condition: failed() # Windows With Compressed Metadata Desktop - - job: WindowsCompressedMetadata + - job: WindowsCompressedMetadata_Desktop variables: - name: XUNIT_LOGS value: $(Build.SourcesDirectory)\artifacts\TestResults\Release From fcba30b6cdc70447ddcd0b3cd85cd4a9bcdfa600 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Tue, 29 Apr 2025 10:53:37 +0200 Subject: [PATCH 03/15] do linux too --- azure-pipelines-PR.yml | 18 ++++++++++-------- eng/Build.ps1 | 18 ++---------------- tests/FSharp.Test.Utilities/XunitHelpers.fs | 2 +- 3 files changed, 13 insertions(+), 25 deletions(-) diff --git a/azure-pipelines-PR.yml b/azure-pipelines-PR.yml index b0b582aee1f..96f67e100b4 100644 --- a/azure-pipelines-PR.yml +++ b/azure-pipelines-PR.yml @@ -331,7 +331,7 @@ stages: continueOnError: true - task: PublishBuildArtifacts@1 displayName: Publish Build BinLog - condition: always() + condition: eq(variables['System.JobPositionInPhase'], 1) continueOnError: true inputs: PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/Release\Build.VisualFSharp.sln.binlog' @@ -587,7 +587,7 @@ stages: - task: PublishBuildArtifacts@1 displayName: Publish Tests BinLog - condition: always() + condition: eq(variables['System.JobPositionInPhase'], 1) continueOnError: true inputs: PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/Release\Build.VisualFSharp.sln.binlog' @@ -618,7 +618,7 @@ stages: displayName: Publish NuGet cache contents inputs: PathtoPublish: '$(Build.SourcesDirectory)\artifacts\NugetPackageRootContents' - ArtifactName: 'NuGetPackageContents Windows testDesktop' + ArtifactName: 'NuGetPackageContents Windows testDesktop $(System.JobPositionInPhase)' publishLocation: Container continueOnError: true condition: failed() @@ -642,16 +642,18 @@ stages: variables: - name: _SignType value: Test + strategy: + parallel: 4 steps: - checkout: self clean: true - - script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr - displayName: Build / Test + - script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr -job $(System.JobPositionInPhase) + displayName: Build / Test -job $(System.JobPositionInPhase) - task: PublishTestResults@2 displayName: Publish Test Results inputs: testResultsFormat: 'XUnit' - testRunTitle: Linux + testRunTitle: Linux -job $(System.JobPositionInPhase) testResultsFiles: '*.xml' mergeTestResults: true searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)' @@ -661,7 +663,7 @@ stages: displayName: Publish Test Logs inputs: PathtoPublish: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)' - ArtifactName: 'Linux $(_BuildConfig) test logs' + ArtifactName: 'Linux $(_BuildConfig) test logs -job $(System.JobPositionInPhase)' publishLocation: Container continueOnError: true condition: failed() @@ -672,7 +674,7 @@ stages: displayName: Publish NuGet cache contents inputs: PathtoPublish: '$(Build.SourcesDirectory)/artifacts/NugetPackageRootContents' - ArtifactName: 'NuGetPackageContents Linux' + ArtifactName: 'NuGetPackageContents Linux -job $(System.JobPositionInPhase)' publishLocation: Container continueOnError: true condition: failed() diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 24a4b450169..b56e6616c40 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -612,24 +612,10 @@ try { } if ($testCoreClr) { - $cpuLimit = if ($ci) { "-m:1 -- xUnit.MaxParallelThreads=1" } else { "" } - TestUsingMSBuild -testProject "$RepoRoot\FSharp.sln" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -settings $cpuLimit + TestUsingMSBuild -testProject "$RepoRoot\FSharp.sln" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -settings } - if ($testDesktop -and $ci) { - $bgJob = TestUsingMSBuild -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" -asBackgroundJob $true - - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Test.Utilities\FSharp.Test.Utilities.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Test.Utilities\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Build.UnitTests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\" - - Receive -job $bgJob - } - - if ($testDesktop -and -not $ci ) { + if ($testDesktop) { TestUsingMSBuild -testProject "$RepoRoot\FSharp.sln" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" } diff --git a/tests/FSharp.Test.Utilities/XunitHelpers.fs b/tests/FSharp.Test.Utilities/XunitHelpers.fs index dfdf5557b5a..4876137f100 100644 --- a/tests/FSharp.Test.Utilities/XunitHelpers.fs +++ b/tests/FSharp.Test.Utilities/XunitHelpers.fs @@ -93,7 +93,7 @@ module TestCaseCustomizations = let sha = Security.Cryptography.SHA256.Create() let addBatchTrait (testCase: ITestCase) = - let data = Text.Encoding.UTF8.GetBytes testCase.UniqueID + let data = Text.Encoding.UTF8.GetBytes testCase.DisplayName let hashCode = BitConverter.ToUInt32(sha.ComputeHash(data), 0) let batch = hashCode % 4u + 1u testCase.Traits.Add("batch", ResizeArray [ string batch ]) From 2bfd462341905c621d3182712b66cdd6e7df865c Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Tue, 29 Apr 2025 11:08:34 +0200 Subject: [PATCH 04/15] wip --- eng/build.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/eng/build.sh b/eng/build.sh index 53de7fda4c9..a0ec3e6b410 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -76,6 +76,7 @@ prepare_machine=false source_build=false product_build=false buildnorealsig=true +job="" properties="" docker=false @@ -104,6 +105,11 @@ while [[ $# > 0 ]]; do args="$args $1" shift ;; + --job|-job) + job=$2 + args="$args $1" + shift + ;; --verbosity|-v) verbosity=$2 args="$args $1" @@ -227,6 +233,10 @@ function Test() { testlogpath="$artifacts_dir/TestResults/$configuration/${projectname}_$targetframework.xml" args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"xunit;LogFilePath=$testlogpath\" --blame-hang-timeout 5minutes --results-directory $artifacts_dir/TestResults/$configuration -p:vstestusemsbuildoutput=false" args+=" -- xUnit.MaxParallelThreads=1" + if [[ "$job" != "" ]]; then + args+=" --filter batch=$job" + fi + "$DOTNET_INSTALL_DIR/dotnet" $args || exit $? } From 780c11fce9ee9928c77dea29d253d2d64d7d1beb Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Tue, 29 Apr 2025 11:21:18 +0200 Subject: [PATCH 05/15] wip --- eng/Build.ps1 | 2 +- eng/build.sh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/eng/Build.ps1 b/eng/Build.ps1 index b56e6616c40..4b0d8452dad 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -612,7 +612,7 @@ try { } if ($testCoreClr) { - TestUsingMSBuild -testProject "$RepoRoot\FSharp.sln" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -settings + TestUsingMSBuild -testProject "$RepoRoot\FSharp.sln" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" } if ($testDesktop) { diff --git a/eng/build.sh b/eng/build.sh index a0ec3e6b410..ffbd098021b 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -232,9 +232,8 @@ function Test() { projectname="${projectname%.*}" testlogpath="$artifacts_dir/TestResults/$configuration/${projectname}_$targetframework.xml" args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"xunit;LogFilePath=$testlogpath\" --blame-hang-timeout 5minutes --results-directory $artifacts_dir/TestResults/$configuration -p:vstestusemsbuildoutput=false" - args+=" -- xUnit.MaxParallelThreads=1" if [[ "$job" != "" ]]; then - args+=" --filter batch=$job" + args="$args --filter batch=$job" fi "$DOTNET_INSTALL_DIR/dotnet" $args || exit $? From 2b573b02aae88fb6bc75d5a68221f49115841bdc Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Tue, 29 Apr 2025 16:37:23 +0200 Subject: [PATCH 06/15] add job number to testlogs --- eng/Build.ps1 | 9 +++------ eng/build.sh | 2 +- tests/FSharp.Test.Utilities/XunitHelpers.fs | 9 ++++++++- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 4b0d8452dad..e3e3ec19a17 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -358,17 +358,14 @@ function VerifyAssemblyVersionsAndSymbols() { } function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [string]$testadapterpath, [boolean] $asBackgroundJob = $false, [string] $settings = "") { - if ($job) { - Write-Host("Testing batch: $job") - $filter = "" - } + $dotnetPath = InitializeDotNetCli $dotnetExe = Join-Path $dotnetPath "dotnet.exe" $projectName = [System.IO.Path]::GetFileNameWithoutExtension($testProject) # {assembly} and {framework} will expand respectively. See https://github.com/spekt/testlogger/wiki/Logger-Configuration#logfilepath # This is useful to deconflict log filenames when there are many test assemblies, e.g. when testing a whole solution. - $testLogPath = "$ArtifactsDir\TestResults\$configuration\{assembly}_{framework}.xml" - $testBinLogPath = "$LogDir\${projectName}_$targetFramework.binlog" + $testLogPath = "$ArtifactsDir\TestResults\$configuration\{assembly}_{framework}$job.xml" + $testBinLogPath = "$LogDir\${projectName}_$targetFramework$job.binlog" $args = "test $testProject -c $configuration -f $targetFramework -v n --test-adapter-path $testadapterpath --logger ""xunit;LogFilePath=$testLogPath"" /bl:$testBinLogPath" $args += " --blame --blame-hang-timeout 5minutes --results-directory $ArtifactsDir\TestResults\$configuration -p:vstestusemsbuildoutput=true" diff --git a/eng/build.sh b/eng/build.sh index ffbd098021b..0b05960739a 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -230,7 +230,7 @@ function Test() { projectname=$(basename -- "$testproject") projectname="${projectname%.*}" - testlogpath="$artifacts_dir/TestResults/$configuration/${projectname}_$targetframework.xml" + testlogpath="$artifacts_dir/TestResults/$configuration/${projectname}_$targetframework$job.xml" args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"xunit;LogFilePath=$testlogpath\" --blame-hang-timeout 5minutes --results-directory $artifacts_dir/TestResults/$configuration -p:vstestusemsbuildoutput=false" if [[ "$job" != "" ]]; then args="$args --filter batch=$job" diff --git a/tests/FSharp.Test.Utilities/XunitHelpers.fs b/tests/FSharp.Test.Utilities/XunitHelpers.fs index 4876137f100..5cb7576f2e7 100644 --- a/tests/FSharp.Test.Utilities/XunitHelpers.fs +++ b/tests/FSharp.Test.Utilities/XunitHelpers.fs @@ -92,10 +92,17 @@ module TestCaseCustomizations = let sha = Security.Cryptography.SHA256.Create() + // We add extra trait to each test, of the form "batch=n" where n is between 1 and 4. + // It can be used to filter on in multi-agent testing in CI + // with dotnet test filter switch, for example "--filter batch=1" + // That way each agent can run test for a batch of tests. + let NumberOfBatchesInMultiAgentTesting = 4u + let addBatchTrait (testCase: ITestCase) = + // Get a batch number stable between executions / compilations. let data = Text.Encoding.UTF8.GetBytes testCase.DisplayName let hashCode = BitConverter.ToUInt32(sha.ComputeHash(data), 0) - let batch = hashCode % 4u + 1u + let batch = hashCode % NumberOfBatchesInMultiAgentTesting + 1u testCase.Traits.Add("batch", ResizeArray [ string batch ]) type CustomTestCase = From edadeec26462d65ee412d1f6a71d472cded09f56 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Sat, 3 May 2025 19:11:42 +0200 Subject: [PATCH 07/15] testbatch --- azure-pipelines-PR.yml | 20 +++++----- eng/Build.ps1 | 89 ++++++++++++++++++------------------------ eng/build.sh | 18 +++++---- 3 files changed, 58 insertions(+), 69 deletions(-) diff --git a/azure-pipelines-PR.yml b/azure-pipelines-PR.yml index 96f67e100b4..19265687651 100644 --- a/azure-pipelines-PR.yml +++ b/azure-pipelines-PR.yml @@ -312,7 +312,7 @@ stages: - checkout: self clean: true - - script: eng\CIBuild.cmd -compressallmetadata -buildnorealsig -testDesktop -configuration Release -job $(System.JobPositionInPhase) + - script: eng\CIBuild.cmd -compressallmetadata -buildnorealsig -testDesktop -configuration Release -testBatch $(System.JobPositionInPhase) env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. @@ -324,7 +324,7 @@ stages: displayName: Publish Test Results inputs: testResultsFormat: 'XUnit' - testRunTitle: WindowsNoRealsig_testDesktop $(System.JobPositionInPhase) + testRunTitle: WindowsNoRealsig_testDesktop batch $(System.JobPositionInPhase) mergeTestResults: true testResultsFiles: '*.xml' searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/Release' @@ -567,7 +567,7 @@ stages: - checkout: self clean: true - - script: eng\CIBuild.cmd -compressallmetadata -configuration Release -testDesktop -job $(System.JobPositionInPhase) + - script: eng\CIBuild.cmd -compressallmetadata -configuration Release -testDesktop -testBatch $(System.JobPositionInPhase) env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. @@ -579,7 +579,7 @@ stages: displayName: Publish Test Results inputs: testResultsFormat: 'XUnit' - testRunTitle: WindowsCompressedMetadata testDesktop $(System.JobPositionInPhase) + testRunTitle: WindowsCompressedMetadata testDesktop batch $(System.JobPositionInPhase) mergeTestResults: true testResultsFiles: '*.xml' searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/Release' @@ -607,7 +607,7 @@ stages: displayName: Publish Test Logs inputs: PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\Release' - ArtifactName: 'Windows testDesktop test logs $(System.JobPositionInPhase)' + ArtifactName: 'Windows testDesktop test logs batch $(System.JobPositionInPhase)' publishLocation: Container continueOnError: true condition: always() @@ -647,13 +647,13 @@ stages: steps: - checkout: self clean: true - - script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr -job $(System.JobPositionInPhase) - displayName: Build / Test -job $(System.JobPositionInPhase) + - script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr --testbatch $(System.JobPositionInPhase) + displayName: Build / Test batch $(System.JobPositionInPhase) - task: PublishTestResults@2 displayName: Publish Test Results inputs: testResultsFormat: 'XUnit' - testRunTitle: Linux -job $(System.JobPositionInPhase) + testRunTitle: Linux -testBatch $(System.JobPositionInPhase) testResultsFiles: '*.xml' mergeTestResults: true searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)' @@ -663,7 +663,7 @@ stages: displayName: Publish Test Logs inputs: PathtoPublish: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)' - ArtifactName: 'Linux $(_BuildConfig) test logs -job $(System.JobPositionInPhase)' + ArtifactName: 'Linux $(_BuildConfig) test logs batch $(System.JobPositionInPhase)' publishLocation: Container continueOnError: true condition: failed() @@ -674,7 +674,7 @@ stages: displayName: Publish NuGet cache contents inputs: PathtoPublish: '$(Build.SourcesDirectory)/artifacts/NugetPackageRootContents' - ArtifactName: 'NuGetPackageContents Linux -job $(System.JobPositionInPhase)' + ArtifactName: 'NuGetPackageContents Linux -batch $(System.JobPositionInPhase)' publishLocation: Container continueOnError: true condition: failed() diff --git a/eng/Build.ps1 b/eng/Build.ps1 index e3e3ec19a17..fe2fe5731bd 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -73,7 +73,7 @@ param ( [switch]$compressAllMetadata, [switch]$buildnorealsig = $true, [switch]$verifypackageshipstatus = $false, - [string]$job = "", + [string]$testBatch = "", [parameter(ValueFromRemainingArguments = $true)][string[]]$properties) Set-StrictMode -version 2.0 @@ -357,17 +357,24 @@ function VerifyAssemblyVersionsAndSymbols() { } } -function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [string]$testadapterpath, [boolean] $asBackgroundJob = $false, [string] $settings = "") { +function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [string] $settings = "") { $dotnetPath = InitializeDotNetCli $dotnetExe = Join-Path $dotnetPath "dotnet.exe" $projectName = [System.IO.Path]::GetFileNameWithoutExtension($testProject) + + $testBatchSuffix = "" + if ($testBatch) { + $testBatchSuffix = "_batch$testBatch" + } + # {assembly} and {framework} will expand respectively. See https://github.com/spekt/testlogger/wiki/Logger-Configuration#logfilepath # This is useful to deconflict log filenames when there are many test assemblies, e.g. when testing a whole solution. - $testLogPath = "$ArtifactsDir\TestResults\$configuration\{assembly}_{framework}$job.xml" - $testBinLogPath = "$LogDir\${projectName}_$targetFramework$job.binlog" - $args = "test $testProject -c $configuration -f $targetFramework -v n --test-adapter-path $testadapterpath --logger ""xunit;LogFilePath=$testLogPath"" /bl:$testBinLogPath" - $args += " --blame --blame-hang-timeout 5minutes --results-directory $ArtifactsDir\TestResults\$configuration -p:vstestusemsbuildoutput=true" + $testLogPath = "$ArtifactsDir\TestResults\$configuration\{assembly}_{framework}$testBatchSuffix.xml" + + $testBinLogPath = "$LogDir\${projectName}_$targetFramework$testBatch.binlog" + $args = "test $testProject -c $configuration -f $targetFramework --logger ""xunit;LogFilePath=$testLogPath"" /bl:$testBinLogPath" + $args += " --blame-hang-timeout 5minutes --results-directory $ArtifactsDir\TestResults\$configuration" if (-not $noVisualStudio -or $norestore) { $args += " --no-restore" @@ -378,25 +385,12 @@ function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [str } $args += " $settings" - if ($job) { - $args += " --filter batch=$job" - } - - if ($asBackgroundJob) { - Write-Host - Write-Host("Starting on the background: $args") - Write-Host("------------------------------------") - Start-Job -ScriptBlock { - $argArray = $using:args -Split " " - & $using:dotnetExe $argArray - if ($LASTEXITCODE -ne 0) { - throw "Command failed to execute with exit code $($LASTEXITCODE): $using:dotnetExe $using:args" - } - } - } else { - Write-Host("$args") - Exec-Console $dotnetExe $args + if ($testBatch) { + $args += " --filter batch=$testBatch" } + + Write-Host("$args") + Exec-Console $dotnetExe $args } function Prepare-TempDir() { @@ -600,20 +594,12 @@ try { $script:BuildCategory = "Test" $script:BuildMessage = "Failure running tests" - function Receive($job) { - while($job.HasMoreData) { - Receive-Job $job | Write-Host - Start-Sleep -Seconds 1 - } - Receive-Job $job -Wait -ErrorAction Stop - } - if ($testCoreClr) { - TestUsingMSBuild -testProject "$RepoRoot\FSharp.sln" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" + TestUsingMSBuild -testProject "$RepoRoot\FSharp.sln" -targetFramework $script:coreclrTargetFramework } if ($testDesktop) { - TestUsingMSBuild -testProject "$RepoRoot\FSharp.sln" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" + TestUsingMSBuild -testProject "$RepoRoot\FSharp.sln" -targetFramework $script:desktopTargetFramework } if ($testFSharpQA) { @@ -644,50 +630,49 @@ try { } if ($testFSharpCore) { - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\" + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework } if ($testCompiler) { - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:coreclrTargetFramework + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:desktopTargetFramework + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:coreclrTargetFramework + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:desktopTargetFramework } if ($testCompilerComponentTests) { - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:coreclrTargetFramework + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:desktopTargetFramework } if ($testCompilerService) { - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:coreclrTargetFramework + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:desktopTargetFramework } if ($testCambridge) { - TestUsingMSBuild -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" + TestUsingMSBuild -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:coreclrTargetFramework + TestUsingMSBuild -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:desktopTargetFramework } if ($testScripting) { - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\" + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework } if ($testEditor -and -not $noVisualStudio) { - TestUsingMSBuild -testProject "$RepoRoot\vsintegration\tests\FSharp.Editor.Tests\FSharp.Editor.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Editor.Tests\FSharp.Editor.Tests.fsproj" + TestUsingMSBuild -testProject "$RepoRoot\vsintegration\tests\FSharp.Editor.Tests\FSharp.Editor.Tests.fsproj" -targetFramework $script:desktopTargetFramework } if ($testVs -and -not $noVisualStudio) { - TestUsingMSBuild -testProject "$RepoRoot\vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\VisualFSharp.UnitTests\" + TestUsingMSBuild -testProject "$RepoRoot\vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework } - if ($testIntegration) { - TestUsingMSBuild -testProject "$RepoRoot\vsintegration\tests\FSharp.Editor.IntegrationTests\FSharp.Editor.IntegrationTests.csproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Editor.IntegrationTests\" + TestUsingMSBuild -testProject "$RepoRoot\vsintegration\tests\FSharp.Editor.IntegrationTests\FSharp.Editor.IntegrationTests.csproj" -targetFramework $script:desktopTargetFramework } if ($testAOT) { diff --git a/eng/build.sh b/eng/build.sh index 05110dc1f54..07c3889f33d 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -76,7 +76,7 @@ prepare_machine=false source_build=false product_build=false buildnorealsig=true -job="" +testbatch="" properties="" docker=false @@ -105,8 +105,8 @@ while [[ $# > 0 ]]; do args="$args $1" shift ;; - --job|-job) - job=$2 + --testbatch) + testbatch=$2 args="$args $1" shift ;; @@ -230,11 +230,15 @@ function Test() { projectname=$(basename -- "$testproject") projectname="${projectname%.*}" - testlogpath="$artifacts_dir/TestResults/$configuration/${projectname}_$targetframework$job.xml" - args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"xunit;LogFilePath=$testlogpath\" --blame-hang-timeout 5minutes --results-directory $artifacts_dir/TestResults/$configuration -p:vstestusemsbuildoutput=false" + testbatchsuffix="" + if [[ "$testbatch" != "" ]]; then + testbatchsuffix="_batch$testbatch" + fi + testlogpath="$artifacts_dir/TestResults/$configuration/${projectname}_$targetframework$testbatchsuffix.xml" + args="test \"$testproject\" --no-build -c $configuration -f $targetframework --logger \"xunit;LogFilePath=$testlogpath\" --blame-hang-timeout 5minutes --results-directory $artifacts_dir/TestResults/$configuration" - if [[ "$job" != "" ]]; then - args="$args --filter batch=$job" + if [[ "$testbatch" != "" ]]; then + args="$args --filter batch=$testbatch" fi "$DOTNET_INSTALL_DIR/dotnet" $args || exit $? From 0cd4303a95fbf405a6571415a90b7ad3812407ee Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Sat, 3 May 2025 19:12:10 +0200 Subject: [PATCH 08/15] use xUnit's UniqueID --- tests/FSharp.Test.Utilities/XunitHelpers.fs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/FSharp.Test.Utilities/XunitHelpers.fs b/tests/FSharp.Test.Utilities/XunitHelpers.fs index 632ee8cdf91..6f57efef4a4 100644 --- a/tests/FSharp.Test.Utilities/XunitHelpers.fs +++ b/tests/FSharp.Test.Utilities/XunitHelpers.fs @@ -100,8 +100,10 @@ module TestCaseCustomizations = let NumberOfBatchesInMultiAgentTesting = 4u let addBatchTrait (testCase: ITestCase) = - // Get a batch number stable between executions / compilations. - let data = Text.Encoding.UTF8.GetBytes testCase.DisplayName + // Get a batch number stable between multiple test runs. + // UniqueID is ideal here, it does not change across many compilations of the same code + // and it will split theories with member data into many batches. + let data = Text.Encoding.UTF8.GetBytes testCase.UniqueID let hashCode = BitConverter.ToUInt32(sha.ComputeHash(data), 0) let batch = hashCode % NumberOfBatchesInMultiAgentTesting + 1u testCase.Traits.Add("batch", ResizeArray [ string batch ]) From 7e4b6a032b457ab6507efc08caf1feb053448d0a Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Mon, 5 May 2025 09:01:38 +0200 Subject: [PATCH 09/15] undo linux --- azure-pipelines-PR.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/azure-pipelines-PR.yml b/azure-pipelines-PR.yml index 19265687651..0dd48ca42cc 100644 --- a/azure-pipelines-PR.yml +++ b/azure-pipelines-PR.yml @@ -642,18 +642,16 @@ stages: variables: - name: _SignType value: Test - strategy: - parallel: 4 steps: - checkout: self clean: true - - script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr --testbatch $(System.JobPositionInPhase) - displayName: Build / Test batch $(System.JobPositionInPhase) + - script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr + displayName: Build / Test - task: PublishTestResults@2 displayName: Publish Test Results inputs: testResultsFormat: 'XUnit' - testRunTitle: Linux -testBatch $(System.JobPositionInPhase) + testRunTitle: Linux testResultsFiles: '*.xml' mergeTestResults: true searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)' @@ -663,7 +661,7 @@ stages: displayName: Publish Test Logs inputs: PathtoPublish: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)' - ArtifactName: 'Linux $(_BuildConfig) test logs batch $(System.JobPositionInPhase)' + ArtifactName: 'Linux $(_BuildConfig) test logs' publishLocation: Container continueOnError: true condition: failed() @@ -674,7 +672,7 @@ stages: displayName: Publish NuGet cache contents inputs: PathtoPublish: '$(Build.SourcesDirectory)/artifacts/NugetPackageRootContents' - ArtifactName: 'NuGetPackageContents Linux -batch $(System.JobPositionInPhase)' + ArtifactName: 'NuGetPackageContents Linux' publishLocation: Container continueOnError: true condition: failed() From cf8fcd5829d68e2e5680636ecb688c00bc527efb Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Mon, 5 May 2025 09:10:39 +0200 Subject: [PATCH 10/15] split build / test --- azure-pipelines-PR.yml | 318 ++++++++++++++++++++++++++++++----------- 1 file changed, 238 insertions(+), 80 deletions(-) diff --git a/azure-pipelines-PR.yml b/azure-pipelines-PR.yml index 0dd48ca42cc..117c2e7529d 100644 --- a/azure-pipelines-PR.yml +++ b/azure-pipelines-PR.yml @@ -14,7 +14,7 @@ trigger: - docs/* - .vscode/* - .devcontainer/* - - tests/scripts/ + - tests/scripts/* - attributions.md - CODE_OF_CONDUCT.md - DEVGUIDE.md @@ -256,8 +256,7 @@ stages: ArtifactName: 'Windows Release WindowsLangVersionPreview process dumps' ArtifactType: Container parallel: true - - - job: WindowsNoRealsig_testCoreclr + - job: WindowsNoRealsig_Build pool: # The PR build definition sets this variable: # WindowsMachineQueueName=Windows.vs2022.amd64.open @@ -270,13 +269,19 @@ stages: - checkout: self clean: true - - script: eng\CIBuild.cmd -compressallmetadata -buildnorealsig -testCoreclr -configuration Release + - script: eng\CIBuild.cmd -compressallmetadata -buildnorealsig -configuration Release env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp NativeToolsOnMachine: true displayName: Build + + - task: PublishPipelineArtifact@1 + displayName: 'Publish Pipeline Artifact' + inputs: + targetPath: '$(Build.SourcesDirectory)/artifacts' + artifact: WindowsNoRealsig_Build - task: PublishBuildArtifacts@1 displayName: Publish Build BinLog @@ -293,11 +298,12 @@ stages: continueOnError: true inputs: PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release' - ArtifactName: 'Windows Release WindowsNoRealsig_testCoreclr process dumps' + ArtifactName: 'Windows Release WindowsNoRealsig_Build process dumps' ArtifactType: Container parallel: true - - job: WindowsNoRealsig_testDesktop + - job: WindowsNoRealsig_testCoreclr + dependsOn: WindowsNoRealsig_Build pool: # The PR build definition sets this variable: # WindowsMachineQueueName=Windows.vs2022.amd64.open @@ -306,38 +312,89 @@ stages: name: $(DncEngPublicBuildPool) demands: ImageOverride -equals $(WindowsMachineQueueName) timeoutInMinutes: 120 - strategy: - parallel: 4 steps: - checkout: self clean: true + + - task: DownloadPipelineArtifact@2 + displayName: 'Download Build Artifact' + inputs: + artifact: WindowsNoRealsig_Build + path: '$(Build.SourcesDirectory)/artifacts' + + - script: | + echo "Listing downloaded pipeline artifact" + dir "$(Build.SourcesDirectory)/artifacts" + displayName: 'List Pipeline Workspace' - - script: eng\CIBuild.cmd -compressallmetadata -buildnorealsig -testDesktop -configuration Release -testBatch $(System.JobPositionInPhase) + - pwsh: eng\Build.ps1 -ci -restore -testCoreclr -configuration Release env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp NativeToolsOnMachine: true displayName: Build - + - task: PublishTestResults@2 displayName: Publish Test Results inputs: testResultsFormat: 'XUnit' - testRunTitle: WindowsNoRealsig_testDesktop batch $(System.JobPositionInPhase) + testRunTitle: WindowsNoRealsig_testCoreclr mergeTestResults: true testResultsFiles: '*.xml' searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/Release' continueOnError: true + - task: PublishBuildArtifacts@1 - displayName: Publish Build BinLog - condition: eq(variables['System.JobPositionInPhase'], 1) + displayName: Publish Dumps + condition: failed() continueOnError: true inputs: - PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/Release\Build.VisualFSharp.sln.binlog' - ArtifactName: 'Windows Release build binlogs' + PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release' + ArtifactName: 'Windows Release WindowsNoRealsig_testCoreclr process dumps' ArtifactType: Container parallel: true + + - job: WindowsNoRealsig_testDesktop + dependsOn: WindowsNoRealsig_Build + 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: + parallel: 4 + steps: + - checkout: self + clean: true + + - task: DownloadPipelineArtifact@2 + displayName: 'Download Build Artifact' + inputs: + artifact: WindowsNoRealsig_Build + path: '$(Build.SourcesDirectory)/artifacts' + + - pwsh: eng\Build.ps1 -ci -restore -configuration Release -testDesktop -testBatch $(System.JobPositionInPhase) + env: + DOTNET_DbgEnableMiniDump: 1 + DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. + DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp + NativeToolsOnMachine: true + displayName: Build + + - task: PublishTestResults@2 + displayName: Publish Test Results + inputs: + testResultsFormat: 'XUnit' + testRunTitle: WindowsNoRealsig_testDesktop batch $(System.JobPositionInPhase) + mergeTestResults: true + testResultsFiles: '*.xml' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/Release' + continueOnError: true + - task: PublishBuildArtifacts@1 displayName: Publish Dumps condition: failed() @@ -424,11 +481,8 @@ stages: ArtifactType: Container parallel: true - # Windows With Compressed Metadata - - job: WindowsCompressedMetadata + - job: WindowsCompressedMetadata_vs variables: - - name: XUNIT_LOGS - value: $(Build.SourcesDirectory)\artifacts\TestResults\$(_configuration) - name: __VSNeverShowWhatsNew value: 1 pool: @@ -440,63 +494,29 @@ stages: demands: ImageOverride -equals $(WindowsMachineQueueName) timeoutInMinutes: 120 strategy: - maxParallel: 4 + maxParallel: 2 matrix: - coreclr_release: - _configuration: Release - _testKind: testCoreclr fsharpqa_release: _configuration: Release _testKind: testFSharpQA vs_release: _configuration: Release _testKind: testVs - transparent_compiler_release: - _configuration: Release - _testKind: testCoreclr - - ${{ if eq(variables['Build.Reason'], 'Flaky, disabled, was PullRequest') }}: - inttests_release: - _configuration: Release - _testKind: testIntegration + # inttests_release: + # _configuration: Release + # _testKind: testIntegration steps: - checkout: self - clean: true - + clean: true - powershell: eng\SetupVSHive.ps1 displayName: Setup VS Hive - condition: or(eq(variables['_testKind'], 'testVs'), eq(variables['_testKind'], 'testIntegration')) - - # yes, this is miserable, but - https://github.com/dotnet/arcade/issues/13239 - - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) - env: - DOTNET_DbgEnableMiniDump: 1 - DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. - DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)\$(Build.BuildId)-%e-%p-%t.dmp - NativeToolsOnMachine: true - displayName: Build / Test - condition: and( ne(variables['_testKind'], 'testIntegration'), ne(variables['System.JobName'], 'transparent_compiler_release') ) - - - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) + - script: eng\CIBuild.cmd -compressallmetadata -configuration Release -$(_testKind) env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. - DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)\$(Build.BuildId)-%e-%p-%t.dmp - TEST_TRANSPARENT_COMPILER: 1 - NativeToolsOnMachine: true - displayName: Build / Test Transparent Compiler - condition: and( eq(variables['System.JobName'], 'transparent_compiler_release'), ne(variables['_testKind'], 'testIntegration') ) - - - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) - env: - DOTNET_DbgEnableMiniDump: 1 - DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. - DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)\$(Build.BuildId)-%e-%p-%t.dmp + DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp NativeToolsOnMachine: true - displayName: Build / Integration Test - continueOnError: true - condition: eq(variables['_testKind'], 'testIntegration') - + displayName: Build - task: PublishTestResults@2 displayName: Publish Test Results inputs: @@ -545,11 +565,9 @@ stages: continueOnError: true condition: failed() - # Windows With Compressed Metadata Desktop - - job: WindowsCompressedMetadata_Desktop + # Windows With Compressed Metadata + - job: WindowsCompressedMetadata_Build variables: - - name: XUNIT_LOGS - value: $(Build.SourcesDirectory)\artifacts\TestResults\Release - name: __VSNeverShowWhatsNew value: 1 pool: @@ -560,38 +578,115 @@ stages: name: $(DncEngPublicBuildPool) demands: ImageOverride -equals $(WindowsMachineQueueName) timeoutInMinutes: 120 - strategy: - parallel: 4 steps: - checkout: self clean: true - - script: eng\CIBuild.cmd -compressallmetadata -configuration Release -testDesktop -testBatch $(System.JobPositionInPhase) + - script: eng\CIBuild.cmd -compressallmetadata -configuration Release env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp NativeToolsOnMachine: true - displayName: Build / Test + displayName: Build + - task: PublishPipelineArtifact@1 + displayName: 'Publish Pipeline Artifact' + inputs: + targetPath: '$(Build.SourcesDirectory)/artifacts' + artifact: 'WindowsCompressedMetadata_Build' + + - task: PublishBuildArtifacts@1 + displayName: Publish Tests BinLog + continueOnError: true + inputs: + PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/Release\Build.VisualFSharp.sln.binlog' + ArtifactName: 'WindowsCompressedMetadata test binlogs' + ArtifactType: Container + parallel: true + - task: PublishBuildArtifacts@1 + displayName: Publish Dumps + condition: failed() + continueOnError: true + inputs: + PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release' + ArtifactName: 'WindowsCompressedMetadata process dumps' + ArtifactType: Container + parallel: true + - 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 WindowsCompressedMetadata' + publishLocation: Container + continueOnError: true + condition: failed() + + - job: WindowsCompressedMetadata_Test + dependsOn: WindowsCompressedMetadata_Build + variables: + - name: XUNIT_LOGS + value: $(Build.SourcesDirectory)\artifacts\TestResults\$(_configuration) + - name: __VSNeverShowWhatsNew + value: 1 + 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: + coreclr_release: + _configuration: Release + _testKind: testCoreclr + transparent_compiler_release: + _configuration: Release + _testKind: testCoreclr + transparentCompiler: 1 + transparentCompilerPart: " TransparentCompiler" + steps: + - checkout: self + clean: true + + - task: DownloadPipelineArtifact@2 + displayName: 'Download Build Artifact' + inputs: + artifact: WindowsCompressedMetadata_Build + path: '$(Build.SourcesDirectory)/artifacts' + + - pwsh: ./eng/Build.ps1 -ci -restore -configuration $(_configuration) -$(_testKind) + workingDirectory: $(Build.SourcesDirectory) + env: + DOTNET_DbgEnableMiniDump: 1 + DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. + DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp + TEST_TRANSPARENT_COMPILER: $(transparentCompiler) + NativeToolsOnMachine: true + displayName: Test - task: PublishTestResults@2 displayName: Publish Test Results inputs: testResultsFormat: 'XUnit' - testRunTitle: WindowsCompressedMetadata testDesktop batch $(System.JobPositionInPhase) + testRunTitle: WindowsCompressedMetadata $(_testKind) mergeTestResults: true testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/Release' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)' continueOnError: true - - task: PublishBuildArtifacts@1 displayName: Publish Tests BinLog - condition: eq(variables['System.JobPositionInPhase'], 1) + condition: always() continueOnError: true inputs: - PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/Release\Build.VisualFSharp.sln.binlog' - ArtifactName: 'Windows testDesktop test binlogs' + PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/$(_configuration)\Build.VisualFSharp.sln.binlog' + ArtifactName: 'Windows $(_configuration) $(_testKind)$(transparentCompilerPart) test binlogs' ArtifactType: Container parallel: true - task: PublishBuildArtifacts@1 @@ -599,15 +694,15 @@ stages: condition: failed() continueOnError: true inputs: - PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release' - ArtifactName: 'Windows testDesktop process dumps $(System.JobPositionInPhase)' + PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\$(_configuration)' + ArtifactName: 'Windows $(_configuration) $(_testKind)$(transparentCompilerPart) process dumps' ArtifactType: Container parallel: true - task: PublishBuildArtifacts@1 displayName: Publish Test Logs inputs: - PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\Release' - ArtifactName: 'Windows testDesktop test logs batch $(System.JobPositionInPhase)' + PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\$(_configuration)' + ArtifactName: 'Windows $(_configuration) $(_testKind)$(transparentCompilerPart) test logs' publishLocation: Container continueOnError: true condition: always() @@ -618,10 +713,73 @@ stages: displayName: Publish NuGet cache contents inputs: PathtoPublish: '$(Build.SourcesDirectory)\artifacts\NugetPackageRootContents' - ArtifactName: 'NuGetPackageContents Windows testDesktop $(System.JobPositionInPhase)' + ArtifactName: 'NuGetPackageContents Windows $(_testKind)$(transparentCompilerPart)' publishLocation: Container continueOnError: true condition: failed() + + # Windows With Compressed Metadata Desktop + - job: WindowsCompressedMetadata_testDesktop + dependsOn: WindowsCompressedMetadata_Build + variables: + - name: XUNIT_LOGS + value: $(Build.SourcesDirectory)\artifacts\TestResults\Release + - name: __VSNeverShowWhatsNew + value: 1 + 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: + parallel: 4 + steps: + - checkout: self + clean: true + - task: DownloadPipelineArtifact@2 + displayName: 'Download Build Artifact' + inputs: + artifact: WindowsCompressedMetadata_Build + path: '$(Build.SourcesDirectory)/artifacts' + + - pwsh: ./eng/Build.ps1 -ci -restore -configuration Release -testDesktop -testBatch $(System.JobPositionInPhase) + workingDirectory: $(Build.SourcesDirectory) + env: + DOTNET_DbgEnableMiniDump: 1 + DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. + DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp + NativeToolsOnMachine: true + displayName: Test + + - task: PublishTestResults@2 + displayName: Publish Test Results + inputs: + testResultsFormat: 'XUnit' + testRunTitle: WindowsCompressedMetadata testDesktop batch=$(System.JobPositionInPhase) + mergeTestResults: true + testResultsFiles: '*.xml' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/Release' + continueOnError: true + - task: PublishBuildArtifacts@1 + displayName: Publish Dumps + condition: failed() + continueOnError: true + inputs: + PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release' + ArtifactName: 'Windows testDesktop process dumps batch=$(System.JobPositionInPhase)' + ArtifactType: Container + parallel: true + - task: PublishBuildArtifacts@1 + displayName: Publish Test Logs + inputs: + PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\Release' + ArtifactName: 'Windows testDesktop test logs batch=$(System.JobPositionInPhase)' + publishLocation: Container + continueOnError: true + condition: always() # Mock official build - job: MockOfficial From e3cada2206bd2c8c4b9413fd9532c28e7af43af2 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Mon, 5 May 2025 11:03:49 +0200 Subject: [PATCH 11/15] fix names --- azure-pipelines-PR.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines-PR.yml b/azure-pipelines-PR.yml index 117c2e7529d..8a3b053ef7e 100644 --- a/azure-pipelines-PR.yml +++ b/azure-pipelines-PR.yml @@ -675,7 +675,7 @@ stages: displayName: Publish Test Results inputs: testResultsFormat: 'XUnit' - testRunTitle: WindowsCompressedMetadata $(_testKind) + testRunTitle: WindowsCompressedMetadata $(_testKind)$(transparentCompilerPart) mergeTestResults: true testResultsFiles: '*.xml' searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)' @@ -758,7 +758,7 @@ stages: displayName: Publish Test Results inputs: testResultsFormat: 'XUnit' - testRunTitle: WindowsCompressedMetadata testDesktop batch=$(System.JobPositionInPhase) + testRunTitle: WindowsCompressedMetadata testDesktop batch $(System.JobPositionInPhase) mergeTestResults: true testResultsFiles: '*.xml' searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/Release' @@ -769,14 +769,14 @@ stages: continueOnError: true inputs: PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release' - ArtifactName: 'Windows testDesktop process dumps batch=$(System.JobPositionInPhase)' + ArtifactName: 'Windows testDesktop process dumps batch $(System.JobPositionInPhase)' ArtifactType: Container parallel: true - task: PublishBuildArtifacts@1 displayName: Publish Test Logs inputs: PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\Release' - ArtifactName: 'Windows testDesktop test logs batch=$(System.JobPositionInPhase)' + ArtifactName: 'Windows testDesktop test logs batch $(System.JobPositionInPhase)' publishLocation: Container continueOnError: true condition: always() From 88ed187e4e41c63762aac1426f1561c7275f815b Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Mon, 5 May 2025 19:49:47 +0200 Subject: [PATCH 12/15] fix env var --- azure-pipelines-PR.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines-PR.yml b/azure-pipelines-PR.yml index 8a3b053ef7e..bcc6926cd7e 100644 --- a/azure-pipelines-PR.yml +++ b/azure-pipelines-PR.yml @@ -646,10 +646,11 @@ stages: coreclr_release: _configuration: Release _testKind: testCoreclr + transparentCompilerPart: "" transparent_compiler_release: _configuration: Release _testKind: testCoreclr - transparentCompiler: 1 + TEST_TRANSPARENT_COMPILER: 1 #Pipeline variables map to env vars. transparentCompilerPart: " TransparentCompiler" steps: - checkout: self @@ -667,7 +668,6 @@ stages: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp - TEST_TRANSPARENT_COMPILER: $(transparentCompiler) NativeToolsOnMachine: true displayName: Test @@ -675,7 +675,7 @@ stages: displayName: Publish Test Results inputs: testResultsFormat: 'XUnit' - testRunTitle: WindowsCompressedMetadata $(_testKind)$(transparentCompilerPart) + testRunTitle: 'WindowsCompressedMetadata $(_testKind)$(transparentCompilerPart)' mergeTestResults: true testResultsFiles: '*.xml' searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)' From df63fe8c1e07deeb28eca45c0d4393160ba13a66 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Thu, 15 May 2025 19:21:54 +0200 Subject: [PATCH 13/15] revert build / test split --- azure-pipelines-PR.yml | 291 ++++++++--------------------------------- 1 file changed, 56 insertions(+), 235 deletions(-) diff --git a/azure-pipelines-PR.yml b/azure-pipelines-PR.yml index bcc6926cd7e..1cf8c77ee1b 100644 --- a/azure-pipelines-PR.yml +++ b/azure-pipelines-PR.yml @@ -256,7 +256,8 @@ stages: ArtifactName: 'Windows Release WindowsLangVersionPreview process dumps' ArtifactType: Container parallel: true - - job: WindowsNoRealsig_Build + + - job: WindowsNoRealsig_testCoreclr pool: # The PR build definition sets this variable: # WindowsMachineQueueName=Windows.vs2022.amd64.open @@ -269,19 +270,13 @@ stages: - checkout: self clean: true - - script: eng\CIBuild.cmd -compressallmetadata -buildnorealsig -configuration Release + - script: eng\CIBuild.cmd -compressallmetadata -buildnorealsig -testCoreclr -configuration Release env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp NativeToolsOnMachine: true displayName: Build - - - task: PublishPipelineArtifact@1 - displayName: 'Publish Pipeline Artifact' - inputs: - targetPath: '$(Build.SourcesDirectory)/artifacts' - artifact: WindowsNoRealsig_Build - task: PublishBuildArtifacts@1 displayName: Publish Build BinLog @@ -292,59 +287,6 @@ stages: ArtifactName: 'Windows Release build binlogs' ArtifactType: Container parallel: true - - task: PublishBuildArtifacts@1 - displayName: Publish Dumps - condition: failed() - continueOnError: true - inputs: - PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release' - ArtifactName: 'Windows Release WindowsNoRealsig_Build process dumps' - ArtifactType: Container - parallel: true - - - job: WindowsNoRealsig_testCoreclr - dependsOn: WindowsNoRealsig_Build - 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 - steps: - - checkout: self - clean: true - - - task: DownloadPipelineArtifact@2 - displayName: 'Download Build Artifact' - inputs: - artifact: WindowsNoRealsig_Build - path: '$(Build.SourcesDirectory)/artifacts' - - - script: | - echo "Listing downloaded pipeline artifact" - dir "$(Build.SourcesDirectory)/artifacts" - displayName: 'List Pipeline Workspace' - - - pwsh: eng\Build.ps1 -ci -restore -testCoreclr -configuration Release - env: - DOTNET_DbgEnableMiniDump: 1 - DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. - DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp - NativeToolsOnMachine: true - displayName: Build - - - task: PublishTestResults@2 - displayName: Publish Test Results - inputs: - testResultsFormat: 'XUnit' - testRunTitle: WindowsNoRealsig_testCoreclr - mergeTestResults: true - testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/Release' - continueOnError: true - - task: PublishBuildArtifacts@1 displayName: Publish Dumps condition: failed() @@ -356,7 +298,6 @@ stages: parallel: true - job: WindowsNoRealsig_testDesktop - dependsOn: WindowsNoRealsig_Build pool: # The PR build definition sets this variable: # WindowsMachineQueueName=Windows.vs2022.amd64.open @@ -370,14 +311,8 @@ stages: steps: - checkout: self clean: true - - - task: DownloadPipelineArtifact@2 - displayName: 'Download Build Artifact' - inputs: - artifact: WindowsNoRealsig_Build - path: '$(Build.SourcesDirectory)/artifacts' - - - pwsh: eng\Build.ps1 -ci -restore -configuration Release -testDesktop -testBatch $(System.JobPositionInPhase) + + - script: eng\CIBuild.cmd -compressallmetadata -buildnorealsig -testDesktop -configuration Release -testBatch $(System.JobPositionInPhase) env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. @@ -394,7 +329,15 @@ stages: testResultsFiles: '*.xml' searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/Release' continueOnError: true - + - task: PublishBuildArtifacts@1 + displayName: Publish Build BinLog + condition: eq(variables['System.JobPositionInPhase'], 1) + continueOnError: true + inputs: + PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/Release\Build.VisualFSharp.sln.binlog' + ArtifactName: 'Windows Release build binlogs' + ArtifactType: Container + parallel: true - task: PublishBuildArtifacts@1 displayName: Publish Dumps condition: failed() @@ -481,8 +424,11 @@ stages: ArtifactType: Container parallel: true - - job: WindowsCompressedMetadata_vs + # Windows With Compressed Metadata + - job: WindowsCompressedMetadata variables: + - name: XUNIT_LOGS + value: $(Build.SourcesDirectory)\artifacts\TestResults\$(_configuration) - name: __VSNeverShowWhatsNew value: 1 pool: @@ -494,29 +440,42 @@ stages: demands: ImageOverride -equals $(WindowsMachineQueueName) timeoutInMinutes: 120 strategy: - maxParallel: 2 + maxParallel: 4 matrix: + coreclr_release: + _configuration: Release + _testKind: testCoreclr fsharpqa_release: _configuration: Release _testKind: testFSharpQA vs_release: _configuration: Release _testKind: testVs + setupVsHive: true + transparent_compiler_release: + _configuration: Release + _testKind: testCoreclr + TEST_TRANSPARENT_COMPILER: 1 # Pipeline variables map to env vars. # inttests_release: # _configuration: Release # _testKind: testIntegration + # setupVsHive: true steps: - checkout: self - clean: true + clean: true + - powershell: eng\SetupVSHive.ps1 displayName: Setup VS Hive - - script: eng\CIBuild.cmd -compressallmetadata -configuration Release -$(_testKind) + condition: eq(variables['setupVsHive'], 'true') + + - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. - DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp + DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)\$(Build.BuildId)-%e-%p-%t.dmp NativeToolsOnMachine: true - displayName: Build + displayName: Build and Test $(_testKind) + - task: PublishTestResults@2 displayName: Publish Test Results inputs: @@ -565,71 +524,11 @@ stages: continueOnError: true condition: failed() - # Windows With Compressed Metadata - - job: WindowsCompressedMetadata_Build - variables: - - name: __VSNeverShowWhatsNew - value: 1 - 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 - - steps: - - checkout: self - clean: true - - - script: eng\CIBuild.cmd -compressallmetadata -configuration Release - env: - DOTNET_DbgEnableMiniDump: 1 - DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. - DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp - NativeToolsOnMachine: true - displayName: Build - - task: PublishPipelineArtifact@1 - displayName: 'Publish Pipeline Artifact' - inputs: - targetPath: '$(Build.SourcesDirectory)/artifacts' - artifact: 'WindowsCompressedMetadata_Build' - - - task: PublishBuildArtifacts@1 - displayName: Publish Tests BinLog - continueOnError: true - inputs: - PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/Release\Build.VisualFSharp.sln.binlog' - ArtifactName: 'WindowsCompressedMetadata test binlogs' - ArtifactType: Container - parallel: true - - task: PublishBuildArtifacts@1 - displayName: Publish Dumps - condition: failed() - continueOnError: true - inputs: - PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release' - ArtifactName: 'WindowsCompressedMetadata process dumps' - ArtifactType: Container - parallel: true - - 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 WindowsCompressedMetadata' - publishLocation: Container - continueOnError: true - condition: failed() - - - job: WindowsCompressedMetadata_Test - dependsOn: WindowsCompressedMetadata_Build + # Windows With Compressed Metadata Desktop + - job: WindowsCompressedMetadata_Desktop variables: - name: XUNIT_LOGS - value: $(Build.SourcesDirectory)\artifacts\TestResults\$(_configuration) + value: $(Build.SourcesDirectory)\artifacts\TestResults\Release - name: __VSNeverShowWhatsNew value: 1 pool: @@ -641,52 +540,37 @@ stages: demands: ImageOverride -equals $(WindowsMachineQueueName) timeoutInMinutes: 120 strategy: - maxParallel: 4 - matrix: - coreclr_release: - _configuration: Release - _testKind: testCoreclr - transparentCompilerPart: "" - transparent_compiler_release: - _configuration: Release - _testKind: testCoreclr - TEST_TRANSPARENT_COMPILER: 1 #Pipeline variables map to env vars. - transparentCompilerPart: " TransparentCompiler" + parallel: 4 + steps: - checkout: self clean: true - - - task: DownloadPipelineArtifact@2 - displayName: 'Download Build Artifact' - inputs: - artifact: WindowsCompressedMetadata_Build - path: '$(Build.SourcesDirectory)/artifacts' - - - pwsh: ./eng/Build.ps1 -ci -restore -configuration $(_configuration) -$(_testKind) - workingDirectory: $(Build.SourcesDirectory) + + - script: eng\CIBuild.cmd -compressallmetadata -configuration Release -testDesktop -testBatch $(System.JobPositionInPhase) env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp NativeToolsOnMachine: true - displayName: Test + displayName: Build / Test - task: PublishTestResults@2 displayName: Publish Test Results inputs: testResultsFormat: 'XUnit' - testRunTitle: 'WindowsCompressedMetadata $(_testKind)$(transparentCompilerPart)' + testRunTitle: WindowsCompressedMetadata testDesktop batch $(System.JobPositionInPhase) mergeTestResults: true testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/Release' continueOnError: true + - task: PublishBuildArtifacts@1 - displayName: Publish Tests BinLog - condition: always() + displayName: Publish BinLog + condition: eq(variables['System.JobPositionInPhase'], 1) continueOnError: true inputs: - PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/$(_configuration)\Build.VisualFSharp.sln.binlog' - ArtifactName: 'Windows $(_configuration) $(_testKind)$(transparentCompilerPart) test binlogs' + PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/Release\Build.VisualFSharp.sln.binlog' + ArtifactName: 'Windows testDesktop binlogs' ArtifactType: Container parallel: true - task: PublishBuildArtifacts@1 @@ -694,15 +578,15 @@ stages: condition: failed() continueOnError: true inputs: - PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\$(_configuration)' - ArtifactName: 'Windows $(_configuration) $(_testKind)$(transparentCompilerPart) process dumps' + PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release' + ArtifactName: 'Windows testDesktop process dumps $(System.JobPositionInPhase)' ArtifactType: Container parallel: true - task: PublishBuildArtifacts@1 displayName: Publish Test Logs inputs: - PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\$(_configuration)' - ArtifactName: 'Windows $(_configuration) $(_testKind)$(transparentCompilerPart) test logs' + PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\Release' + ArtifactName: 'Windows testDesktop test logs batch $(System.JobPositionInPhase)' publishLocation: Container continueOnError: true condition: always() @@ -713,73 +597,10 @@ stages: displayName: Publish NuGet cache contents inputs: PathtoPublish: '$(Build.SourcesDirectory)\artifacts\NugetPackageRootContents' - ArtifactName: 'NuGetPackageContents Windows $(_testKind)$(transparentCompilerPart)' + ArtifactName: 'NuGetPackageContents Windows testDesktop $(System.JobPositionInPhase)' publishLocation: Container continueOnError: true condition: failed() - - # Windows With Compressed Metadata Desktop - - job: WindowsCompressedMetadata_testDesktop - dependsOn: WindowsCompressedMetadata_Build - variables: - - name: XUNIT_LOGS - value: $(Build.SourcesDirectory)\artifacts\TestResults\Release - - name: __VSNeverShowWhatsNew - value: 1 - 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: - parallel: 4 - steps: - - checkout: self - clean: true - - task: DownloadPipelineArtifact@2 - displayName: 'Download Build Artifact' - inputs: - artifact: WindowsCompressedMetadata_Build - path: '$(Build.SourcesDirectory)/artifacts' - - - pwsh: ./eng/Build.ps1 -ci -restore -configuration Release -testDesktop -testBatch $(System.JobPositionInPhase) - workingDirectory: $(Build.SourcesDirectory) - env: - DOTNET_DbgEnableMiniDump: 1 - DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. - DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp - NativeToolsOnMachine: true - displayName: Test - - - task: PublishTestResults@2 - displayName: Publish Test Results - inputs: - testResultsFormat: 'XUnit' - testRunTitle: WindowsCompressedMetadata testDesktop batch $(System.JobPositionInPhase) - mergeTestResults: true - testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/Release' - continueOnError: true - - task: PublishBuildArtifacts@1 - displayName: Publish Dumps - condition: failed() - continueOnError: true - inputs: - PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release' - ArtifactName: 'Windows testDesktop process dumps batch $(System.JobPositionInPhase)' - ArtifactType: Container - parallel: true - - task: PublishBuildArtifacts@1 - displayName: Publish Test Logs - inputs: - PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\Release' - ArtifactName: 'Windows testDesktop test logs batch $(System.JobPositionInPhase)' - publishLocation: Container - continueOnError: true - condition: always() # Mock official build - job: MockOfficial From c88b0aad6c89f5adf1f30656509be168644697fa Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Thu, 15 May 2025 20:34:35 +0200 Subject: [PATCH 14/15] displayname for transparent compiler --- azure-pipelines-PR.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/azure-pipelines-PR.yml b/azure-pipelines-PR.yml index 1cf8c77ee1b..85968735e23 100644 --- a/azure-pipelines-PR.yml +++ b/azure-pipelines-PR.yml @@ -456,6 +456,7 @@ stages: _configuration: Release _testKind: testCoreclr TEST_TRANSPARENT_COMPILER: 1 # Pipeline variables map to env vars. + transparentCompilerSuffix: TransparentCompiler # inttests_release: # _configuration: Release # _testKind: testIntegration @@ -474,13 +475,13 @@ stages: DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)\$(Build.BuildId)-%e-%p-%t.dmp NativeToolsOnMachine: true - displayName: Build and Test $(_testKind) + displayName: Build and Test $(_testKind) $[variables['transparentCompilerSuffix']] - task: PublishTestResults@2 displayName: Publish Test Results inputs: testResultsFormat: 'XUnit' - testRunTitle: WindowsCompressedMetadata $(_testKind) + testRunTitle: WindowsCompressedMetadata $(_testKind) $[variables['transparentCompilerSuffix']] mergeTestResults: true testResultsFiles: '*.xml' searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)' @@ -492,7 +493,7 @@ stages: continueOnError: true inputs: PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/$(_configuration)\Build.VisualFSharp.sln.binlog' - ArtifactName: 'Windows $(_configuration) $(_testKind) test binlogs' + ArtifactName: Windows $(_configuration) $(_testKind) $[variables['transparentCompilerSuffix']] test binlogs ArtifactType: Container parallel: true - task: PublishBuildArtifacts@1 @@ -508,7 +509,7 @@ stages: displayName: Publish Test Logs inputs: PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\$(_configuration)' - ArtifactName: 'Windows $(_configuration) $(_testKind) test logs' + ArtifactName: Windows $(_configuration) $(_testKind) $[variables['transparentCompilerSuffix']] test logs publishLocation: Container continueOnError: true condition: always() From 88be2a4b01d3c7e99bc56bc72352831e951bf22c Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Thu, 15 May 2025 22:23:23 +0200 Subject: [PATCH 15/15] fix vars --- azure-pipelines-PR.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/azure-pipelines-PR.yml b/azure-pipelines-PR.yml index 85968735e23..cc88c091482 100644 --- a/azure-pipelines-PR.yml +++ b/azure-pipelines-PR.yml @@ -440,23 +440,25 @@ stages: demands: ImageOverride -equals $(WindowsMachineQueueName) timeoutInMinutes: 120 strategy: - maxParallel: 4 matrix: coreclr_release: _configuration: Release _testKind: testCoreclr + transparentCompiler: # Empty display name part. fsharpqa_release: _configuration: Release _testKind: testFSharpQA + transparentCompiler: vs_release: _configuration: Release _testKind: testVs setupVsHive: true + transparentCompiler: transparent_compiler_release: _configuration: Release _testKind: testCoreclr - TEST_TRANSPARENT_COMPILER: 1 # Pipeline variables map to env vars. - transparentCompilerSuffix: TransparentCompiler + TEST_TRANSPARENT_COMPILER: 1 # Pipeline variable will map to env var. + transparentCompiler: TransparentCompiler # inttests_release: # _configuration: Release # _testKind: testIntegration @@ -467,7 +469,7 @@ stages: - powershell: eng\SetupVSHive.ps1 displayName: Setup VS Hive - condition: eq(variables['setupVsHive'], 'true') + condition: eq(variables.setupVsHive, 'true') - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) env: @@ -475,13 +477,13 @@ stages: DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)\$(Build.BuildId)-%e-%p-%t.dmp NativeToolsOnMachine: true - displayName: Build and Test $(_testKind) $[variables['transparentCompilerSuffix']] + displayName: Build and Test $(_testKind) $(transparentCompiler) - task: PublishTestResults@2 displayName: Publish Test Results inputs: testResultsFormat: 'XUnit' - testRunTitle: WindowsCompressedMetadata $(_testKind) $[variables['transparentCompilerSuffix']] + testRunTitle: WindowsCompressedMetadata $(_testKind) $(transparentCompiler) mergeTestResults: true testResultsFiles: '*.xml' searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)' @@ -493,7 +495,7 @@ stages: continueOnError: true inputs: PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/$(_configuration)\Build.VisualFSharp.sln.binlog' - ArtifactName: Windows $(_configuration) $(_testKind) $[variables['transparentCompilerSuffix']] test binlogs + ArtifactName: Windows $(_configuration) $(_testKind) $(transparentCompiler) test binlogs ArtifactType: Container parallel: true - task: PublishBuildArtifacts@1 @@ -509,7 +511,7 @@ stages: displayName: Publish Test Logs inputs: PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\$(_configuration)' - ArtifactName: Windows $(_configuration) $(_testKind) $[variables['transparentCompilerSuffix']] test logs + ArtifactName: Windows $(_configuration) $(_testKind) $(transparentCompilerSuffix) test logs publishLocation: Container continueOnError: true condition: always()