Skip to content

Commit 247f10f

Browse files
authored
chore: Add integration tests for Windows and Linux (#1127)
* Add inital integration testas implementation * Fix event id log format in sample app * Temp fix for empty even json props * Clean up * Fix function * Add readme instructions for integration tests * Remove platform input * Clean up * Rename * Clean up * Add integration tests run to CI * Install Pester on Linux * Add CI flag * Try fix auth * Serialize * Test * Test * stdout * Force flush logs * Clean up * Add integration tests output upload * Extract integration tests to separate jobs * Fix eof * Fix permission * Fix test app exit for non-fatal events * Fix exec permission for crashpad * Upload game log * Update exit * Fix * Try fix duplicated logs * Fix * Test * Test * Log duplication * Clean up * Try wait * Close * Revert crashpad wait * nosplash * Comment * Install DirectX * Update readme * Update app-runner module * Fix message test check * Clean up cmake * Refactor * Comments * Include sources for symbol upload in sample * Update app-runner `GIT_TAG` to latest version
1 parent a2572d2 commit 247f10f

File tree

12 files changed

+614
-7
lines changed

12 files changed

+614
-7
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,28 @@ jobs:
161161
uses: ./.github/workflows/test-windows.yml
162162
with:
163163
unreal-version: ${{ matrix.unreal }}
164+
165+
integration-test-linux:
166+
needs: [test-linux]
167+
name: Linux UE ${{ matrix.unreal }}
168+
secrets: inherit
169+
strategy:
170+
fail-fast: false
171+
matrix:
172+
unreal: ['4.27', '5.1', '5.2', '5.3', '5.4', '5.5', '5.6']
173+
uses: ./.github/workflows/integration-test-linux.yml
174+
with:
175+
unreal-version: ${{ matrix.unreal }}
176+
177+
integration-test-windows:
178+
needs: [test-windows]
179+
name: Windows UE ${{ matrix.unreal }}
180+
secrets: inherit
181+
strategy:
182+
fail-fast: false
183+
matrix:
184+
# Integration tests only for UE 5.2 and newer where CRC can be disabled
185+
unreal: ['5.2', '5.3', '5.4', '5.5', '5.6']
186+
uses: ./.github/workflows/integration-test-windows.yml
187+
with:
188+
unreal-version: ${{ matrix.unreal }}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
unreal-version:
5+
required: true
6+
type: string
7+
8+
jobs:
9+
integration-test:
10+
name: Integration Test
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
submodules: recursive
17+
18+
- name: Download sample build
19+
uses: actions/download-artifact@v4
20+
with:
21+
name: UE ${{ inputs.unreal-version }} sample build (Linux)
22+
path: sample-build
23+
24+
- name: Set execute permissions
25+
run: |
26+
chmod +x ${{ github.workspace }}/sample-build/SentryPlayground.sh
27+
chmod +x ${{ github.workspace }}/sample-build/SentryPlayground/Plugins/sentry/Binaries/Linux/crashpad_handler
28+
29+
- name: Install Pester
30+
shell: pwsh
31+
run: |
32+
Install-Module -Name Pester -Force -SkipPublisherCheck
33+
34+
- name: Run integration tests
35+
id: run-integration-tests
36+
shell: pwsh
37+
env:
38+
SENTRY_UNREAL_TEST_DSN: ${{ secrets.SENTRY_UNREAL_TEST_DSN }}
39+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_API_TOKEN }}
40+
SENTRY_UNREAL_TEST_APP_PATH: ${{ github.workspace }}/sample-build/SentryPlayground.sh
41+
run: |
42+
cd integration-test
43+
mkdir build
44+
cmake -B build -S .
45+
Invoke-Pester Integration.Tests.ps1 -CI
46+
47+
- name: Upload integration test output
48+
if: ${{ always() && steps.run-integration-tests.outcome == 'failure' }}
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: UE ${{ inputs.unreal-version }} integration test output (Linux)
52+
path: |
53+
integration-test/output/
54+
sample-build/SentryPlayground/Saved/Logs/
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
unreal-version:
5+
required: true
6+
type: string
7+
8+
jobs:
9+
integration-test:
10+
name: Integration Test
11+
runs-on: windows-2022
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
submodules: recursive
17+
18+
# UE 5.2-5.3 require older DirectX runtime to run pre-built test app
19+
- name: Install DirectX June 2010 Runtime
20+
run: |
21+
Invoke-WebRequest -Uri "https://download.microsoft.com/download/8/4/A/84A35BF1-DAFE-4AE8-82AF-AD2AE20B6B14/directx_Jun2010_redist.exe" -OutFile "$env:TEMP\directx_redist.exe"
22+
Start-Process -FilePath "$env:TEMP\directx_redist.exe" -ArgumentList "/Q","/T:$env:TEMP\DirectX" -Wait
23+
Start-Process -FilePath "$env:TEMP\DirectX\DXSETUP.exe" -ArgumentList "/silent" -Wait
24+
25+
- name: Download sample build
26+
uses: actions/download-artifact@v4
27+
with:
28+
name: UE ${{ inputs.unreal-version }} sample build (Windows)
29+
path: sample-build
30+
31+
- name: Run integration tests
32+
id: run-integration-tests
33+
env:
34+
SENTRY_UNREAL_TEST_DSN: ${{ secrets.SENTRY_UNREAL_TEST_DSN }}
35+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_API_TOKEN }}
36+
SENTRY_UNREAL_TEST_APP_PATH: ${{ github.workspace }}/sample-build/SentryPlayground.exe
37+
run: |
38+
cd integration-test
39+
mkdir build
40+
cmake -B build -S .
41+
Invoke-Pester Integration.Tests.ps1 -CI
42+
43+
- name: Upload integration test output
44+
if: ${{ always() && steps.run-integration-tests.outcome == 'failure' }}
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: UE ${{ inputs.unreal-version }} integration test output (Windows)
48+
path: |
49+
integration-test/output/
50+
sample-build/SentryPlayground/Saved/Logs/

.github/workflows/test-windows.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,3 @@ jobs:
106106
name: UE ${{ inputs.unreal-version }} sample build (Windows)
107107
path: checkout/sample/Builds/${{ inputs.unreal-version == '4.27' && 'WindowsNoEditor' || 'Windows' }}/
108108
retention-days: 1
109-

integration-test/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# CMake build artifacts
2+
build/
3+
TestConfig.local.ps1
4+
5+
# Test outputs
6+
output/

integration-test/CMakeLists.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
cmake_minimum_required(VERSION 3.20)
2+
project(SentryUnrealIntegrationTests NONE)
3+
4+
include(FetchContent)
5+
6+
# Fetch PowerShell modules for Sentry API integration
7+
FetchContent_Declare(
8+
app-runner
9+
GIT_REPOSITORY https://github.com/getsentry/app-runner.git
10+
GIT_TAG 503795f0ef0f8340fcc0f0bc5fb5437df8cff9ef
11+
)
12+
13+
FetchContent_MakeAvailable(app-runner)
14+
15+
# Generate test configuration with app-runner path
16+
set(configFile "${CMAKE_CURRENT_SOURCE_DIR}/TestConfig.local.ps1")
17+
configure_file(
18+
"${CMAKE_CURRENT_SOURCE_DIR}/TestConfig.ps1.in"
19+
"${configFile}"
20+
@ONLY
21+
)
22+
23+
message(STATUS "Integration test environment configured")
24+
message(STATUS " app-runner path: ${app-runner_SOURCE_DIR}")
25+
message(STATUS " Config file: ${configFile}")

0 commit comments

Comments
 (0)