From 9337c6edb44c72f0fc1874ea834025b0c6f5be09 Mon Sep 17 00:00:00 2001 From: Chris Gavin Date: Tue, 15 Sep 2020 13:54:28 +0100 Subject: [PATCH] Fix not being able to find CodeQL. --- images/win/scripts/Installers/Install-CodeQLBundle.ps1 | 1 - images/win/scripts/Tests/Tools.Tests.ps1 | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/images/win/scripts/Installers/Install-CodeQLBundle.ps1 b/images/win/scripts/Installers/Install-CodeQLBundle.ps1 index d5ecf1b5a..46a597592 100644 --- a/images/win/scripts/Installers/Install-CodeQLBundle.ps1 +++ b/images/win/scripts/Installers/Install-CodeQLBundle.ps1 @@ -19,5 +19,4 @@ $UnGzipedCodeQLBundlePath = Join-Path $DownloadDirectoryPath "codeql-bundle.tar" Extract-7Zip -Path $UnGzipedCodeQLBundlePath -DestinationPath $ExtractionDirectory # Test that the tool has been extracted successfully. -$Env:CODEQL_EXTRACTION_DIRECTORY = $ExtractionDirectory Invoke-PesterTests -TestFile "Tools" -TestName "CodeQLBundle" diff --git a/images/win/scripts/Tests/Tools.Tests.ps1 b/images/win/scripts/Tests/Tools.Tests.ps1 index c2b52baf9..4470dda01 100644 --- a/images/win/scripts/Tests/Tools.Tests.ps1 +++ b/images/win/scripts/Tests/Tools.Tests.ps1 @@ -43,7 +43,9 @@ Describe "CMake" { Describe "CodeQLBundle" { It "CodeQLBundle" { - $CodeQLPath = Join-Path $Env:CODEQL_EXTRACTION_DIRECTORY -ChildPath "codeql" | Join-Path -ChildPath "codeql.exe" + $CodeQLVersionsWildcard = Join-Path $Env:AGENT_TOOLSDIRECTORY -ChildPath "codeql" | Join-Path -ChildPath "*" + $CodeQLVersionPath = (Get-Item $CodeQLVersionsWildcard).FullPath + $CodeQLPath = Join-Path CodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql.exe" "$CodeQLPath version" | Should -ReturnZeroExitCode } }