* Tracing for troubleshooting.

* fixes.
This commit is contained in:
Shankar Seal 2022-07-08 16:42:58 -07:00 коммит произвёл GitHub
Родитель 85b8fd974b
Коммит be30c49a40
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 19 добавлений и 6 удалений

Просмотреть файл

@ -32,5 +32,8 @@ This document discusses the steps to set up such a selfhosted actions-runner tha
9) Store the VM administrator credential:
1) `Install-Module CredentialManager -force`
2) `New-StoredCredential -Target `**`TEST_VM`**` -Username <VM Administrator> -Password <VM Administrator account password> -Persist LocalMachine`
10) Set up Windows Error Reporting [Local Dump Collection](https://docs.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps).
11) Reboot the runner.
10) Set up Windows Error Reporting [Local Dump Collection](https://docs.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps) on the VMs with the following commands.
```New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" -ErrorAction SilentlyContinue```
```New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" -Name "DumpType" -Value 2 -PropertyType DWord -ErrorAction SilentlyContinue```
```New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" -Name "DumpFolder" -Value "c:\dumps" -PropertyType ExpandString -ErrorAction SilentlyContinue -Force```
12) Reboot the runner.

Просмотреть файл

@ -243,7 +243,7 @@ function Import-ResultsFromVM
Copy-Item -FromSession $VMSession "$VMSystemDrive\KernelDumps" -Destination ".\TestLogs\$VMName" -Recurse -Force -ErrorAction Ignore 2>&1 | Write-Log
# Copy user mode crash dumps if any.
Copy-Item -FromSession $VMSession "$VMSystemDrive\dumps\x64" -Destination ".\TestLogs\$VMName" -Recurse -Force -ErrorAction Ignore 2>&1 | Write-Log
Copy-Item -FromSession $VMSession "$VMSystemDrive\dumps" -Destination ".\TestLogs\$VMName" -Recurse -Force -ErrorAction Ignore 2>&1 | Write-Log
# Copy logs from Test VM.
if (!(Test-Path ".\TestLogs\$VMName\Logs")) {

Просмотреть файл

@ -59,7 +59,6 @@ function Invoke-Test
$ArgumentsList = @()
if ($Coverage) {
$Env:EBPF_ENABLE_WER_REPORT="yes"
$ArgumentsList += @('-q', '--modules=C:\eBPF', '--export_type', ('binary:' + $TestName + '.cov'), '--', $TestName)
$TestName = $CodeCoverage
}
@ -71,11 +70,22 @@ function Invoke-Test
Write-Log "$TestName $ArgumentsList"
$Output = &$TestName $ArgumentsList
$TestName = $OriginalTestName
if ($LASTEXITCODE -ne 0) {
throw ("$TestName Failed with $LASTEXITCODE.")
}
# Check for errors.
# Parse output to check for errors.
if ($null -eq $Output) {
throw ("No output generated by $TestName.")
}
Out-String -InputObject $Output | Write-Log
$ParsedOutput = $Output.Split(" ")
if (($LASTEXITCODE -ne 0) -or ($ParsedOutput[$ParsedOutput.Length -2] -eq "failed")) { throw ("$TestName Test Failed.") }
if (-not (($null -ne $ParsedOutput) -and ($ParsedOutput.Length -ge 2))) {
throw ("Failed to parse output generated by $TestName.")
}
if ($ParsedOutput[$ParsedOutput.Length -2] -eq "failed") {
throw ("$TestName Test Failed.")
}
Write-Log "$TestName Passed" -ForegroundColor Green
}