Define EveUnity test runner contract
This commit is contained in:
parent
5b60023832
commit
a947062f7b
9 changed files with 189 additions and 3 deletions
|
|
@ -280,6 +280,15 @@ Exit criteria:
|
|||
|
||||
Recently cut:
|
||||
|
||||
- EveUnity test lifecycle now carries a structured Unity EditMode runner
|
||||
contract. `packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json`
|
||||
names the runner script, consumer Unity project, default Unity editor path,
|
||||
package name, test assembly, platform, result artifacts, and temporary
|
||||
`testables` manifest mutation. The lifecycle smoke validates the runner
|
||||
script and Aetheria project, parity compares the contract against the ledger,
|
||||
and the runtime-owner consumer smoke asserts exported test fields. This is
|
||||
Unity package consumption proof for CultLib-produced assemblies; CultLib
|
||||
remains the owner of the .NET/NuGet dependency story.
|
||||
- EveUnity release lifecycle now carries a structured UPM release contract.
|
||||
`packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json`
|
||||
names the package root, version source, tag pattern, artifact kind, and
|
||||
|
|
|
|||
|
|
@ -118,8 +118,9 @@ capture status, and missing evidence without reading Eve's local parity
|
|||
manifest. The runtime-owner consumer smoke asserts EveUnity lifecycle stage
|
||||
status and pending release/test/capture proofs from the exported runtime record,
|
||||
plus release contract fields such as package name, artifact kind, tag pattern,
|
||||
and package root, so split blockers stay machine-readable instead of hiding in
|
||||
handoff prose.
|
||||
and package root, plus Unity EditMode test runner contract fields such as
|
||||
runner script, package name, test assembly, and platform. Split blockers stay
|
||||
machine-readable instead of hiding in handoff prose.
|
||||
|
||||
After generating the parity report, `run-parity-harness.ps1` copies
|
||||
`artifacts/conformance/latest` into
|
||||
|
|
@ -233,6 +234,9 @@ 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.
|
||||
The exported runtime lifecycle records that runner contract so EveUnity can
|
||||
inherit the Unity-specific test proof without making Eve responsible for
|
||||
CultLib package distribution.
|
||||
|
||||
Unity runtime lifecycle evidence:
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,14 @@ The release stage also declares the UPM release contract:
|
|||
its version from `package.json`, and uses tag pattern
|
||||
`eveunity-uitoolkit-v{version}` once the tag is cut from EveUnity.
|
||||
|
||||
The test stage declares the Unity EditMode runner contract: the current runner
|
||||
is `scripts/run-aetheria-unity-editmode-tests.ps1`, runs
|
||||
`GameCult.Eve.UnityUIToolkit.Tests` on `EditMode`, writes XML and log artifacts
|
||||
under `artifacts/aetheria-unity-editmode/{stamp}`, and temporarily adds
|
||||
`org.gamecult.eve.unity-uitoolkit` to Aetheria's Unity `testables`. This is a
|
||||
Unity package consumption proof. CultLib still owns the .NET/NuGet dependency
|
||||
story for its assemblies.
|
||||
|
||||
Those lifecycle claims are validated by the parity harness. A missing evidence
|
||||
path is a runtime capability error, not a README footnote.
|
||||
|
||||
|
|
|
|||
|
|
@ -74,6 +74,19 @@
|
|||
"ownerRepo": "EveUnity",
|
||||
"status": "batchmode-editmode-tests-and-consumer-build-smoke",
|
||||
"command": "powershell -ExecutionPolicy Bypass -File .\\scripts\\run-aetheria-unity-editmode-tests.ps1",
|
||||
"testContract": {
|
||||
"ownerRepo": "EveUnity",
|
||||
"runnerKind": "unity-editmode-batchmode",
|
||||
"runnerScript": "scripts/run-aetheria-unity-editmode-tests.ps1",
|
||||
"consumerProject": "E:\\Projects\\Aetheria",
|
||||
"unityExeDefault": "C:\\Program Files\\Unity\\Hub\\Editor\\6000.4.2f1\\Editor\\Unity.exe",
|
||||
"packageName": "org.gamecult.eve.unity-uitoolkit",
|
||||
"testAssembly": "GameCult.Eve.UnityUIToolkit.Tests",
|
||||
"testPlatform": "EditMode",
|
||||
"resultsArtifact": "artifacts/aetheria-unity-editmode/{stamp}/unity-editmode-results.xml",
|
||||
"logArtifact": "artifacts/aetheria-unity-editmode/{stamp}/unity-editmode.log",
|
||||
"manifestMutation": "Temporarily adds org.gamecult.eve.unity-uitoolkit to Aetheria Packages/manifest.json testables and restores the manifest after the run."
|
||||
},
|
||||
"evidencePaths": [
|
||||
"packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef",
|
||||
"packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs",
|
||||
|
|
|
|||
|
|
@ -230,6 +230,69 @@
|
|||
"command": {
|
||||
"type": "string"
|
||||
},
|
||||
"testContract": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"ownerRepo",
|
||||
"runnerKind",
|
||||
"runnerScript",
|
||||
"consumerProject",
|
||||
"unityExeDefault",
|
||||
"packageName",
|
||||
"testAssembly",
|
||||
"testPlatform",
|
||||
"resultsArtifact",
|
||||
"logArtifact",
|
||||
"manifestMutation"
|
||||
],
|
||||
"properties": {
|
||||
"ownerRepo": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"runnerKind": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"runnerScript": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"consumerProject": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"unityExeDefault": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"packageName": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"testAssembly": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"testPlatform": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"resultsArtifact": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"logArtifact": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"manifestMutation": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
}
|
||||
},
|
||||
"additionalProperties": true
|
||||
},
|
||||
"evidencePaths": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -996,6 +996,19 @@
|
|||
"ownerRepo": "EveUnity",
|
||||
"status": "batchmode-editmode-tests-and-consumer-build-smoke",
|
||||
"command": "powershell -ExecutionPolicy Bypass -File .\\scripts\\run-aetheria-unity-editmode-tests.ps1",
|
||||
"testContract": {
|
||||
"ownerRepo": "EveUnity",
|
||||
"runnerKind": "unity-editmode-batchmode",
|
||||
"runnerScript": "scripts/run-aetheria-unity-editmode-tests.ps1",
|
||||
"consumerProject": "E:\\Projects\\Aetheria",
|
||||
"unityExeDefault": "C:\\Program Files\\Unity\\Hub\\Editor\\6000.4.2f1\\Editor\\Unity.exe",
|
||||
"packageName": "org.gamecult.eve.unity-uitoolkit",
|
||||
"testAssembly": "GameCult.Eve.UnityUIToolkit.Tests",
|
||||
"testPlatform": "EditMode",
|
||||
"resultsArtifact": "artifacts/aetheria-unity-editmode/{stamp}/unity-editmode-results.xml",
|
||||
"logArtifact": "artifacts/aetheria-unity-editmode/{stamp}/unity-editmode.log",
|
||||
"manifestMutation": "Temporarily adds org.gamecult.eve.unity-uitoolkit to Aetheria Packages/manifest.json testables and restores the manifest after the run."
|
||||
},
|
||||
"evidencePaths": [
|
||||
"packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef",
|
||||
"packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs",
|
||||
|
|
|
|||
|
|
@ -1139,6 +1139,7 @@ function compareRuntimeLifecycleClaims(expectedLifecycle, actualLifecycle, manif
|
|||
errors.push(...missingMembers(expected.evidencePaths || [], actual.evidencePaths || [], `${label}.evidencePaths`));
|
||||
errors.push(...missingMembers(expected.pendingProofs || [], actual.pendingProofs || [], `${label}.pendingProofs`));
|
||||
errors.push(...compareReleaseContract(expected.releaseContract, actual.releaseContract, `${label}.releaseContract`));
|
||||
errors.push(...compareTestContract(expected.testContract, actual.testContract, `${label}.testContract`));
|
||||
|
||||
for (const evidencePath of actual.evidencePaths || []) {
|
||||
if (!existsSync(path.join(repoRoot, evidencePath))) {
|
||||
|
|
@ -1149,6 +1150,36 @@ function compareRuntimeLifecycleClaims(expectedLifecycle, actualLifecycle, manif
|
|||
return errors;
|
||||
}
|
||||
|
||||
function compareTestContract(expected, actual, label) {
|
||||
const errors = [];
|
||||
if (!expected) return errors;
|
||||
if (!actual) return [`${label}:missing`];
|
||||
for (const key of [
|
||||
"ownerRepo",
|
||||
"runnerKind",
|
||||
"runnerScript",
|
||||
"consumerProject",
|
||||
"unityExeDefault",
|
||||
"packageName",
|
||||
"testAssembly",
|
||||
"testPlatform",
|
||||
"resultsArtifact",
|
||||
"logArtifact",
|
||||
"manifestMutation",
|
||||
]) {
|
||||
if ((expected[key] || "") !== (actual[key] || "")) {
|
||||
errors.push(`${label}.${key}:expected ${expected[key] || ""} got ${actual[key] || ""}`);
|
||||
}
|
||||
}
|
||||
if (actual.runnerScript && !existsSync(path.join(repoRoot, actual.runnerScript))) {
|
||||
errors.push(`${label}.runnerScript:${actual.runnerScript}:missing`);
|
||||
}
|
||||
if (actual.consumerProject && !existsSync(actual.consumerProject)) {
|
||||
errors.push(`${label}.consumerProject:${actual.consumerProject}:missing`);
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
|
||||
function compareReleaseContract(expected, actual, label) {
|
||||
const errors = [];
|
||||
if (!expected) return errors;
|
||||
|
|
|
|||
Loading…
Reference in a new issue