name: ue-unit-test description: Run Sentry unit tests via Unreal automation
Run Sentry unit tests via Unreal Engine automation framework.
Prerequisite: the project must be built first. If unsure whether it's been built, ask the user. If not built, suggest running /ue-build first.
Check the
UNREAL_ENGINE_ROOTenvironment variable (use PowerShell.NETmethod on Windows:[System.Environment]::GetEnvironmentVariable('UNREAL_ENGINE_ROOT')). If unset or the path doesn't exist, ask the user for the engine path.Determine the engine version by reading the
EngineAssociationfield insample/SentryPlayground.uproject(e.g.,"EngineAssociation": "5.7"- UE5,"EngineAssociation": "4.27"- UE4). Select the editor binary based on host OS and engine version:
| Host OS | UE5 binary path | UE4 binary path |
|---|---|---|
| Windows | Engine/Binaries/Win64/UnrealEditor.exe |
Engine/Binaries/Win64/UE4Editor.exe |
| macOS | Engine/Binaries/Mac/UnrealEditor |
Engine/Binaries/Mac/UE4Editor |
| Linux | Engine/Binaries/Linux/UnrealEditor |
Engine/Binaries/Linux/UE4Editor |
- Resolve the repo root and run the automation command:
REPO=$(git rev-parse --show-toplevel)
# Windows UE5
"$UNREAL_ENGINE_ROOT/Engine/Binaries/Win64/UnrealEditor.exe" \
"$REPO/sample/SentryPlayground.uproject" \
-ReportExportPath="$REPO/sample/Saved/Automation" \
-ExecCmds="Automation RunTests Sentry;quit" \
-TestExit="Automation Test Queue Empty" \
-Unattended -NoPause -NoSplash -NullRHI
# macOS UE5
"$UNREAL_ENGINE_ROOT/Engine/Binaries/Mac/UnrealEditor" \
"$REPO/sample/SentryPlayground.uproject" \
-ReportExportPath="$REPO/sample/Saved/Automation" \
-ExecCmds="Automation RunTests Sentry;quit" \
-TestExit="Automation Test Queue Empty" \
-Unattended -NoPause -NoSplash -NullRHI
- Report that test results are written to
sample/Saved/Automation/.