Files
Jason Larabie effb471b68 Add Unreal Result type to support C++ and Blueprint (#3834)
# Description of Changes

- Updated Unreal codegen to work with ::Result to match how ::Option
works to create a new struct for each type pair identified
- Added new integration tests to confirm Ok state for all new types
added to sdk-tests
- Added new UE_SPACETIMEDB_RESULT macro to capture de/serialization for
the new structs

# API and ABI breaking changes

N/A

# Expected complexity level and risk

2 - Added new type generated from Result which creates new structs for
each one identified

# Testing

- [x] Updated the integration tests to include the new Result types

---------

Co-authored-by: Mario Alejandro Montoya Cortes <mamcx@elmalabarista.com>
2026-01-14 23:32:02 +00:00
..

Unreal Headless Test Harness for SpacetimeDB

This directory contains the Unreal Engine headless test harness for the SpacetimeDB Unreal SDK.


Overview

The tests here validate the Unreal SDK integration against a running SpacetimeDB instance.
They use the Rust-based test harness in sdk.rs and execute an Unreal test project headlessly.

  • Test Harness:
    crates\testing\src\sdk.rs

  • Unreal Test Entry Point:
    crates\sdk-unreal\tests\test.rs

  • Unreal Test Project:
    crates\sdk-unreal\tests\TestClient

Prerequisites

The tests require an environment variable pointing to your Unreal Engine installation: Example for Unreal Engine 5.6:

set UE_ROOT_PATH="C:/Program Files/Epic Games/UE_5.6"

Running the Test

From inside the Unreal SDK crate:

cd \sdk-unreal
cargo test -p sdk-unreal-test-harness --test test -- --nocapture

Using a Custom SpacetimeDB Build

To run tests against a custom CLI build of SpacetimeDB, set the following environment variables:

set CUSTOM_SPACETIMEDB_ROOT=true
set CUSTOM_SPACETIMEDB_PATH=<Path to custom spacetime CLI>

Unreal Engine Command Line Flags

When running Unreal headlessly in CI, the following flags are commonly used:

Flag Purpose
-ExecCmds="..." Executes in-editor console commands in sequence (e.g., Automation RunTests ...; Automation ExportReport; Quit).
-Unattended Disables all interactive dialogs; required for fully automated/headless runs.
-NoPause Prevents “Press any key to continue” prompts on exit.
-NullRHI Disables rendering entirely; speeds up headless runs and avoids GPU usage.
-NoSplash Skips the Unreal splash screen for faster startup.
-NoSound Disables audio systems; can improve performance in automation.
-nop4 Disables Perforce integration; avoids P4 login prompts in CI.
-log Prints log output to the console window (instead of only writing to file).
-Log="Path\To\File.log" Writes engine log output to a specific file.
-ReportOutputPath="..." Directory where HTML reports (and related assets) will be saved when running Automation ExportReport.
-ReportExportPath="..." File path for exporting the raw test results as JSON, which the HTML report uses.
-LogCmds="automation veryverbose" Increases log verbosity for the automation system; useful for debugging test discovery and execution.
-test="Filter" (When using -run=Automation) Runs only tests that match the given filter.
-run=Automation Runs the Automation commandlet (source builds or certain editor configs only). Not always available in installed builds.