Define EveUnity test runner contract

This commit is contained in:
Meta Vens 2026-07-09 02:19:55 +01:00
commit a947062f7b
9 changed files with 189 additions and 3 deletions

View file

@ -118,6 +118,46 @@ if ($packageManifest.name -ne $releaseContract.packageName) {
throw "EveUnity release contract package name does not match package manifest: $($releaseContract.packageName) vs $($packageManifest.name)"
}
$testContract = $manifest.lifecycle.test.testContract
if ($null -eq $testContract) {
throw "EveUnity test lifecycle missing testContract"
}
if ($testContract.ownerRepo -ne "EveUnity") {
throw "EveUnity test contract has unexpected owner: $($testContract.ownerRepo)"
}
if ($testContract.runnerKind -ne "unity-editmode-batchmode") {
throw "EveUnity test contract has unexpected runner kind: $($testContract.runnerKind)"
}
if ($testContract.packageName -ne "org.gamecult.eve.unity-uitoolkit") {
throw "EveUnity test contract has unexpected package name: $($testContract.packageName)"
}
if ($testContract.testAssembly -ne "GameCult.Eve.UnityUIToolkit.Tests") {
throw "EveUnity test contract has unexpected test assembly: $($testContract.testAssembly)"
}
if ($testContract.testPlatform -ne "EditMode") {
throw "EveUnity test contract has unexpected test platform: $($testContract.testPlatform)"
}
foreach ($pathProperty in @("runnerScript", "consumerProject")) {
$candidate = $testContract.$pathProperty
if (-not $candidate) {
throw "EveUnity test contract missing $pathProperty"
}
$absolutePath = if ([System.IO.Path]::IsPathRooted($candidate)) {
$candidate
} else {
Join-Path $projectRoot $candidate
}
if (-not (Test-Path -LiteralPath $absolutePath)) {
throw "EveUnity test contract $pathProperty does not exist: $candidate"
}
}
$runnerSource = Get-Content -LiteralPath (Join-Path $projectRoot $testContract.runnerScript) -Raw
foreach ($expectedText in @($testContract.packageName, $testContract.testAssembly, $testContract.testPlatform, "testables", "Restore-Manifest")) {
if (-not $runnerSource.Contains($expectedText)) {
throw "EveUnity test contract runner script missing expected text: $expectedText"
}
}
& (Join-Path $projectRoot "scripts\run-aetheria-unity-package-smoke.ps1")
if ($LASTEXITCODE -ne 0) {
throw "Aetheria Unity package smoke failed with exit code $LASTEXITCODE"

View file

@ -67,7 +67,12 @@ node $consumerScript $consumerExport `
--expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.packageName:org.gamecult.eve.unity-uitoolkit" `
--expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.artifactKind:upm-package" `
--expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.tagPattern:eveunity-uitoolkit-v{version}" `
--expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.packageRoot:packages/org.gamecult.eve.unity-uitoolkit"
--expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.packageRoot:packages/org.gamecult.eve.unity-uitoolkit" `
--expect-runtime-lifecycle-field "unity-uitoolkit:test:testContract.runnerKind:unity-editmode-batchmode" `
--expect-runtime-lifecycle-field "unity-uitoolkit:test:testContract.runnerScript:scripts/run-aetheria-unity-editmode-tests.ps1" `
--expect-runtime-lifecycle-field "unity-uitoolkit:test:testContract.packageName:org.gamecult.eve.unity-uitoolkit" `
--expect-runtime-lifecycle-field "unity-uitoolkit:test:testContract.testAssembly:GameCult.Eve.UnityUIToolkit.Tests" `
--expect-runtime-lifecycle-field "unity-uitoolkit:test:testContract.testPlatform:EditMode"
if ($LASTEXITCODE -ne 0) {
throw "Runtime owner conformance consumer smoke failed with exit code $LASTEXITCODE"