Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable crash dumps for uwp/wasdk unit tests #493

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 23 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ jobs:
# Build both Uno.UI/WinUI2/UWP and Uno.WinUI/WinUI3/WindowsAppSDK versions of our packages using a matrix
build:
needs: [Xaml-Style-Check]
runs-on: windows-latest-large
runs-on: windows-latest

env:
PROCDUMP_PATH: ${{ github.workspace }}

# See https://docs.github.com/actions/using-jobs/using-a-matrix-for-your-jobs
strategy:
Expand All @@ -84,15 +87,6 @@ jobs:
maximum-size: 32GB
disk-root: "C:"

- name: Enable User-Mode Dumps collecting
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '' }}
shell: powershell
run: |
New-Item '${{ github.workspace }}\CrashDumps' -Type Directory
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps' -Name 'DumpFolder' -Type ExpandString -Value '${{ github.workspace }}\CrashDumps'
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps' -Name 'DumpCount' -Type DWord -Value '10'
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps' -Name 'DumpType' -Type DWord -Value '2'

- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v4
with:
Expand All @@ -108,6 +102,13 @@ jobs:
with:
submodules: recursive

- name: Install procdump
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }}
shell: pwsh
run: |
Invoke-WebRequest -Uri https://download.sysinternals.com/files/Procdump.zip -OutFile Procdump.zip
Expand-Archive -Path Procdump.zip -DestinationPath ${{ env.PROCDUMP_PATH }}

# Restore Tools from Manifest list in the Repository
- name: Restore dotnet tools
run: dotnet tool restore
Expand Down Expand Up @@ -161,7 +162,7 @@ jobs:
- name: Run component tests against ${{ matrix.multitarget }}
if: ${{ matrix.multitarget == 'uwp' || matrix.multitarget == 'wasdk' }}
id: test-platform
run: vstest.console.exe ./tooling/**/CommunityToolkit.Tests.${{ matrix.multitarget }}.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=${{ matrix.multitarget }}.trx" /Blame
run: vstest.console.exe ./tooling/**/CommunityToolkit.Tests.${{ matrix.multitarget }}.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=${{ matrix.multitarget }}.trx" /Blame:"CollectDump;DumpType=Full;CollectHangDump;TestTimeout=30m;HangDumpType=Full" /Diag:"${{ github.workspace }}/vstest-diagnostic-log.txt"
Arlodotexe marked this conversation as resolved.
Show resolved Hide resolved

- name: Create test reports
run: |
Expand All @@ -179,7 +180,7 @@ jobs:
uses: actions/upload-artifact@v4
if: ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
with:
name: ilc-repro
name: ilc-repro-${{ matrix.multitarget }}-winui${{ matrix.winui }}
path: ./*.zip

# https://github.com/dorny/paths-filter#custom-processing-of-changed-files
Expand All @@ -188,14 +189,21 @@ jobs:
if: always()
working-directory: ${{ github.workspace }}
run: |
echo "DUMP_FILE=$(Get-ChildItem .\CrashDumps\*.dmp -ErrorAction SilentlyContinue)" >> $env:GITHUB_OUTPUT
echo "DUMP_FILE=$(Get-ChildItem ${{ env.PROCDUMP_PATH }}/**/*.dmp -ErrorAction SilentlyContinue)" >> $env:GITHUB_OUTPUT

- name: Artifact - WER crash dumps
- name: Artifact - Process Dumps
uses: actions/upload-artifact@v4
if: ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
with:
name: CrashDumps-${{ matrix.multitarget }}-winui${{ matrix.winui }}
path: '${{ github.workspace }}/CrashDumps'
path: ${{ env.PROCDUMP_PATH }}/**/*.dmp

- name: Artifact - vstest-diagnostic-log
uses: actions/upload-artifact@v4
if: always()
with:
name: 'vstest-diagnostic-log-${{ matrix.multitarget }}-winui${{ matrix.winui }}.txt'
path: '${{ github.workspace }}/vstest-diagnostic-log.txt'

- name: Analyze Dump
if: ${{ steps.detect-dump.outputs.DUMP_FILE != '' && (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
Expand Down
Loading