Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add and utilize -testBenchmark build option #16600

Merged
merged 4 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 2 additions & 19 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CI and PR triggers
# CI and PR triggers
trigger:
branches:
include:
Expand Down Expand Up @@ -724,24 +724,7 @@ stages:
steps:
- checkout: self
clean: true
- script: dotnet --list-sdks
displayName: Report dotnet SDK versions
- task: UseDotNet@2
displayName: install SDK
inputs:
packageType: sdk
useGlobalJson: true
includePreviewVersions: true
workingDirectory: $(Build.SourcesDirectory)
installationPath: $(Agent.ToolsDirectory)/dotnet
- script: dotnet build -c $(_BuildConfig) .\FSharp.Benchmarks.sln /bl:\"artifacts/log/$(_BuildConfig)/BenchmarkBuild.binlog\"
workingDirectory: $(Build.SourcesDirectory)
displayName: Plain build of FSharp.Benchmarks.sln
continueOnError: true
condition: always()
- script: .\Build.cmd -c $(_BuildConfig)
- pwsh: ./SmokeTestBenchmarks.ps1
workingDirectory: $(Build.SourcesDirectory)/tests/benchmarks
- script: eng\CIBuild.cmd --configuration $(_BuildConfig) -testBenchmarks
displayName: Smoke test fast benchmarks

# Test trimming on Windows
Expand Down
23 changes: 22 additions & 1 deletion eng/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ param (
[switch]$testAllButIntegration,
[switch]$testpack,
[switch]$testAOT,
[switch]$testBenchmarks,
[string]$officialSkipTests = "false",
[switch]$noVisualStudio,
[switch]$sourceBuild,
Expand Down Expand Up @@ -111,6 +112,7 @@ function Print-Usage() {
Write-Host " -testVs Run F# editor unit tests"
Write-Host " -testpack Verify built packages"
Write-Host " -testAOT Run AOT/Trimming tests"
Write-Host " -testBenchmarks Build and Run Benchmark suite"
Write-Host " -officialSkipTests <bool> Set to 'true' to skip running tests"
Write-Host ""
Write-Host "Advanced settings:"
Expand Down Expand Up @@ -176,6 +178,7 @@ function Process-Arguments() {
$script:testVs = $False
$script:testpack = $False
$script:testAOT = $False
$script:testBenchmarks = $False
$script:verifypackageshipstatus = $True
}

Expand Down Expand Up @@ -211,6 +214,10 @@ function Process-Arguments() {
$script:pack = $True;
}

if ($testBenchmarks) {
$script:testBenchmarks = $True
}

foreach ($property in $properties) {
if (!$property.StartsWith("/p:", "InvariantCultureIgnoreCase")) {
Write-Host "Invalid argument: $property"
Expand Down Expand Up @@ -339,7 +346,7 @@ function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [str

if ($env:RunningAsPullRequest -ne "true" -and $noTestFilter -eq $false) {
$args += " --filter TestCategory!=PullRequest"
}
}`

if ($asBackgroundJob) {
Write-Host("Starting on the background: $args")
Expand Down Expand Up @@ -541,12 +548,20 @@ try {
}
}

if ($testBenchmarks) {
$properties_storage = $properties
$properties += "/p:RuntimeIdentifier=win-x64"
BuildSolution "FSharp.Benchmarks.sln" $False
$properties = $properties_storage
}

if ($pack) {
$properties_storage = $properties
$properties += "/p:GenerateSbom=false"
BuildSolution "Microsoft.FSharp.Compiler.sln" $True
$properties = $properties_storage
}

if ($build) {
VerifyAssemblyVersionsAndSymbols
}
Expand Down Expand Up @@ -662,6 +677,12 @@ try {
Pop-Location
}

if ($testBenchmarks) {
Push-Location "$RepoRoot\tests\benchmarks"
./SmokeTestBenchmarks.ps1
Pop-Location
}

# verify nupkgs have access to the source code
$nupkgtestFailed = $false
if ($testpack) {
Expand Down
Loading