Preserve approved pixel tower prototype as development baseline
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
# PERF-MVP-001 acceptance harness
|
||||
|
||||
This standalone harness composes the real World, Path, Facility, Guest, Staff,
|
||||
Inventory, Logistics, Event, Economy, and performance-budget services through
|
||||
their public APIs.
|
||||
|
||||
The default command runs a smaller 24-hour smoke tier:
|
||||
|
||||
```sh
|
||||
godot --headless --path . --script res://tests/performance/test_perf_mvp_001.gd
|
||||
```
|
||||
|
||||
The opt-in command runs the exact PERF-MVP-001 fixture:
|
||||
|
||||
```sh
|
||||
PERF_MVP_FULL=1 godot --headless --path . --script res://tests/performance/test_perf_mvp_001.gd
|
||||
```
|
||||
|
||||
Exit status `0` means the selected tier passed, `1` means a validation or
|
||||
performance budget failed, and `2` means the requested fixture was incomplete.
|
||||
Every run prints a machine-readable `PERF_MVP_001_REPORT=<json>` line with exact
|
||||
fixture sizes, timings, backlog ages, validation results, and limitations.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
uid://b1s2fuc7d2x4i
|
||||
@@ -0,0 +1,76 @@
|
||||
extends SceneTree
|
||||
|
||||
const HarnessType = preload("res://tests/performance/perf_mvp_001_harness.gd")
|
||||
|
||||
|
||||
func _initialize() -> void:
|
||||
call_deferred("_run")
|
||||
|
||||
|
||||
func _run() -> void:
|
||||
var tier := &"full" if _full_tier_requested() else &"smoke"
|
||||
print("PERF-MVP-001: %s tier" % String(tier))
|
||||
var report: Dictionary = HarnessType.new().run(tier)
|
||||
_print_summary(report)
|
||||
print("PERF_MVP_001_REPORT=%s" % JSON.stringify(report))
|
||||
match String(report.get("status", "INCOMPLETE")):
|
||||
"PASS", "SMOKE_PASS":
|
||||
quit(0)
|
||||
"INCOMPLETE":
|
||||
quit(2)
|
||||
_:
|
||||
quit(1)
|
||||
|
||||
|
||||
func _full_tier_requested() -> bool:
|
||||
var environment_value := OS.get_environment("PERF_MVP_FULL").strip_edges().to_lower()
|
||||
if environment_value in ["1", "true", "yes", "full"]:
|
||||
return true
|
||||
for argument: String in OS.get_cmdline_user_args():
|
||||
if argument in ["--full", "full"]:
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
func _print_summary(report: Dictionary) -> void:
|
||||
var initial: Dictionary = report.get("actual_initial", {})
|
||||
var summary: Dictionary = report.get("check_summary", {})
|
||||
print(
|
||||
" status=%s cells=%d guests=%d staff=%d facilities=%d queue=%d logistics=%d events=%d"
|
||||
% [
|
||||
report.get("status", "INCOMPLETE"),
|
||||
int(initial.get("open_cells", 0)),
|
||||
int(initial.get("guests", 0)),
|
||||
int(initial.get("staff", 0)),
|
||||
int(initial.get("facilities", 0)),
|
||||
int(initial.get("queue_entries", 0)),
|
||||
int(initial.get("unfinished_logistics", 0)),
|
||||
int(initial.get("active_events", 0)),
|
||||
]
|
||||
)
|
||||
if report.has("simulation"):
|
||||
var simulation: Dictionary = report["simulation"]
|
||||
print(
|
||||
" simulated=%d/%d minutes runtime=%.3f ms"
|
||||
% [
|
||||
int(simulation.get("completed_minutes", 0)),
|
||||
int(simulation.get("requested_minutes", 0)),
|
||||
float(simulation.get("duration_ms", 0.0)),
|
||||
]
|
||||
)
|
||||
print(
|
||||
" checks=%d passed=%d failed=%d skipped=%d"
|
||||
% [
|
||||
int(summary.get("total", 0)),
|
||||
int(summary.get("passed", 0)),
|
||||
int(summary.get("failed", 0)),
|
||||
int(summary.get("skipped", 0)),
|
||||
]
|
||||
)
|
||||
for validation: Dictionary in report.get("validations", []):
|
||||
if validation.get("status", "FAIL") != "PASS":
|
||||
print(" %s: %s %s" % [validation["status"], validation["id"], validation["details"]])
|
||||
for unmet: Dictionary in report.get("unmet_fixture_fields", []):
|
||||
print(" INCOMPLETE fixture: %s target=%s actual=%s" % [unmet["field"], unmet["target"], unmet["actual"]])
|
||||
for error: Dictionary in report.get("runtime_errors", []):
|
||||
print(" ERROR %s: %s" % [error["code"], error["message"]])
|
||||
@@ -0,0 +1 @@
|
||||
uid://irdmv2oju0ts
|
||||
Reference in New Issue
Block a user