Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 6 additions & 18 deletions .github/workflows/Engine-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- 'Obelisk/**'
- 'Resources/**'
- 'Scripts/**'
- 'tests/**'
- 'CMakeLists.txt'
- 'CMakePresets.json'
- 'dependencies.cmake'
Expand All @@ -21,6 +22,7 @@ on:
- 'Obelisk/**'
- 'Resources/**'
- 'Scripts/**'
- 'tests/**'
- 'CMakeLists.txt'
- 'CMakePresets.json'
- 'dependencies.cmake'
Expand All @@ -41,25 +43,11 @@ on:
default: false

jobs:
scene-sanitizers:
uses: ./.github/workflows/job-scene-sanitizers.yml

scene-evidence-tests:
name: Scene evidence tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 10
permissions:
contents: read
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-2025, macos-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Validate scene lifecycle and capture evidence tools
run: python -m unittest discover -s Scripts/tests -v
uses: ./.github/workflows/job-scene-evidence-tests.yml

commitlint:
# A develop-to-main promotion contains historical commits that predate
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/job-scene-evidence-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Scene evidence tests

on:
workflow_call:

jobs:
scene-evidence-tests:
name: Scene evidence tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 10
permissions:
contents: read
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-2025, macos-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Validate scene lifecycle and capture evidence tools
run: python -m unittest discover -s tests/scene/unit -v
50 changes: 50 additions & 0 deletions .github/workflows/job-scene-sanitizers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Scene CPU sanitizers

on:
workflow_call:

jobs:
scene-sanitizers:
name: Scene CPU sanitizer (${{ matrix.name }})
runs-on: ubuntu-24.04
timeout-minutes: 45
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- name: address-undefined
sanitizer: address,undefined
- name: thread
sanitizer: thread
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build cmake gcc g++ libasound2-dev libgl1-mesa-dev libpulse-dev libdbus-1-dev libglib2.0-dev libx11-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev libxrandr-dev libxss-dev libxt-dev libxxf86vm-dev glslang-tools libwayland-dev libxkbcommon-dev pkg-config
- name: Configure instrumented build
env:
CC: gcc
CXX: g++
SANITIZER: ${{ matrix.sanitizer }}
run: |
cmake --preset Linux_x64_Debug \
"-DCMAKE_C_FLAGS=-fsanitize=${SANITIZER} -fno-omit-frame-pointer" \
"-DCMAKE_CXX_FLAGS=-fsanitize=${SANITIZER} -fno-sanitize=vptr -fno-omit-frame-pointer" \
"-DCMAKE_EXE_LINKER_FLAGS=-fsanitize=${SANITIZER}" \
"-DCMAKE_SHARED_LINKER_FLAGS=-fsanitize=${SANITIZER}"
- name: Build scene tests
run: cmake --build Result.Linux.x64.Debug --target ZEngineTests -j 2
- name: Run lifecycle and resource tests
env:
ASAN_OPTIONS: detect_leaks=1:halt_on_error=1
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1
TSAN_OPTIONS: halt_on_error=1
run: |
Result.Linux.x64.Debug/ZEngine/tests/ZEngineTests \
--gtest_filter='CookedObjectSnapshotTest.*:CookedPackageSnapshotTest.*:SceneLoadCoordinatorTest.*:SceneRuntimeCameraTest.*:SceneSubmissionProgressTest.*:SceneInstanceTest.*:SceneResourceBundleTest.*:SceneEnvironmentHandoffTest.*' \
--gtest_output=xml:scene-sanitizer-results.xml
python3 tests/scene/verify_scene_sanitizer_results.py scene-sanitizer-results.xml
8 changes: 7 additions & 1 deletion .github/workflows/job-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,10 @@ jobs:
shell: pwsh
env:
PATH: ${{github.workspace}}\lib
run: ${{github.workspace}}\tests\TetragramaTests.exe
run: |
& "${{github.workspace}}\tests\TetragramaTests.exe"
if ($LASTEXITCODE -ne 0) {
$nativeCode = [uint32]([int64]$LASTEXITCODE -band 0xFFFFFFFFL)
Write-Error ("Editor test process failed with native exit code 0x{0:X8}" -f $nativeCode)
exit 1
}
52 changes: 52 additions & 0 deletions Obelisk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,55 @@ endif()

install(TARGETS ${TARGET_NAME} DESTINATION bin)
zengine_sign_installed_target(${TARGET_NAME} bin)

# These tests create real windows and submit Vulkan work. Keep them opt-in so
# headless builders cannot silently substitute a non-rendering test for them.
option(ZENGINE_ENABLE_COOKED_DESKTOP_TESTS "Register cooked scene desktop Vulkan process tests" OFF)
if(BUILD_TESTING AND ZENGINE_ENABLE_COOKED_DESKTOP_TESTS)
find_package(Python3 REQUIRED COMPONENTS Interpreter)
set(_cooked_smoke "${CMAKE_SOURCE_DIR}/tests/scene/cooked_scene_smoke.py")
set(_cooked_common "${Python3_EXECUTABLE}" "${_cooked_smoke}"
--cooker "$<TARGET_FILE:SceneCookProcess>" --obelisk "$<TARGET_FILE:Obelisk>")
add_test(NAME CookedDesktop.StartupAndPackageFailures COMMAND ${_cooked_common} --failure-cases)
add_test(NAME CookedDesktop.Replacements COMMAND ${_cooked_common} --reloads 3)
add_test(NAME CookedDesktop.RuntimeMainCamera COMMAND ${_cooked_common} --runtime-camera main)
add_test(NAME CookedDesktop.RuntimeExplicitCamera COMMAND ${_cooked_common} --runtime-camera a0000000-0000-0000-0000-00000000000a)
add_test(NAME CookedDesktop.StandaloneMainCamera COMMAND ${_cooked_common} --standalone --runtime-camera main)
add_test(NAME CookedDesktop.StandalonePackageFailures COMMAND ${_cooked_common} --standalone --runtime-camera main --failure-cases --audit-source --require-validation)
add_test(NAME CookedDesktop.StandaloneCapture COMMAND ${_cooked_common} --standalone --runtime-camera main --verify-capture)
add_test(NAME CookedDesktop.StandaloneSourceIndependence COMMAND ${_cooked_common} --standalone --runtime-camera main --reloads 3 --audit-source)
add_test(NAME CookedDesktop.StandaloneExplicitCamera COMMAND ${_cooked_common} --standalone --runtime-camera a0000000-0000-0000-0000-00000000000a)
add_test(NAME CookedDesktop.StandaloneMissingCamera COMMAND ${_cooked_common} --standalone --runtime-camera b0000000-0000-0000-0000-00000000000b --reject-runtime-camera)
add_test(NAME CookedDesktop.StandaloneReplacements COMMAND ${_cooked_common} --standalone --runtime-camera main --reloads 3)
add_test(NAME CookedDesktop.StandaloneLifecycleStressSmoke COMMAND ${_cooked_common} --standalone --runtime-camera main --reloads 6 --lifecycle-stress)
add_test(NAME CookedDesktop.StandaloneSteadyAndReplacement COMMAND ${_cooked_common} --standalone --runtime-camera main --reloads 1 --steady-frames 30)
add_test(NAME CookedDesktop.StandaloneMissingReplacementRetry COMMAND ${_cooked_common} --standalone --runtime-camera main --reloads 1 --missing-replacement --retry-after-failure)
add_test(NAME CookedDesktop.StandaloneMissingReplacementCameraRetry COMMAND ${_cooked_common} --standalone --runtime-camera main --reloads 1 --missing-replacement-camera --retry-after-failure)
add_test(NAME CookedDesktop.StandaloneCorruptReplacementMaterialRetry COMMAND ${_cooked_common} --standalone --runtime-camera main --reloads 1 --corrupt-replacement-material --retry-after-failure --require-validation --audit-source)
add_test(NAME CookedDesktop.StandaloneMissingReplacementMaterialRetry COMMAND ${_cooked_common} --standalone --runtime-camera main --reloads 1 --missing-replacement-material --retry-after-failure --require-validation --audit-source)
add_test(NAME CookedDesktop.StandaloneUploadCancellationRetry COMMAND ${_cooked_common} --standalone --runtime-camera main --reloads 1 --cancel-during-upload --retry-after-failure --require-validation --audit-source)
add_test(NAME CookedDesktop.StandaloneCpuCancellationRetry COMMAND ${_cooked_common} --standalone --runtime-camera main --reloads 1 --cancel-during-cpu --retry-after-failure --require-validation --audit-source)
add_test(NAME CookedDesktop.StandaloneUploadSubmissionRejectionRetry COMMAND ${_cooked_common} --standalone --runtime-camera main --reloads 1 --reject-submit --retry-after-failure --require-validation --audit-source)
add_test(NAME CookedDesktop.StandaloneStagingRefusalRetry COMMAND ${_cooked_common} --standalone --runtime-camera main --reloads 1 --fail-staging --retry-after-failure)
add_test(NAME CookedDesktop.StandalonePreflightRefusalRetry COMMAND ${_cooked_common} --standalone --runtime-camera main --reloads 1 --fail-preflight --retry-after-failure --require-validation --audit-source)
add_test(NAME CookedDesktop.StandaloneDeviceLoss COMMAND ${_cooked_common} --standalone --runtime-camera main --reloads 1 --device-loss)
add_test(NAME CookedDesktop.StandaloneShutdownCpu COMMAND ${_cooked_common} --standalone --runtime-camera main --reloads 1 --shutdown-cpu --require-validation)
add_test(NAME CookedDesktop.StandaloneShutdownGpu COMMAND ${_cooked_common} --standalone --runtime-camera main --reloads 1 --shutdown-gpu --require-validation)
add_test(NAME CookedDesktop.StandaloneCorruptReplacementRetry COMMAND ${_cooked_common} --standalone --runtime-camera main --reloads 1 --corrupt-replacement --retry-after-failure)
add_test(NAME CookedDesktop.StandaloneSupersedeCpu COMMAND ${_cooked_common} --standalone --runtime-camera main --reloads 1 --supersede-during-cpu)
add_test(NAME CookedDesktop.StandaloneSupersedeWaiting COMMAND ${_cooked_common} --standalone --runtime-camera main --reloads 1 --supersede-reload)
add_test(NAME CookedDesktop.StandaloneSupersedeUpload COMMAND ${_cooked_common} --standalone --runtime-camera main --reloads 1 --supersede-during-upload)
add_test(NAME CookedDesktop.RuntimeMissingCamera COMMAND ${_cooked_common} --runtime-camera b0000000-0000-0000-0000-00000000000b --reject-runtime-camera)
add_test(NAME CookedDesktop.SupersedeWaiting COMMAND ${_cooked_common} --reloads 1 --supersede-reload)
add_test(NAME CookedDesktop.SupersedeCpu COMMAND ${_cooked_common} --reloads 1 --supersede-during-cpu)
add_test(NAME CookedDesktop.SupersedeUpload COMMAND ${_cooked_common} --reloads 1 --supersede-during-upload)
add_test(NAME CookedDesktop.CpuCancellationRetry COMMAND ${_cooked_common} --reloads 1 --cancel-during-cpu --retry-after-failure)
add_test(NAME CookedDesktop.UploadCancellationRetry COMMAND ${_cooked_common} --reloads 1 --cancel-during-upload --retry-after-failure)
add_test(NAME CookedDesktop.StagingRefusalRetry COMMAND ${_cooked_common} --reloads 1 --fail-staging --retry-after-failure)
add_test(NAME CookedDesktop.UploadSubmissionRejectionRetry COMMAND ${_cooked_common} --reloads 1 --reject-submit --retry-after-failure)
add_test(NAME CookedDesktop.CorruptReplacementRetry COMMAND ${_cooked_common} --reloads 1 --corrupt-replacement --retry-after-failure)
set_tests_properties(CookedDesktop.StartupAndPackageFailures CookedDesktop.Replacements CookedDesktop.RuntimeMainCamera CookedDesktop.RuntimeExplicitCamera CookedDesktop.StandaloneMainCamera CookedDesktop.StandaloneCapture CookedDesktop.StandaloneSourceIndependence CookedDesktop.StandaloneExplicitCamera CookedDesktop.StandaloneMissingCamera CookedDesktop.StandaloneReplacements CookedDesktop.StandaloneSteadyAndReplacement CookedDesktop.StandaloneMissingReplacementRetry CookedDesktop.StandaloneUploadCancellationRetry CookedDesktop.StandaloneCpuCancellationRetry CookedDesktop.StandaloneUploadSubmissionRejectionRetry CookedDesktop.StandaloneStagingRefusalRetry CookedDesktop.StandaloneDeviceLoss CookedDesktop.StandaloneCorruptReplacementRetry CookedDesktop.StandaloneSupersedeWaiting CookedDesktop.StandaloneSupersedeCpu CookedDesktop.StandaloneSupersedeUpload CookedDesktop.RuntimeMissingCamera CookedDesktop.SupersedeWaiting CookedDesktop.SupersedeCpu CookedDesktop.SupersedeUpload
CookedDesktop.StandalonePackageFailures CookedDesktop.StandaloneLifecycleStressSmoke CookedDesktop.StandaloneShutdownCpu CookedDesktop.StandaloneShutdownGpu CookedDesktop.StandalonePreflightRefusalRetry CookedDesktop.StandaloneMissingReplacementCameraRetry CookedDesktop.StandaloneCorruptReplacementMaterialRetry CookedDesktop.StandaloneMissingReplacementMaterialRetry CookedDesktop.CpuCancellationRetry CookedDesktop.UploadCancellationRetry
CookedDesktop.StagingRefusalRetry CookedDesktop.UploadSubmissionRejectionRetry CookedDesktop.CorruptReplacementRetry
PROPERTIES TIMEOUT 240 RUN_SERIAL TRUE LABELS "cook;scene;desktop;vulkan")
endif()
Loading
Loading