Skip to content

Commit a936d77

Browse files
Automatically capture crashdumps for C++ client tests (#7940)
1 parent b6216b6 commit a936d77

File tree

3 files changed

+28
-23
lines changed

3 files changed

+28
-23
lines changed

.azure/pipelines/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,12 @@ jobs:
297297
beforeBuild:
298298
- powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1"
299299
displayName: Setup IISExpress test certificates and schema
300+
- powershell: "& ./.azure/pipelines/tools/SetupTestEnvironment.ps1 Setup signalrclienttests.exe"
301+
displayName: Start AppVerifier
302+
afterBuild:
303+
- powershell: "& ./.azure/pipelines/tools/SetupTestEnvironment.ps1 Shutdown signalrclienttests.exe"
304+
displayName: Stop AppVerifier
305+
condition: always()
300306
artifacts:
301307
- name: Windows_Test_Logs
302308
path: artifacts/logs/

.azure/pipelines/signalr-daily-tests.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,11 @@ jobs:
1414
agentOs: Windows
1515
jobName: SignalRDailyTests
1616
jobDisplayName: "SignalR Daily Tests"
17+
beforeBuild:
18+
- powershell: "& ./.azure/pipelines/tools/SetupTestEnvironment.ps1 Setup signalrclienttests.exe"
19+
displayName: Start AppVerifier
20+
afterBuild:
21+
- powershell: "& ./.azure/pipelines/tools/SetupTestEnvironment.ps1 Shutdown signalrclienttests.exe"
22+
displayName: Stop AppVerifier
23+
condition: always()
1724

src/Servers/IIS/tools/SetupTestEnvironment.ps1 renamed to .azure/pipelines/tools/SetupTestEnvironment.ps1

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,21 @@
1-
param($Mode)
2-
3-
# TEMP TEMP TEMP
4-
# While doing https://github.com/aspnet/AspNetCore/pull/5705 I accidentally disabled ANCM on CI machines using
5-
# the registy key. Remove it to allow tests to pass
6-
7-
Remove-Item "HKLM:\SOFTWARE\Microsoft\IIS Extensions\IIS AspNetCore Module V2\Parameters" -ErrorAction Ignore;
1+
param(
2+
[string]$Mode,
3+
[string[]]$exes
4+
)
85

96
if (!($DumpFolder))
107
{
11-
$DumpFolder = "$PSScriptRoot\..\..\..\..\artifacts\logs\dumps"
8+
$DumpFolder = "$PSScriptRoot\..\..\..\artifacts\logs\dumps"
129
}
1310
if (!(Test-Path $DumpFolder))
1411
{
1512
New-Item $DumpFolder -ItemType Directory;
1613
}
1714
$DumpFolder = Resolve-Path $DumpFolder
1815

19-
$LogsFolder = "$PSScriptRoot\..\artifacts\logs"
20-
if (!(Test-Path $LogsFolder))
21-
{
22-
New-Item $LogsFolder -ItemType Directory;
23-
}
24-
$LogsFolder = Resolve-Path $LogsFolder
25-
2616
$werHive = "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting";
2717
$ldHive = "$werHive\LocalDumps";
2818

29-
3019
function Setup-appverif($application)
3120
{
3221
appverif.exe -enable Exceptions Handles Heaps Leak Locks Memory Threadpool TLS SRWLock -for $application
@@ -70,7 +59,7 @@ function Shutdown-appverif($application)
7059

7160
function Setup-Dumps()
7261
{
73-
if (!(Test-Path $ldHive ))
62+
if (!(Test-Path $ldHive))
7463
{
7564
New-Item -Path $werHive -Name LocalDumps
7665
}
@@ -116,24 +105,27 @@ function Shutdown-Dumps()
116105

117106
if ($Mode -eq "Setup")
118107
{
119-
Setup-appverif w3wp.exe
120-
Setup-appverif iisexpress.exe
108+
foreach ($element in $exes) {
109+
Setup-appverif $element
110+
}
121111

122112
Setup-Dumps;
123113
}
124114

125115
if ($Mode -eq "SetupDumps")
126116
{
127-
Shutdown-appverif w3wp.exe
128-
Shutdown-appverif iisexpress.exe
117+
foreach ($element in $exes) {
118+
Shutdown-appverif $element
119+
}
129120

130121
Setup-Dumps;
131122
}
132123

133124
if ($Mode -eq "Shutdown")
134125
{
135-
Shutdown-appverif w3wp.exe
136-
Shutdown-appverif iisexpress.exe
126+
foreach ($element in $exes) {
127+
Shutdown-appverif $element
128+
}
137129

138130
Shutdown-Dumps;
139131
}

0 commit comments

Comments
 (0)