Skip to content
Open
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
d561fd8
Add CLI parser
limbonaut Nov 12, 2025
910da99
Refactor CLI testing to use command-based approach
limbonaut Nov 12, 2025
97f6a8e
improve CLI commands doc comments
limbonaut Nov 12, 2025
0b8f0ff
Fix message-capture command
limbonaut Nov 12, 2025
972f3b5
Refactor CLI commands for integration testing
limbonaut Nov 12, 2025
8948657
Fixes
limbonaut Nov 13, 2025
efe1c5c
Fix await issues
limbonaut Nov 13, 2025
bf7c80a
Print EVENT_CAPTURED in crash test
limbonaut Nov 13, 2025
6c27e74
Add app-runner submodule
limbonaut Nov 13, 2025
1fbd6b7
Commit current integration tests WIP
limbonaut Nov 14, 2025
5a6a337
Add integration test results to gitignore
limbonaut Nov 14, 2025
092bc03
Update integration test user context
limbonaut Nov 14, 2025
d6ef89f
Update app-runner to my branch
limbonaut Nov 14, 2025
304c5ec
Fix OS tag test
limbonaut Nov 14, 2025
f5b1e2c
Refactor Desktop integration tests for clarity
limbonaut Nov 14, 2025
544608d
Refactor test cases and add dist attribute
limbonaut Nov 14, 2025
399c21b
Add test cases for Sentry event tags and TODOs
limbonaut Nov 17, 2025
deb7a9a
Test SDK information
limbonaut Nov 17, 2025
b985463
Explain common test cases in commments
limbonaut Nov 17, 2025
86c5af6
Implement runtime error capture integration test
limbonaut Nov 17, 2025
cbc5ccd
Rename Desktop.Tests.ps1 to Integration.Tests.ps1
limbonaut Nov 17, 2025
a60bb9f
Update TODOs
limbonaut Nov 17, 2025
76190eb
Try running tests in CI
limbonaut Nov 18, 2025
253ca7f
Update test_integration.yml
limbonaut Nov 18, 2025
04f8f91
Add macOS & init app-runner submodule
limbonaut Nov 18, 2025
6c990fa
Pass secret to integration test workflow
limbonaut Nov 18, 2025
cf32268
Test app and device contexts
limbonaut Nov 18, 2025
f89be1a
Accept secret in integration workflow
limbonaut Nov 18, 2025
9aa3ce7
Add tests for OS context
limbonaut Nov 18, 2025
3e22523
Pass `arch`
limbonaut Nov 18, 2025
cde8d15
Test Godot contexts
limbonaut Nov 18, 2025
5fa5b7d
Set diagnostic level to warning during tests
limbonaut Nov 18, 2025
a6e1a27
Make exception type check more lenient
limbonaut Nov 18, 2025
89837c0
Test for expected breadcrumbs
limbonaut Nov 18, 2025
65ca42d
Extract common test cases to separate file
limbonaut Nov 18, 2025
25bf857
Add crash-send CLI command to process and send crash reports from
limbonaut Nov 18, 2025
fabf37b
Remove cpu_description assertion from device context test
limbonaut Nov 18, 2025
ee2e559
Bump app-runner
limbonaut Nov 18, 2025
d6ff87d
While adding GDScript stack, set thread.crashed `true`
limbonaut Nov 18, 2025
1b0a7de
Clean up integration tests
limbonaut Nov 18, 2025
8dc483c
Remove redundant threads data test
limbonaut Nov 18, 2025
2cb837d
Fix job name
limbonaut Nov 18, 2025
6d7eeeb
Add x86_32 to testing workflow
limbonaut Nov 19, 2025
b4b06a3
Add Linux x86_32 deps
limbonaut Nov 19, 2025
8ae1d81
More lenient frames count test
limbonaut Nov 19, 2025
3e590aa
Move 32-bit Linux dependencies to prepare-testing action
limbonaut Nov 19, 2025
adfc068
Use just `--es arg0 val0 --es arg1 val1` scheme for intents
limbonaut Nov 19, 2025
6eb1291
Fix crash-send context label in integration test
limbonaut Nov 19, 2025
207f01d
Remove debugging code
limbonaut Nov 19, 2025
8c5a58b
Refactor test setup into PSCustomObject
limbonaut Nov 19, 2025
eed0466
Fix and refactor test setup
limbonaut Nov 19, 2025
78bc049
Extract Invoke-TestAction helper function
limbonaut Nov 19, 2025
9642940
Style fixes and comments
limbonaut Nov 19, 2025
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
14 changes: 14 additions & 0 deletions .github/actions/prepare-testing/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ runs:
- name: Checkout required submodules
shell: bash
run: |
git submodule update --init --depth 1 modules/app-runner
git submodule update --init --depth 1 modules/gdUnit4
git submodule update --init --depth 1 modules/godot-cpp
git submodule update --init --depth 1 project/test/util/json_assert
Expand All @@ -39,6 +40,19 @@ runs:
distribution: temurin
java-version: 17

- name: Install Linux dependencies (32-bit)
if: runner.os == 'Linux' && inputs.arch == 'x86_32'
shell: bash
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install \
libatomic1:i386 \
libudev1:i386 \
libfontconfig1:i386 \
libcurl4-openssl-dev:i386 \
zlib1g:i386

- name: Set up Godot
shell: bash
env:
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ jobs:
needs: build-extension
uses: ./.github/workflows/test_android.yml

test-integration:
name: 🧪 Integration tests
needs: build-extension
uses: ./.github/workflows/test_integration.yml
secrets:
SENTRY_API_TOKEN: ${{ secrets.SENTRY_API_TOKEN }}

package:
name: 📦 Package
needs: build-extension
Expand All @@ -54,7 +61,7 @@ jobs:
# See issue: https://github.com/getsentry/sentry-godot/issues/41
cleanup:
name: 🗑️ Cleanup
needs: [package, unit-tests, test-android, static-checks]
needs: [package, unit-tests, test-android, test-integration, static-checks]
runs-on: ubuntu-latest
steps:
- name: Delete sentry-godot-gdextension artifact
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/test_integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: 🧪 Integration tests

on:
workflow_call:
secrets:
SENTRY_API_TOKEN:
required: true

permissions:
contents: read

jobs:
integration-tests:
name: Test ${{matrix.platform}} ${{matrix.arch}}
runs-on: ${{matrix.runner}}
strategy:
fail-fast: false
matrix:
include:
- platform: Linux
runner: ubuntu-latest
arch: x86_64
- platform: Linux
runner: ubuntu-latest
arch: x86_32
- platform: Windows
runner: windows-latest
arch: x86_64
- platform: Windows
runner: windows-latest
arch: x86_32
- platform: macOS
runner: macos-latest
arch: universal
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: false # don't initialize submodules automatically

- name: Prepare testing
uses: ./.github/actions/prepare-testing
timeout-minutes: 15
with:
arch: ${{ matrix.arch }}
android: ${{ matrix.platform == 'Android' && 'true' || 'false' }}

- name: Install Pester module for pwsh
shell: pwsh
run: Install-Module -Name Pester -Force -SkipPublisherCheck

- name: Run integration tests locally
shell: pwsh
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_API_TOKEN }}
SENTRY_TEST_PLATFORM: ${{ matrix.platform }}
run: Invoke-Pester -Script integration_tests/Integration.Tests.ps1
17 changes: 1 addition & 16 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,6 @@ jobs:
with:
submodules: false # don't initialize submodules automatically

- name: Install Linux dependencies (32-bit)
if: matrix.runner == 'ubuntu-latest' && matrix.arch == 'x86_32'
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install \
libatomic1:i386 \
libudev1:i386 \
libfontconfig1:i386 \
libcurl4-openssl-dev:i386 \
zlib1g:i386

- name: Prepare testing
uses: ./.github/actions/prepare-testing
with:
Expand All @@ -50,12 +38,9 @@ jobs:
- name: Run tests
shell: bash
timeout-minutes: 5
env:
SENTRY_TEST: 1
SENTRY_TEST_INCLUDE: "res://test/suites/"
run: |
# Exit status codes: 0 - success, 100 - failures, 101 - warnings, 104 - tests not found, 105 - didn't run.
${GODOT} --headless --path project/
${GODOT} --headless --path project/ -- run-tests "res://test/suites/"

- name: Run isolated tests
if: success() || failure()
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ project/.godot/
exports/*
!exports/export_presets.cfg

integration_tests/results/

# Source tree
src/gen/

Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "project/test/util/json_assert"]
path = project/test/util/json_assert
url = https://github.com/getsentry/gdunit-json-assert
[submodule "modules/app-runner"]
path = modules/app-runner
url = https://github.com/getsentry/app-runner.git
134 changes: 134 additions & 0 deletions integration_tests/CommonTestCases.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Defines a collection of reusable test cases that validate common Sentry event properties
# and behaviors across different test suites for consistent integration testing.
#
# Available parameters:
# - $SentryEvent: The Sentry event object retrieved from the REST API containing error/message details
# - $TestType: String indicating the type of test being run (e.g., 'crash-capture', 'message-capture')
# - $RunResult: Object containing the results of running the test application, including Output and ExitCode

$CommonTestCases = @(
@{ Name = 'Outputs event ID'; TestBlock = {
param($RunResult)
$eventId = Get-EventIds -appOutput $RunResult.Output -expectedCount 1
$eventId | Should -Not -BeNullOrEmpty
}
}
@{ Name = 'Captures event in sentry.io'; TestBlock = {
param($SentryEvent)
$SentryEvent | Should -Not -BeNullOrEmpty
}
}
@{ Name = 'Has title'; TestBlock = {
param($SentryEvent)
$SentryEvent.title | Should -Not -BeNullOrEmpty
}
}
@{ Name = 'Has correct release version'; TestBlock = {
param($SentryEvent)
$SentryEvent.release.version | Should -Be '[email protected]'
}
}
@{ Name = 'Has correct platform'; TestBlock = {
param($SentryEvent)
$SentryEvent.platform | Should -Not -BeNullOrEmpty
if ($IsLinux -or $IsWindows) {
$SentryEvent.platform | Should -Be "native"
} elseif ($IsMacOS) {
$SentryEvent.platform | Should -Be "cocoa"
}
}
}
@{ Name = 'Has correct dist attribute'; TestBlock = {
param($SentryEvent)
$SentryEvent.dist | Should -Be "test-dist"
}
}
@{ Name = 'Has tags'; TestBlock = {
param($SentryEvent)
$SentryEvent.tags | Should -Not -BeNullOrEmpty
}
}
@{ Name = 'Has correct integration test tags'; TestBlock = {
param($SentryEvent, $TestType)
($SentryEvent.tags | Where-Object { $_.key -eq 'test.suite' }).value | Should -Be 'integration'
($SentryEvent.tags | Where-Object { $_.key -eq 'test.type' }).value | Should -Be $TestType
}
}
@{ Name = 'Has correct environment tag'; TestBlock = {
param($SentryEvent)
($SentryEvent.tags | Where-Object { $_.key -eq 'environment' }).value | Should -Be 'integration-test'
}
}
@{ Name = 'Has correct OS tag'; TestBlock = {
param($SentryEvent)
if ($IsLinux) {
$expectedOS = "Linux"
} elseif ($IsMacOS) {
$expectedOS = "macOS"
} else {
$expectedOS = "Windows"
}
($SentryEvent.tags | Where-Object { $_.key -eq 'os' }).value | Should -Match $expectedOS
}
}
@{ Name = 'Contains user information'; TestBlock = {
param($SentryEvent)
$SentryEvent.user | Should -Not -BeNullOrEmpty
$SentryEvent.user.username | Should -Be 'TestUser'
$SentryEvent.user.email | Should -Be '[email protected]'
$SentryEvent.user.id | Should -Be '12345'
}
}
@{ Name = 'Contains breadcrumbs'; TestBlock = {
param($SentryEvent)
$SentryEvent.breadcrumbs | Should -Not -BeNullOrEmpty
$SentryEvent.breadcrumbs.values | Should -Not -BeNullOrEmpty
}
}
@{ Name = 'Contains SDK information'; TestBlock = {
param($SentryEvent)
$SentryEvent.sdk | Should -Not -BeNullOrEmpty
$SentryEvent.sdk.name | Should -Not -BeNullOrEmpty
$SentryEvent.sdk.version | Should -Not -BeNullOrEmpty
}
}
@{ Name = 'Contains app context'; TestBlock = {
param($SentryEvent)
$SentryEvent.contexts.app | Should -Not -BeNullOrEmpty
$SentryEvent.contexts.app.app_name | Should -Not -BeNullOrEmpty
$SentryEvent.contexts.app.app_version | Should -Not -BeNullOrEmpty
}
}
@{ Name = 'Contains device context'; TestBlock = {
param($SentryEvent)
$SentryEvent.contexts.device | Should -Not -BeNullOrEmpty
$SentryEvent.contexts.device.arch | Should -Not -BeNullOrEmpty
$SentryEvent.contexts.device.free_memory | Should -Not -BeNullOrEmpty
$SentryEvent.contexts.device.usable_memory | Should -Not -BeNullOrEmpty
}
}
@{ Name = 'Contains OS context'; TestBlock = {
param($SentryEvent)
$SentryEvent.contexts.os | Should -Not -BeNullOrEmpty
$SentryEvent.contexts.os.os | Should -Not -BeNullOrEmpty
$SentryEvent.contexts.os.name | Should -Not -BeNullOrEmpty
$SentryEvent.contexts.os.version | Should -Not -BeNullOrEmpty
}
}
@{ Name = 'Contains Godot contexts'; TestBlock = {
param($SentryEvent)
$SentryEvent.contexts.godot_engine | Should -Not -BeNullOrEmpty
$SentryEvent.contexts.godot_engine.version | Should -Not -BeNullOrEmpty
$SentryEvent.contexts.godot_engine.version_commit | Should -Not -BeNullOrEmpty
$SentryEvent.contexts.godot_engine.godot_sdk_version | Should -Not -BeNullOrEmpty
$SentryEvent.contexts.godot_performance | Should -Not -BeNullOrEmpty
}
}
@{ Name = 'Contains expected breadcrumbs'; TestBlock = {
param($SentryEvent)
$SentryEvent.breadcrumbs.values | Should -Not -BeNullOrEmpty
$SentryEvent.breadcrumbs.values | Where-Object { $_.message -eq "Integration test started" } | Should -Not -BeNullOrEmpty
$SentryEvent.breadcrumbs.values | Where-Object { $_.message -eq "Context configuration finished" } | Should -Not -BeNullOrEmpty
}
}
)
Loading
Loading