From eb2d6335cdac242e7b433ef3d71a92ae13b5ba53 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 9 Jul 2026 00:58:12 +0100 Subject: [PATCH] Add Aetheria Unity EditMode runner --- docs/eve-migration-roadmap.md | 16 ++- docs/parity-testing-harness.md | 19 +++- .../README.md | 9 +- .../GameCult.Eve.UnityUIToolkit.Tests.asmdef | 8 +- .../eve-runtime-capability.json | 7 +- scripts/run-aetheria-unity-editmode-tests.ps1 | 99 +++++++++++++++++++ tools/parity/parity-manifest.json | 11 ++- 7 files changed, 152 insertions(+), 17 deletions(-) create mode 100644 scripts/run-aetheria-unity-editmode-tests.ps1 diff --git a/docs/eve-migration-roadmap.md b/docs/eve-migration-roadmap.md index 3619b88..2bc6cc3 100644 --- a/docs/eve-migration-roadmap.md +++ b/docs/eve-migration-roadmap.md @@ -285,10 +285,18 @@ Recently cut: parity harness validates release, test, and capture lifecycle claims against `tools/parity/parity-manifest.json`, checks declared evidence paths, and exports lifecycle status through the conformance index. Current proof covers - incubating UPM package identity, authored package EditMode tests, and the - Aetheria consumer-build smoke; tagged EveUnity release, runtime-owned - batchmode test execution, and editor or batchmode capture remain explicit - split blockers. + incubating UPM package identity, package EditMode tests, Aetheria + consumer-build smoke, and an Eve-owned batchmode EditMode run through the + Aetheria Unity project; tagged EveUnity release, moving the batchmode runner + into EveUnity, and editor or batchmode capture remain explicit split + blockers. +- Aetheria now has repeatable Unity EditMode evidence for the Eve UI Toolkit + runtime. `scripts/run-aetheria-unity-editmode-tests.ps1` temporarily adds + `org.gamecult.eve.unity-uitoolkit` to Aetheria's Unity `testables`, runs + `GameCult.Eve.UnityUIToolkit.Tests` in Unity batchmode, writes XML and log + artifacts under `artifacts/aetheria-unity-editmode`, and restores + `Packages/manifest.json` before returning. This proves the incubating test + lifecycle; it does not make Eve own Unity's final runtime lifecycle. - Aetheria now has repeatable Unity package consumer-build evidence for the Eve UI Toolkit runtime. `scripts/run-aetheria-unity-package-smoke.ps1` verifies Aetheria's Unity `Packages/manifest.json` consumes Eve's surface and diff --git a/docs/parity-testing-harness.md b/docs/parity-testing-harness.md index a0f0b91..d30c53b 100644 --- a/docs/parity-testing-harness.md +++ b/docs/parity-testing-harness.md @@ -113,6 +113,21 @@ files, then builds the package through Aetheria's Unity-generated project. It is consumer-build evidence, not a replacement for runtime-owned Unity capture or release CI. +Aetheria Unity EditMode test smoke: + +```powershell +powershell -ExecutionPolicy Bypass -File .\scripts\run-aetheria-unity-editmode-tests.ps1 +``` + +That script temporarily adds `org.gamecult.eve.unity-uitoolkit` to Aetheria's +Unity `testables`, runs `GameCult.Eve.UnityUIToolkit.Tests` in Unity batchmode, +writes XML and log artifacts under `artifacts/aetheria-unity-editmode`, and +restores `Packages/manifest.json` before returning. The test asmdef uses +Unity-style precompiled references for the Brokkr/CultMesh DLLs that Unity +needs to resolve `GameCult.Mesh`; this complements the normal CultLib +.NET/NuGet dependency story rather than replacing it. The runner proves the +incubating package test lifecycle, not final EveUnity-owned release or capture. + Unity runtime lifecycle evidence: `packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json` @@ -122,8 +137,8 @@ The parity harness validates those lifecycle claims against exist. The current lifecycle proof is deliberately split: - release: incubating UPM package identity and import surface exist in Eve; -- test: package-owned EditMode tests are authored and Aetheria can build the - package through Unity's generated project; +- test: package-owned EditMode tests run through Aetheria in Unity batchmode, + and Aetheria can build the package through Unity's generated project; - capture: Unity editor or batchmode capture remains a split blocker. The smoke runner writes: diff --git a/packages/org.gamecult.eve.unity-uitoolkit/README.md b/packages/org.gamecult.eve.unity-uitoolkit/README.md index 94c7dcb..49f4edf 100644 --- a/packages/org.gamecult.eve.unity-uitoolkit/README.md +++ b/packages/org.gamecult.eve.unity-uitoolkit/README.md @@ -38,8 +38,8 @@ The runtime capability manifest is evidence: - release: incubating UPM package identity and import surface; -- test: package-owned EditMode tests plus Aetheria consumer-build smoke through - Unity's generated project; +- test: package-owned EditMode tests run through Aetheria in Unity batchmode, + plus Aetheria consumer-build smoke through Unity's generated project; - capture: pending Unity editor or batchmode artifact. Those lifecycle claims are validated by the parity harness. A missing evidence @@ -48,6 +48,11 @@ path is a runtime capability error, not a README footnote. For Aetheria, the Unity evidence path is: - `powershell -ExecutionPolicy Bypass -File ..\..\scripts\run-aetheria-unity-package-smoke.ps1` +- `powershell -ExecutionPolicy Bypass -File ..\..\scripts\run-aetheria-unity-editmode-tests.ps1` + +The EditMode test asmdef declares Unity precompiled references for the +Brokkr/CultMesh DLLs Unity needs to resolve `GameCult.Mesh`. That is Unity +assembly plumbing, not a claim that CultLib lacks NuGet/.NET packaging. Those checks sit alongside Eve's shared browser, Flutter, iOS, Android/Kotlin, and Rust contract tests, all discoverable from the parity manifest. diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef b/packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef index 8659c1c..380920e 100644 --- a/packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef +++ b/packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef @@ -11,8 +11,12 @@ ], "excludePlatforms": [], "allowUnsafeCode": false, - "overrideReferences": false, - "precompiledReferences": [], + "overrideReferences": true, + "precompiledReferences": [ + "GameCult.Caching.dll", + "GameCult.Mesh.dll", + "MessagePack.Annotations.dll" + ], "autoReferenced": false, "defineConstraints": [], "versionDefines": [], diff --git a/packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json b/packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json index 46e9f1d..e2fa8a7 100644 --- a/packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json +++ b/packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json @@ -59,15 +59,16 @@ }, "test": { "ownerRepo": "EveUnity", - "status": "authored-editmode-tests-and-consumer-build-smoke", - "command": "powershell -ExecutionPolicy Bypass -File .\\scripts\\run-aetheria-unity-package-smoke.ps1", + "status": "batchmode-editmode-tests-and-consumer-build-smoke", + "command": "powershell -ExecutionPolicy Bypass -File .\\scripts\\run-aetheria-unity-editmode-tests.ps1", "evidencePaths": [ "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef", "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs", + "scripts/run-aetheria-unity-editmode-tests.ps1", "scripts/run-aetheria-unity-package-smoke.ps1" ], "pendingProofs": [ - "Unity EditMode or PlayMode test assembly runs from the runtime repo in batchmode." + "Unity batchmode EditMode runner is owned by EveUnity rather than Eve incubation." ] }, "capture": { diff --git a/scripts/run-aetheria-unity-editmode-tests.ps1 b/scripts/run-aetheria-unity-editmode-tests.ps1 new file mode 100644 index 0000000..5fbd4f4 --- /dev/null +++ b/scripts/run-aetheria-unity-editmode-tests.ps1 @@ -0,0 +1,99 @@ +param( + [string] $AetheriaRoot = "E:\Projects\Aetheria", + [string] $UnityExe = "C:\Program Files\Unity\Hub\Editor\6000.4.2f1\Editor\Unity.exe", + [string] $OutputRoot = "" +) + +$ErrorActionPreference = "Stop" + +$eveRoot = Split-Path -Parent $PSScriptRoot +if ([string]::IsNullOrWhiteSpace($OutputRoot)) { + $OutputRoot = Join-Path $eveRoot "artifacts\aetheria-unity-editmode" +} + +if (-not (Test-Path -LiteralPath $AetheriaRoot)) { + throw "Aetheria repo not found: $AetheriaRoot" +} +if (-not (Test-Path -LiteralPath $UnityExe)) { + throw "Unity editor not found: $UnityExe" +} + +$manifestPath = Join-Path $AetheriaRoot "Packages\manifest.json" +if (-not (Test-Path -LiteralPath $manifestPath)) { + throw "Aetheria Unity package manifest not found: $manifestPath" +} + +$stamp = Get-Date -Format "yyyyMMddTHHmmss" +$runRoot = Join-Path $OutputRoot $stamp +New-Item -ItemType Directory -Force -Path $runRoot | Out-Null + +$resultsPath = Join-Path $runRoot "unity-editmode-results.xml" +$logPath = Join-Path $runRoot "unity-editmode.log" +$packageName = "org.gamecult.eve.unity-uitoolkit" + +$originalManifest = Get-Content -Raw -LiteralPath $manifestPath +$manifestRestored = $false + +function Restore-Manifest { + if (-not $script:manifestRestored) { + Set-Content -LiteralPath $manifestPath -Value $script:originalManifest -NoNewline + $script:manifestRestored = $true + } +} + +try { + $manifest = $originalManifest | ConvertFrom-Json + $testables = @($manifest.testables) + if ($testables -notcontains $packageName) { + $testables += $packageName + if ($manifest.PSObject.Properties.Name -contains "testables") { + $manifest.testables = $testables + } else { + $manifest | Add-Member -NotePropertyName "testables" -NotePropertyValue $testables + } + $manifest | ConvertTo-Json -Depth 32 | Set-Content -LiteralPath $manifestPath + } + + $arguments = @( + "-batchmode", + "-projectPath", $AetheriaRoot, + "-runTests", + "-testPlatform", "EditMode", + "-assemblyNames", "GameCult.Eve.UnityUIToolkit.Tests", + "-testResults", $resultsPath, + "-logFile", $logPath + ) + + $process = Start-Process -FilePath $UnityExe -ArgumentList $arguments -Wait -PassThru -WindowStyle Hidden + $exitCode = $process.ExitCode +} finally { + Restore-Manifest +} + +if ($exitCode -ne 0) { + if (Test-Path -LiteralPath $logPath) { + Get-Content -LiteralPath $logPath -Tail 120 + } + throw "Unity EditMode test run failed with exit code $exitCode. Log: $logPath" +} + +if (-not (Test-Path -LiteralPath $resultsPath)) { + throw "Unity EditMode test run did not produce results: $resultsPath" +} + +[xml] $results = Get-Content -Raw -LiteralPath $resultsPath +$testRun = $results.SelectSingleNode("//test-run") +if ($null -eq $testRun) { + throw "Unity EditMode test results did not contain a test-run node: $resultsPath" +} + +$failed = [int] $testRun.failed +$passed = [int] $testRun.passed +$total = [int] $testRun.total +if ($failed -gt 0) { + throw "Unity EditMode tests failed: $failed failed, $passed passed, $total total. Results: $resultsPath" +} + +Write-Host "Unity EditMode tests passed: $passed passed, $total total" +Write-Host "Unity EditMode results: $resultsPath" +Write-Host "Unity EditMode log: $logPath" diff --git a/tools/parity/parity-manifest.json b/tools/parity/parity-manifest.json index 50e089e..7c98aeb 100644 --- a/tools/parity/parity-manifest.json +++ b/tools/parity/parity-manifest.json @@ -428,7 +428,7 @@ ], "pendingProofs": [ "Tagged UPM release is cut from EveUnity rather than Eve incubation.", - "Unity EditMode or PlayMode test assembly runs from the runtime repo in batchmode.", + "Unity batchmode EditMode runner is owned by EveUnity rather than Eve incubation.", "Unity batchmode or editor capture artifact is attached to the runtime conformance report." ] } @@ -707,7 +707,8 @@ "packages/org.gamecult.eve.unity-uitoolkit/Runtime/SaiVisualNovelUiToolkitProjectionAdapter.cs", "packages/org.gamecult.eve.unity-uitoolkit/Runtime/NornGraphUiToolkitProjectionAdapter.cs", "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef", - "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs" + "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs", + "scripts/run-aetheria-unity-editmode-tests.ps1" ], "expectedSourceSymbols": [ { @@ -763,14 +764,16 @@ }, "test": { "ownerRepo": "EveUnity", - "status": "authored-editmode-tests-and-consumer-build-smoke", + "status": "batchmode-editmode-tests-and-consumer-build-smoke", + "command": "powershell -ExecutionPolicy Bypass -File .\\scripts\\run-aetheria-unity-editmode-tests.ps1", "evidencePaths": [ "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef", "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs", + "scripts/run-aetheria-unity-editmode-tests.ps1", "scripts/run-aetheria-unity-package-smoke.ps1" ], "pendingProofs": [ - "Unity EditMode or PlayMode test assembly runs from the runtime repo in batchmode." + "Unity batchmode EditMode runner is owned by EveUnity rather than Eve incubation." ] }, "capture": {