Prove EveUnity scene EditMode lifecycle
This commit is contained in:
parent
028042009e
commit
881282dd50
34 changed files with 221 additions and 42 deletions
|
|
@ -1,7 +1,9 @@
|
|||
param(
|
||||
[string] $AetheriaRoot = "E:\Projects\Aetheria",
|
||||
[string] $UnityExe = "C:\Program Files\Unity\Hub\Editor\6000.4.2f1\Editor\Unity.exe",
|
||||
[string] $OutputRoot = ""
|
||||
[string] $OutputRoot = "",
|
||||
[string] $PackageName = "org.gamecult.eve.unity-uitoolkit",
|
||||
[string] $TestAssembly = "GameCult.Eve.UnityUIToolkit.Tests"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
|
@ -10,6 +12,12 @@ $eveRoot = Split-Path -Parent $PSScriptRoot
|
|||
if ([string]::IsNullOrWhiteSpace($OutputRoot)) {
|
||||
$OutputRoot = Join-Path $eveRoot "artifacts\aetheria-unity-editmode"
|
||||
}
|
||||
if ([string]::IsNullOrWhiteSpace($PackageName)) {
|
||||
throw "Unity EditMode package name must not be empty"
|
||||
}
|
||||
if ([string]::IsNullOrWhiteSpace($TestAssembly)) {
|
||||
throw "Unity EditMode test assembly must not be empty"
|
||||
}
|
||||
|
||||
if (-not (Test-Path -LiteralPath $AetheriaRoot)) {
|
||||
throw "Aetheria repo not found: $AetheriaRoot"
|
||||
|
|
@ -29,7 +37,6 @@ 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
|
||||
|
|
@ -43,9 +50,12 @@ function Restore-Manifest {
|
|||
|
||||
try {
|
||||
$manifest = $originalManifest | ConvertFrom-Json
|
||||
$testables = @($manifest.testables)
|
||||
if ($testables -notcontains $packageName) {
|
||||
$testables += $packageName
|
||||
$testables = @()
|
||||
if ($null -ne $manifest.testables) {
|
||||
$testables = @($manifest.testables) | Where-Object { $null -ne $_ -and -not [string]::IsNullOrWhiteSpace([string] $_) }
|
||||
}
|
||||
if ($testables -notcontains $PackageName) {
|
||||
$testables += $PackageName
|
||||
if ($manifest.PSObject.Properties.Name -contains "testables") {
|
||||
$manifest.testables = $testables
|
||||
} else {
|
||||
|
|
@ -59,7 +69,7 @@ try {
|
|||
"-projectPath", $AetheriaRoot,
|
||||
"-runTests",
|
||||
"-testPlatform", "EditMode",
|
||||
"-assemblyNames", "GameCult.Eve.UnityUIToolkit.Tests",
|
||||
"-assemblyNames", $TestAssembly,
|
||||
"-testResults", $resultsPath,
|
||||
"-logFile", $logPath
|
||||
)
|
||||
|
|
@ -94,6 +104,6 @@ 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 tests passed for ${TestAssembly}: $passed passed, $total total"
|
||||
Write-Host "Unity EditMode results: $resultsPath"
|
||||
Write-Host "Unity EditMode log: $logPath"
|
||||
|
|
|
|||
19
scripts/run-aetheria-unity-scene-editmode-tests.ps1
Normal file
19
scripts/run-aetheria-unity-scene-editmode-tests.ps1
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
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-scene-editmode"
|
||||
}
|
||||
|
||||
& (Join-Path $PSScriptRoot "run-aetheria-unity-editmode-tests.ps1") `
|
||||
-AetheriaRoot $AetheriaRoot `
|
||||
-UnityExe $UnityExe `
|
||||
-OutputRoot $OutputRoot `
|
||||
-PackageName "org.gamecult.eve.unity-scene" `
|
||||
-TestAssembly "GameCult.Eve.UnityScene.Tests"
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
param(
|
||||
[string] $CapabilityManifestPath = "runtimes\incubating\eve-unity-scene\eve-runtime-capability.json"
|
||||
[string] $CapabilityManifestPath = "runtimes\incubating\eve-unity-scene\eve-runtime-capability.json",
|
||||
[switch] $RunUnityEditMode
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
|
@ -39,7 +40,7 @@ if ($manifest.incubation.splitHandoff.manifestPath -ne "runtimes/incubating/eve-
|
|||
throw "EveUnity scene manifest missing split handoff path"
|
||||
}
|
||||
|
||||
foreach ($feature in @("providerAdvertisements", "commandTransport", "providerSurfaceSession", "providerSurfaceSource", "providerSurfaceDocumentSource", "livePlayableWorldClient", "providerCommandReceipts", "providerAssetManifestDocumentSource", "sceneGraphProjection", "playableWorldProjection", "playableWorldRuntimeHost", "playableWorldScenePresentation", "unityGameObjectSceneSink", "providerAssetManifestResolution", "providerAssetManifestSource", "embeddedDocuments")) {
|
||||
foreach ($feature in @("providerAdvertisements", "commandTransport", "providerSurfaceSession", "providerSurfaceSource", "providerSurfaceDocumentSource", "livePlayableWorldClient", "providerCommandReceipts", "providerAssetManifestDocumentSource", "playableWorldClientHost", "playableWorldClientBootstrap", "playableWorldInputDriver", "playableWorldCameraRig", "sceneGraphProjection", "playableWorldProjection", "playableWorldRuntimeHost", "playableWorldScenePresentation", "unityGameObjectSceneSink", "providerAssetManifestResolution", "providerAssetManifestSource", "embeddedDocuments")) {
|
||||
if (-not (@($manifest.supportedFeatures) -contains $feature)) {
|
||||
throw "EveUnity scene manifest missing provider-shell feature: $feature"
|
||||
}
|
||||
|
|
@ -182,6 +183,18 @@ foreach ($field in @("ownerRepo", "runnerKind", "runnerScript", "consumerProject
|
|||
throw "EveUnity scene test contract missing $field"
|
||||
}
|
||||
}
|
||||
if ($testContract.runnerKind -ne "unity-editmode-batchmode") {
|
||||
throw "EveUnity scene test contract has unexpected runner kind: $($testContract.runnerKind)"
|
||||
}
|
||||
if ($testContract.packageName -ne "org.gamecult.eve.unity-scene") {
|
||||
throw "EveUnity scene test contract has unexpected package name: $($testContract.packageName)"
|
||||
}
|
||||
if ($testContract.testAssembly -ne "GameCult.Eve.UnityScene.Tests") {
|
||||
throw "EveUnity scene test contract has unexpected test assembly: $($testContract.testAssembly)"
|
||||
}
|
||||
if ($testContract.testPlatform -ne "EditMode") {
|
||||
throw "EveUnity scene test contract has unexpected test platform: $($testContract.testPlatform)"
|
||||
}
|
||||
foreach ($pathProperty in @("runnerScript", "consumerProject")) {
|
||||
$candidate = $testContract.$pathProperty
|
||||
$absolutePath = if ([System.IO.Path]::IsPathRooted($candidate)) {
|
||||
|
|
@ -193,6 +206,12 @@ foreach ($pathProperty in @("runnerScript", "consumerProject")) {
|
|||
throw "EveUnity scene test contract $pathProperty does not exist: $candidate"
|
||||
}
|
||||
}
|
||||
$runnerSource = Get-Content -LiteralPath (Join-Path $projectRoot $testContract.runnerScript) -Raw
|
||||
foreach ($expectedText in @($testContract.packageName, $testContract.testAssembly, "run-aetheria-unity-editmode-tests.ps1")) {
|
||||
if (-not $runnerSource.Contains($expectedText)) {
|
||||
throw "EveUnity scene test runner script missing expected text: $expectedText"
|
||||
}
|
||||
}
|
||||
|
||||
$captureContract = $manifest.lifecycle.capture.captureContract
|
||||
foreach ($field in @("ownerRepo", "runtimeId", "targetId", "requestSchema", "requestBuilder", "advertisementPath", "captureKind", "artifactKind", "artifactPattern", "conformanceAttachment", "requiredProvider", "requiredSurface", "authority", "publishProof")) {
|
||||
|
|
@ -227,4 +246,11 @@ foreach ($pathProperty in @("requestBuilder", "advertisementPath")) {
|
|||
& (Join-Path $projectRoot "scripts\run-eveunity-scene-capture-contract-smoke.ps1")
|
||||
& (Join-Path $projectRoot "scripts\run-eveunity-scene-capture-smoke.ps1")
|
||||
|
||||
if ($RunUnityEditMode) {
|
||||
& (Join-Path $projectRoot "scripts\run-aetheria-unity-scene-editmode-tests.ps1")
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Aetheria Unity scene EditMode smoke failed with exit code $LASTEXITCODE"
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "EveUnity scene lifecycle smoke passed: $absoluteManifestPath"
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ $manifest = Get-Content -LiteralPath $absoluteManifestPath -Raw | ConvertFrom-Js
|
|||
if ($manifest.runtimeId -ne "unity-scene") {
|
||||
throw "Unexpected EveUnity scene runtime id: $($manifest.runtimeId)"
|
||||
}
|
||||
if ($manifest.lifecycle.test.status -ne "provider-shell-contract-skeleton") {
|
||||
if ($manifest.lifecycle.test.status -ne "unity-scene-editmode-batchmode") {
|
||||
throw "Unexpected EveUnity scene provider shell status: $($manifest.lifecycle.test.status)"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -236,10 +236,10 @@ node $consumerScript $consumerExport `
|
|||
--expect-runtime-lifecycle-field "unity-uitoolkit:capture:captureContract.additionalProviderSurfaces.1.providerId:aetheria" `
|
||||
--expect-runtime-lifecycle-field "unity-uitoolkit:capture:captureContract.additionalProviderSurfaces.1.surfaceId:aetheria.daemon.editor" `
|
||||
--expect-runtime-lifecycle-status unity-scene:release:unity-scene-upm-artifact-smoke `
|
||||
--expect-runtime-lifecycle-status unity-scene:test:provider-shell-contract-skeleton `
|
||||
--expect-runtime-lifecycle-status unity-scene:test:unity-scene-editmode-batchmode `
|
||||
--expect-runtime-lifecycle-status unity-scene:capture:pending-unity-scene-capture `
|
||||
--expect-runtime-lifecycle-pending "unity-scene:release:Unity scene package release" `
|
||||
--expect-runtime-lifecycle-pending "unity-scene:test:Unity scene provider-advertisement smoke" `
|
||||
--expect-runtime-lifecycle-pending "unity-scene:test:Unity scene EditMode runner" `
|
||||
--expect-runtime-lifecycle-pending "unity-scene:capture:Unity scene screenshot or frame-capture PNG artifact" `
|
||||
--expect-runtime-lifecycle-field "unity-scene:release:releaseContract.packageName:org.gamecult.eve.unity-scene" `
|
||||
--expect-runtime-lifecycle-field "unity-scene:release:releaseContract.artifactKind:upm-package" `
|
||||
|
|
@ -252,8 +252,10 @@ node $consumerScript $consumerExport `
|
|||
--expect-runtime-lifecycle-field "unity-scene:release:releaseContract.requiredPackageDependencies.0.packageName:org.gamecult.eve.surface" `
|
||||
--expect-runtime-lifecycle-field "unity-scene:release:releaseContract.requiredPackageDependencies.0.ownerRepo:Eve" `
|
||||
--expect-runtime-lifecycle-field "unity-scene:release:releaseContract.requiredPackageDependencies.0.packageManager:upm" `
|
||||
--expect-runtime-lifecycle-field "unity-scene:test:testContract.runnerKind:unity-scene-provider-shell-smoke" `
|
||||
--expect-runtime-lifecycle-field "unity-scene:test:testContract.runnerScript:scripts/run-eveunity-scene-provider-shell-smoke.ps1" `
|
||||
--expect-runtime-lifecycle-field "unity-scene:test:testContract.runnerKind:unity-editmode-batchmode" `
|
||||
--expect-runtime-lifecycle-field "unity-scene:test:testContract.runnerScript:scripts/run-aetheria-unity-scene-editmode-tests.ps1" `
|
||||
--expect-runtime-lifecycle-field "unity-scene:test:testContract.testPlatform:EditMode" `
|
||||
--expect-runtime-lifecycle-field "unity-scene:test:testContract.testAssembly:GameCult.Eve.UnityScene.Tests" `
|
||||
--expect-runtime-lifecycle-field "unity-scene:capture:captureContract.captureKind:unity-scene-frame-png" `
|
||||
--expect-runtime-lifecycle-field "unity-scene:capture:captureContract.targetId:unity-scene" `
|
||||
--expect-runtime-lifecycle-field "unity-scene:capture:captureContract.requestSchema:gamecult.eve.runtime_capture_request.v1" `
|
||||
|
|
|
|||
Loading…
Reference in a new issue