macOS: Cache only the latest version of CodeQL (#8420)
Previously, we cached two versions since we prioritized hitting the toolcache over landing new releases quicker. However after experimenting with this, we have decided to prioritize getting new releases into customers' hands more quickly.
This commit is contained in:
@@ -129,39 +129,15 @@ Describe "VirtualBox" -Skip:($os.IsBigSur -or $os.IsVentura -or $os.IsVenturaArm
|
||||
}
|
||||
}
|
||||
|
||||
Describe "CodeQLBundles" {
|
||||
It "Latest CodeQL Bundle" {
|
||||
$CodeQLVersionWildcards = Join-Path $Env:AGENT_TOOLSDIRECTORY -ChildPath "CodeQL" | Join-Path -ChildPath "*"
|
||||
$LatestCodeQLVersionPath = Get-ChildItem $CodeQLVersionWildcards | Sort-Object -Property { [SemVer]$_.name } -Descending | Select-Object -First 1 -Expand FullName
|
||||
$LatestCodeQLPath = Join-Path $LatestCodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql"
|
||||
"$LatestCodeQLPath version --quiet" | Should -ReturnZeroExitCode
|
||||
Describe "CodeQL Bundle" {
|
||||
It "Is installed" {
|
||||
$CodeQLVersionWildcard = Join-Path $Env:AGENT_TOOLSDIRECTORY -ChildPath "CodeQL" | Join-Path -ChildPath "*"
|
||||
$CodeQLVersionPath = Get-ChildItem $CodeQLVersionWildcard | Select-Object -First 1 -Expand FullName
|
||||
$CodeQLPath = Join-Path $CodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql"
|
||||
"$CodeQLPath version --quiet" | Should -ReturnZeroExitCode
|
||||
|
||||
$LatestCodeQLPacksPath = Join-Path $LatestCodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "qlpacks"
|
||||
$LatestCodeQLPacksPath | Should -Exist
|
||||
}
|
||||
|
||||
It "Prior CodeQL Bundle" {
|
||||
$CodeQLVersionWildcards = Join-Path $Env:AGENT_TOOLSDIRECTORY -ChildPath "CodeQL" | Join-Path -ChildPath "*"
|
||||
$PriorCodeQLVersionPath = Get-ChildItem $CodeQLVersionWildcards | Sort-Object -Property { [SemVer]$_.name } -Descending | Select-Object -Last 1 -Expand FullName
|
||||
$PriorCodeQLPath = Join-Path $PriorCodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql"
|
||||
"$PriorCodeQLPath version --quiet" | Should -ReturnZeroExitCode
|
||||
|
||||
$PriorCodeQLPacksPath = Join-Path $PriorCodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "qlpacks"
|
||||
$PriorCodeQLPacksPath | Should -Exist
|
||||
}
|
||||
|
||||
It "Latest and Prior CodeQL Bundles are unique" {
|
||||
$CodeQLVersionWildcards = Join-Path $Env:AGENT_TOOLSDIRECTORY -ChildPath "CodeQL" | Join-Path -ChildPath "*"
|
||||
|
||||
$LatestCodeQLVersionPath = Get-ChildItem $CodeQLVersionWildcards | Sort-Object -Property { [SemVer]$_.name } -Descending | Select-Object -First 1 -Expand FullName
|
||||
$LatestCodeQLPath = Join-Path $LatestCodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql"
|
||||
$LatestCodeQLVersion = & $LatestCodeQLPath version --quiet
|
||||
|
||||
$PriorCodeQLVersionPath = Get-ChildItem $CodeQLVersionWildcards | Sort-Object -Property { [SemVer]$_.name } -Descending | Select-Object -Last 1 -Expand FullName
|
||||
$PriorCodeQLPath = Join-Path $PriorCodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql"
|
||||
$PriorCodeQLVersion = & $PriorCodeQLPath version --quiet
|
||||
|
||||
$LatestCodeQLVersion | Should -Not -Match $PriorCodeQLVersion
|
||||
$CodeQLPacksPath = Join-Path $CodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "qlpacks"
|
||||
$CodeQLPacksPath | Should -Exist
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user