diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index 2b5642b74ce638caf9e9cc0810282721d59a1437..fbfd42f40969b35c062a16bb2b4af352fb5701f3 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -297,6 +297,12 @@ jobs: beforeBuild: - powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1" displayName: Setup IISExpress test certificates and schema + - powershell: "& ./.azure/pipelines/tools/SetupTestEnvironment.ps1 Setup signalrclienttests.exe" + displayName: Start AppVerifier + afterBuild: + - powershell: "& ./.azure/pipelines/tools/SetupTestEnvironment.ps1 Shutdown signalrclienttests.exe" + displayName: Stop AppVerifier + condition: always() artifacts: - name: Windows_Test_Logs path: artifacts/logs/ diff --git a/.azure/pipelines/signalr-daily-tests.yml b/.azure/pipelines/signalr-daily-tests.yml index 2e74597f738ae1ce0075a96cbf2edf4ad33def89..3269b2657a70b24b8045e975a8acb592227c2130 100644 --- a/.azure/pipelines/signalr-daily-tests.yml +++ b/.azure/pipelines/signalr-daily-tests.yml @@ -14,4 +14,11 @@ jobs: agentOs: Windows jobName: SignalRDailyTests jobDisplayName: "SignalR Daily Tests" + beforeBuild: + - powershell: "& ./.azure/pipelines/tools/SetupTestEnvironment.ps1 Setup signalrclienttests.exe" + displayName: Start AppVerifier + afterBuild: + - powershell: "& ./.azure/pipelines/tools/SetupTestEnvironment.ps1 Shutdown signalrclienttests.exe" + displayName: Stop AppVerifier + condition: always() diff --git a/src/Servers/IIS/tools/SetupTestEnvironment.ps1 b/.azure/pipelines/tools/SetupTestEnvironment.ps1 similarity index 83% rename from src/Servers/IIS/tools/SetupTestEnvironment.ps1 rename to .azure/pipelines/tools/SetupTestEnvironment.ps1 index d4bf062624f0c308532357e35978aa8ee309b7b9..f985bfa0879687d7783ef8f4dc76bed4c194f229 100644 --- a/src/Servers/IIS/tools/SetupTestEnvironment.ps1 +++ b/.azure/pipelines/tools/SetupTestEnvironment.ps1 @@ -1,14 +1,11 @@ -param($Mode) - -# TEMP TEMP TEMP -# While doing https://github.com/aspnet/AspNetCore/pull/5705 I accidentally disabled ANCM on CI machines using -# the registy key. Remove it to allow tests to pass - -Remove-Item "HKLM:\SOFTWARE\Microsoft\IIS Extensions\IIS AspNetCore Module V2\Parameters" -ErrorAction Ignore; +param( + [string]$Mode, + [string[]]$exes +) if (!($DumpFolder)) { - $DumpFolder = "$PSScriptRoot\..\..\..\..\artifacts\logs\dumps" + $DumpFolder = "$PSScriptRoot\..\..\..\artifacts\logs\dumps" } if (!(Test-Path $DumpFolder)) { @@ -16,17 +13,9 @@ if (!(Test-Path $DumpFolder)) } $DumpFolder = Resolve-Path $DumpFolder -$LogsFolder = "$PSScriptRoot\..\artifacts\logs" -if (!(Test-Path $LogsFolder)) -{ - New-Item $LogsFolder -ItemType Directory; -} -$LogsFolder = Resolve-Path $LogsFolder - $werHive = "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting"; $ldHive = "$werHive\LocalDumps"; - function Setup-appverif($application) { appverif.exe -enable Exceptions Handles Heaps Leak Locks Memory Threadpool TLS SRWLock -for $application @@ -70,7 +59,7 @@ function Shutdown-appverif($application) function Setup-Dumps() { - if (!(Test-Path $ldHive )) + if (!(Test-Path $ldHive)) { New-Item -Path $werHive -Name LocalDumps } @@ -116,24 +105,27 @@ function Shutdown-Dumps() if ($Mode -eq "Setup") { - Setup-appverif w3wp.exe - Setup-appverif iisexpress.exe + foreach ($element in $exes) { + Setup-appverif $element + } Setup-Dumps; } if ($Mode -eq "SetupDumps") { - Shutdown-appverif w3wp.exe - Shutdown-appverif iisexpress.exe + foreach ($element in $exes) { + Shutdown-appverif $element + } Setup-Dumps; } if ($Mode -eq "Shutdown") { - Shutdown-appverif w3wp.exe - Shutdown-appverif iisexpress.exe + foreach ($element in $exes) { + Shutdown-appverif $element + } Shutdown-Dumps; }