-
-
Notifications
You must be signed in to change notification settings - Fork 53
chore: Update sample project to enable running integration tests in CI #1064
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
38f16f9
Update sample project to run integration tests
tustanivsky 324102b
Cleanup test run in ci and upload sample build
tustanivsky 318590c
Add sample project readme
tustanivsky 6ec01f7
Move assets
tustanivsky 28bac10
Fix contriburing guide
tustanivsky 95d0c7e
Fix path
tustanivsky 63e2fea
Fix file tree
tustanivsky 4ba0adb
Update readme
tustanivsky e17bc01
Add dsn arg for integration tests sample
tustanivsky 697a549
Sample build upload for UE 4.27
tustanivsky d567650
Rename arg
tustanivsky 02252c4
FIx multiple exit requests
tustanivsky 2bff464
Fix test reports path
tustanivsky a0d7a8c
Rename command line args to align with consoles ci naming
tustanivsky de62595
Set fake event id for test crash event
tustanivsky 12544d0
Update SentryPlaygroundGameInstance.cpp
tustanivsky 28c5bb6
Remove integration-test param
tustanivsky cd08ce4
Try windows-2022
tustanivsky 315f154
Fix string literals
tustanivsky a291471
Remove unreachable code block
tustanivsky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| <p align="center"> | ||
| <a href="https://sentry.io" target="_blank" align="left"> | ||
| <img src="https://raw.githubusercontent.com/getsentry/sentry-unity/main/.github/sentry-wordmark-dark-400x119.svg" width="280"> | ||
| </a> | ||
| <br /> | ||
| </p> | ||
| <p align="center"> | ||
|
|
||
| Sentry Unreal Engine SDK Sample Project | ||
| =========== | ||
|
|
||
| This sample project demonstrates the capabilities of the Sentry Unreal Engine SDK and provides a comprehensive testing environment for all SDK features. | ||
|
|
||
| ## Getting started | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| - Unreal Engine 4.27 or newer (version configured in `SentryPlayground.uproject`) | ||
| - Platform support: Windows, macOS, Linux, Android, iOS, PlayStation 5, Xbox, Nintendo Switch | ||
| - Sentry account with a project and DSN | ||
|
|
||
| ### Setup | ||
|
|
||
| - Clone or download the Sentry Unreal SDK repository | ||
| - Copy or symlink the Sentry plugin sources to `sample/Plugins/Sentry/` | ||
| - Open `SentryPlayground.uproject` in Unreal Engine | ||
| - Configure your Sentry DSN in `Config/DefaultEngine.ini` or through the project settings menu | ||
| - Play the `SentryDemo` level to begin testing | ||
|
|
||
| ## Project structure overview | ||
|
|
||
| Here's a breakdown of the important sample project files and folders: | ||
|
|
||
| ```pwsh | ||
| 📁 sample | ||
| ├── 📄 SentryPlayground.uproject # Engine version configuration, supports UE 4.27 and newer | ||
| ├── 📁 Source/ | ||
| │ └── 📁 SentryPlayground/ | ||
| │ ├── 📄 SentryPlaygroundGameInstance.cpp/.h # Logic for running integration tests | ||
| │ ├── 📄 SentryPlaygroundUtils.cpp/.h # Utilities for triggering different types of crashes | ||
| │ ├── 📄 CppBeforeSendHandler.cpp/.h # Example C++ implementation of `beforeSend` hook handler | ||
| │ └── 📄 SentryGCCallback.cpp/.h # Utility for capturing events during garbage collection | ||
| ├── 📁 Content/ | ||
| │ ├── 📁 Maps/ | ||
| │ │ └── 📄 SentryDemo.umap # Main demo level) | ||
| │ ├── 📁 UI/ | ||
| │ │ └── 📄 W_SentryDemo.uasset # Demo UI widget for testing SDK features | ||
| │ └── 📁 Misc/ | ||
| │ ├── 📄 BP_BeforeSendHandler.uasset # Example Blueprint implementation of `beforeSend` hook handler | ||
| │ ├── 📄 BP_BeforeBreadcrumbHandler.uasset # Example Blueprint implementation of `beforeBreadcrumb` hook handler | ||
| │ └── 📄 BP_TraceSampler.uasset # Example Blueprint implementation of traces sampling function | ||
| ├── 📁 Config/ | ||
| │ └── 📄 DefaultEngine.ini # Configuration file with Sentry plugin settings | ||
| └── 📁 Plugins/ # Location for Sentry SDK sources - copy or symlink here | ||
| ``` | ||
|
|
||
| ## Demo Level | ||
|
|
||
| The demo level (`SentryDemo.umap`) in the project's Content folder presents a simple UI for sending test events to Sentry. The `W_SentryDemo` Blueprint implementation demonstrates how to call the plugin API and serves as a reference. | ||
|
|
||
| To run the demo level, navigate to `Content Browser -> Content -> Maps` and open the `SentryDemo` map. Click Play to launch the demo. | ||
|
|
||
| ## Unit Tests | ||
|
|
||
| To run automation tests, several engine plugins are enabled (see `Settings -> Plugins -> Testing`). Navigate to `Windows -> Test Automation` menu and open the `Session Frontend` window. Switch to the `Automation` tab and select `Sentry` from the list of available tests. Click the `Start Tests` button to run the tests and check the results. | ||
|
|
||
| ## Integration Tests | ||
|
|
||
| The `SentryPlaygroundGameInstance.cpp` file contains logic that parses command line input used to launch the sample game build and runs test actions accordingly. Here are example commands: | ||
|
|
||
| ```pwsh | ||
| # Windows - Crash capture test | ||
| SentryPlayground.exe -nullrhi -unattended -log -crash-capture -dsn="your-dsn-here" | ||
|
|
||
| # Windows - Message capture test | ||
| SentryPlayground.exe -nullrhi -unattended -log -message-capture | ||
| ``` | ||
|
|
||
| To run integration tests, specify which test to run using the appropriate argument (e.g., `-crash-capture` or `-message-capture`). The game will close after the test is completed. Otherwise, the game will launch as usual and present the sample UI. | ||
|
|
||
| Optionally, you can override the DSN for integration tests by adding `-dsn="your-dsn-here"` to the command line. When provided, this DSN will be used instead of the one configured in the project settings. | ||
|
|
||
| ## Example Content | ||
|
|
||
| The sample project contains example Blueprint implementations of various hook handlers under `Content -> Misc`: | ||
|
|
||
| - `BP_BeforeSendHandler` - Example Blueprint implementation of event filtering | ||
| - `BP_BeforeBreadcrumbHandler` - Custom breadcrumb processing logic | ||
| - `BP_TraceSampler` - Performance monitoring sampling configuration | ||
|
|
||
| These can be configured for the SDK to use in `Project Settings -> Plugins -> Sentry`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,3 +4,5 @@ | |
|
|
||
| #include "CoreMinimal.h" | ||
|
|
||
| DECLARE_LOG_CATEGORY_EXTERN(LogSentrySample, Verbose, All); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.