Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6e98be7
added xbox
bitsandfoxes Mar 20, 2026
5f8bd87
development build for xbox
bitsandfoxes Mar 23, 2026
2fa8fc1
support loose builds
bitsandfoxes Mar 23, 2026
1b923ab
fileloghandler
bitsandfoxes Mar 23, 2026
119d980
no development builds
bitsandfoxes Mar 23, 2026
9721689
Merge branch 'main' into feat/xbox-app-runner
bitsandfoxes Mar 24, 2026
c67cfc2
file logging and master mode
bitsandfoxes Mar 26, 2026
0206268
logfile path
bitsandfoxes Mar 26, 2026
3ae6fff
logs have a new home
bitsandfoxes Mar 27, 2026
7190270
dedicated logger
bitsandfoxes Mar 27, 2026
e1c2ff2
no special config for xbox
bitsandfoxes Mar 27, 2026
4f0104a
diagnostics
bitsandfoxes Mar 27, 2026
1d73ec0
more diagnostics
bitsandfoxes Mar 27, 2026
a75bf9d
try and see
bitsandfoxes Mar 27, 2026
244396e
diagnostics
bitsandfoxes Mar 27, 2026
5b454ba
found the path
bitsandfoxes Mar 30, 2026
a447521
the builder does this now
bitsandfoxes Mar 30, 2026
4ec0d43
loose build
bitsandfoxes Mar 30, 2026
e43aa10
diagnostics
bitsandfoxes Mar 30, 2026
6c927fb
build package
bitsandfoxes Mar 31, 2026
11735f2
simplified running
bitsandfoxes Mar 31, 2026
aa6cdf9
added ps5 and switch build configuration methods
bitsandfoxes Mar 31, 2026
e3359ae
logger
bitsandfoxes Mar 31, 2026
1f7099f
editor
bitsandfoxes Mar 31, 2026
068fc33
iteration
bitsandfoxes Mar 31, 2026
05043ba
Add Xbox devkit integration test runner
bitsandfoxes Apr 1, 2026
8312ea3
fixed dsn env var name
bitsandfoxes Apr 1, 2026
c160d1c
handle storage requirement in postbuild
bitsandfoxes Apr 1, 2026
d55b898
Fix Xbox PersistentLocalStorage: use pre-build step on source config
bitsandfoxes Apr 2, 2026
5191a52
Merge branch 'main' into feat/xbox-app-runner
bitsandfoxes Apr 2, 2026
cc69746
Merge branch 'feat/xbox-app-runner' of https://github.com/getsentry/s…
bitsandfoxes Apr 2, 2026
a3eebde
builder's final form
bitsandfoxes Apr 2, 2026
56d341a
fixed ps5 ending
bitsandfoxes Apr 2, 2026
ecfbbc8
ps5 cleanup
bitsandfoxes Apr 2, 2026
6e0ca09
bot feedback
bitsandfoxes Apr 2, 2026
47cc23b
Merge branch 'feat/xbox-app-runner' of https://github.com/getsentry/s…
bitsandfoxes Apr 2, 2026
2a4bba7
removed unused path
bitsandfoxes Apr 2, 2026
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
2 changes: 1 addition & 1 deletion .github/workflows/test-run-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
env:
ARTIFACTS_PATH: samples/IntegrationTest/test-artifacts/
HOMEBREW_NO_INSTALL_CLEANUP: 1
SENTRY_TEST_DSN: ${{ secrets.SENTRY_TEST_DSN }}
SENTRY_DSN: ${{ secrets.SENTRY_TEST_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
# Map the job outputs to step outputs
outputs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-run-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
name: ${{ inputs.platform }} ${{ inputs.unity-version }}
runs-on: ${{ inputs.platform == 'linux' && 'ubuntu-latest' || 'windows-latest' }}
env:
SENTRY_TEST_DSN: ${{ secrets.SENTRY_TEST_DSN }}
SENTRY_DSN: ${{ secrets.SENTRY_TEST_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-run-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
IOS_VERSION: ${{ inputs.ios-version }}
INIT_TYPE: ${{ inputs.init-type }}
ARTIFACTS_PATH: samples/IntegrationTest/test-artifacts/
SENTRY_TEST_DSN: ${{ secrets.SENTRY_TEST_DSN }}
SENTRY_DSN: ${{ secrets.SENTRY_TEST_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-run-webgl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: WebGL ${{ inputs.unity-version }}
runs-on: ubuntu-latest
env:
SENTRY_TEST_DSN: ${{ secrets.SENTRY_TEST_DSN }}
SENTRY_DSN: ${{ secrets.SENTRY_TEST_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}

steps:
Expand Down
79 changes: 71 additions & 8 deletions test/IntegrationTest/Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
# Integration tests for Sentry Unity SDK
#
# Environment variables:
# SENTRY_TEST_PLATFORM: target platform (Android, Desktop, iOS, WebGL)
# SENTRY_TEST_DSN: test DSN
# SENTRY_TEST_PLATFORM: target platform (Android, Desktop, iOS, WebGL, Xbox)
# SENTRY_DSN: test DSN
# SENTRY_AUTH_TOKEN: authentication token for Sentry API
#
# SENTRY_TEST_APP: path to the test app (APK, executable, .app bundle, or WebGL build directory)
# SENTRY_TEST_APP: path to the test app (APK, executable, .app bundle, WebGL build directory,
# or Xbox packaged build directory containing a .xvc)
#
# Platform-specific environment variables:
# iOS: SENTRY_IOS_VERSION - iOS simulator version (e.g. "17.0" or "latest")
# Xbox: XBCONNECT_TARGET - Xbox devkit IP address

Set-StrictMode -Version latest
$ErrorActionPreference = "Stop"
Expand All @@ -30,9 +32,45 @@ BeforeAll {
"Android" { return @("-e", "test", $Action) }
"Desktop" { return @("--test", $Action, "-logFile", "-") }
"iOS" { return @("--test", $Action) }
"Xbox" { return @("--test", $Action) }
}
}

# Retrieve the integration test log file from Xbox and attach it to the run result.
# The Unity app writes to D:\Logs\UnityIntegrationTest.log on Xbox (UNITY_GAMECORE).
function Get-XboxLogOutput {
param(
[Parameter(Mandatory=$true)]
$RunResult,

[Parameter(Mandatory=$true)]
[string]$Action
)

$logFileName = "UnityIntegrationTest.log"
$logLocalDir = "$PSScriptRoot/results/xbox-logs/$Action"
New-Item -ItemType Directory -Path $logLocalDir -Force | Out-Null

try {
Copy-DeviceItem -DevicePath "D:\Logs\$logFileName" -Destination $logLocalDir
} catch {
throw "Failed to retrieve Xbox log file (D:\Logs\$logFileName): $_"
}

$localFile = Join-Path $logLocalDir $logFileName
$logContent = Get-Content $localFile -ErrorAction SilentlyContinue
if (-not $logContent -or $logContent.Count -eq 0) {
$localFiles = Get-ChildItem -Path $logLocalDir -ErrorAction SilentlyContinue
$localContents = if ($localFiles) { ($localFiles | ForEach-Object { $_.Name }) -join ", " } else { "(empty — D:\Logs\ likely did not exist on device)" }
throw "Xbox log file was empty or missing (D:\Logs\$logFileName). Copied directory contains: $localContents"
}

Write-Host "Retrieved log file from Xbox ($($logContent.Count) lines)" -ForegroundColor Green

$RunResult.Output = $logContent
return $RunResult
}

# Run a WebGL test action via headless Chrome
function Invoke-WebGLTestAction {
param (
Expand Down Expand Up @@ -110,6 +148,12 @@ BeforeAll {
$appArgs = Get-AppArguments -Action $Action
$runResult = Invoke-DeviceApp -ExecutablePath $script:ExecutablePath -Arguments $appArgs

# On Xbox, console output is not available in non-development builds.
# Retrieve the log file the app writes directly to disk.
if ($script:Platform -eq "Xbox") {
$runResult = Get-XboxLogOutput -RunResult $runResult -Action $Action
}

# Save result to JSON file
$runResult | ConvertTo-Json -Depth 5 | Out-File -FilePath (Get-OutputFilePath "${Action}-result.json")

Expand All @@ -120,6 +164,10 @@ BeforeAll {
$sendArgs = Get-AppArguments -Action "crash-send"
$sendResult = Invoke-DeviceApp -ExecutablePath $script:ExecutablePath -Arguments $sendArgs

if ($script:Platform -eq "Xbox") {
$sendResult = Get-XboxLogOutput -RunResult $sendResult -Action "crash-send"
}

# Save crash-send result to JSON for debugging
$sendResult | ConvertTo-Json -Depth 5 | Out-File -FilePath (Get-OutputFilePath "crash-send-result.json")

Expand All @@ -142,12 +190,12 @@ BeforeAll {

$script:Platform = $env:SENTRY_TEST_PLATFORM
if ([string]::IsNullOrEmpty($script:Platform)) {
throw "SENTRY_TEST_PLATFORM environment variable is not set. Expected: Android, Desktop, iOS, or WebGL"
throw "SENTRY_TEST_PLATFORM environment variable is not set. Expected: Android, Desktop, iOS, WebGL, or Xbox"
}

# Validate common environment
if ([string]::IsNullOrEmpty($env:SENTRY_TEST_DSN)) {
throw "SENTRY_TEST_DSN environment variable is not set."
if ([string]::IsNullOrEmpty($env:SENTRY_DSN)) {
throw "SENTRY_DSN environment variable is not set."
}
if ([string]::IsNullOrEmpty($env:SENTRY_AUTH_TOKEN)) {
throw "SENTRY_AUTH_TOKEN environment variable is not set."
Expand Down Expand Up @@ -195,10 +243,25 @@ BeforeAll {
Connect-Device -Platform "iOSSimulator" -Target $target
Install-DeviceApp -Path $env:SENTRY_TEST_APP
}
"Xbox" {
if ([string]::IsNullOrEmpty($env:XBCONNECT_TARGET)) {
throw "XBCONNECT_TARGET environment variable is not set."
}

Connect-Device -Platform "Xbox" -Target $env:XBCONNECT_TARGET

$xvcFile = Get-ChildItem -Path $env:SENTRY_TEST_APP -Filter "*.xvc" | Select-Object -First 1
if (-not $xvcFile) {
throw "No .xvc found in SENTRY_TEST_APP: $env:SENTRY_TEST_APP"
}
Install-DeviceApp -Path $xvcFile.FullName
$script:ExecutablePath = Get-PackageAumid -PackagePath $env:SENTRY_TEST_APP
Write-Host "Using AUMID: $($script:ExecutablePath)"
}
"WebGL" {
}
default {
throw "Unknown platform: $($script:Platform). Expected: Android, Desktop, iOS, or WebGL"
throw "Unknown platform: $($script:Platform). Expected: Android, Desktop, iOS, WebGL, or Xbox"
}
}

Expand All @@ -209,7 +272,7 @@ BeforeAll {
# Initialize test parameters
$script:TestSetup = [PSCustomObject]@{
Platform = $script:Platform
Dsn = $env:SENTRY_TEST_DSN
Dsn = $env:SENTRY_DSN
AuthToken = $env:SENTRY_AUTH_TOKEN
}

Expand Down
54 changes: 54 additions & 0 deletions test/Scripts.Integration.Test/Editor/AllowInsecureHttp.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using System;
using System.IO;
using System.Reflection;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;

public class AllowInsecureHttp : IPostprocessBuildWithReport, IPreprocessBuildWithReport
{
public int callbackOrder { get; }
public void OnPreprocessBuild(BuildReport report)
{
#if UNITY_2022_1_OR_NEWER
PlayerSettings.insecureHttpOption = InsecureHttpOption.AlwaysAllowed;
#endif
}

// The `allow insecure http always` options don't seem to work. This is why we modify the info.plist directly.
// Using reflection to get around the iOS module requirement on non-iOS platforms
public void OnPostprocessBuild(BuildReport report)
{
var pathToBuiltProject = report.summary.outputPath;
if (report.summary.platform == BuildTarget.iOS)
{
var plistPath = Path.Combine(pathToBuiltProject, "Info.plist");
if (!File.Exists(plistPath))
{
Debug.LogError("Failed to find the plist.");
return;
}

var xcodeAssembly = Assembly.Load("UnityEditor.iOS.Extensions.Xcode");
var plistType = xcodeAssembly.GetType("UnityEditor.iOS.Xcode.PlistDocument");
var plistElementDictType = xcodeAssembly.GetType("UnityEditor.iOS.Xcode.PlistElementDict");

var plist = Activator.CreateInstance(plistType);
plistType.GetMethod("ReadFromString", BindingFlags.Public | BindingFlags.Instance)
?.Invoke(plist, new object[] { File.ReadAllText(plistPath) });

var root = plistType.GetField("root", BindingFlags.Public | BindingFlags.Instance);
var allowDict = plistElementDictType.GetMethod("CreateDict", BindingFlags.Public | BindingFlags.Instance)
?.Invoke(root?.GetValue(plist), new object[] { "NSAppTransportSecurity" });

plistElementDictType.GetMethod("SetBoolean", BindingFlags.Public | BindingFlags.Instance)
?.Invoke(allowDict, new object[] { "NSAllowsArbitraryLoads", true });

var contents = (string)plistType.GetMethod("WriteToString", BindingFlags.Public | BindingFlags.Instance)
?.Invoke(plist, null);

File.WriteAllText(plistPath, contents);
}
}
}
Loading
Loading