fix(tools): make the e2e chain actually run after the move, and record what it found

The e2e asset check now completes: PASS on all six steps - empty maps 9 s, demo build 10 s, review build 9 s,
captures 80 s, judge 388 s, review file. Four breakages from the folder move had to be fixed first:

- ue_placement and ue_common are siblings of the scripts that import them, but the rewrite put only the tools
  root on sys.path, so every Unreal commandlet died with ModuleNotFoundError. Both paths are inserted now.
- render_screenshots.sh resolved the repository root one level up, so commandlet paths became Tools/Tools/...
  and the capture step failed in 0 s.
- the driver treated a result file left by an earlier run as success, which is how a ten-second 'demo build'
  passed without building. Result files are unlinked before each step and child output streams to a per-step
  log file rather than a pipe.
- two editors on one project hang instead of failing, so the driver refuses to start while one is running.

Also corrects ue_recreate_maps.py: LevelEditorSubsystem.new_level() refuses a path whose package is still in
memory and delete_asset() leaves the file on disk, measured create->delete->create returning False. The step
now loads each map, destroys every actor, saves, and reports the count it left (0), which is the property the
builders actually need.

Open question recorded in TODO.md: the rebuilt map holds 409 actors and 613 KB against 600 and 886 KB before,
and the ~190 missing ones look like the facade-kit and theatre-trim placements that run as separate steps.
This commit is contained in:
zwitschi committed 2026-11-10 13:37:21 +01:00
1 parent 24f1e682fe
commit dbb42322ff
136 files changed
+279 -199

No files matched your search

+33 -9
View File
@@ -39,18 +39,34 @@ REPORT = "/tmp/gigline/e2e-report.txt"
def run(step, cmd, env=None, timeout=None, result_file=None, expect=None):
"""Run one step and record it. A step fails on a non-zero exit or a missing marker."""
"""Run one step and record it. A step fails on a non-zero exit or a missing marker.
The child's output streams to its own file under /tmp/gigline/e2e/, not into a pipe: a captured pipe
hides progress for a fifteen-minute Unreal build and deadlocks if the engine spawns something that
outlives it.
"""
started = time.time()
print(f"== {step}")
try:
proc = subprocess.run(cmd, cwd=ROOT, env={**os.environ, **(env or {})},
capture_output=True, text=True, timeout=timeout)
except subprocess.TimeoutExpired:
return step, False, f"timed out after {timeout}s"
print(f"== {step}", flush=True)
# A result file left by an earlier run would make this step look successful without doing anything.
if result_file and os.path.exists(result_file):
os.remove(result_file)
safe = step.replace("/", "-").replace(" ", "_")
os.makedirs("/tmp/gigline/e2e", exist_ok=True)
log_path = f"/tmp/gigline/e2e/{safe}.log"
with open(log_path, "w") as out:
try:
proc = subprocess.run(cmd, cwd=ROOT, env={**os.environ, **(env or {})},
stdout=out, stderr=subprocess.STDOUT, timeout=timeout)
except subprocess.TimeoutExpired:
return step, False, f"timed out after {timeout}s (log {log_path})"
elapsed = time.time() - started
if proc.returncode != 0:
tail = (proc.stderr or proc.stdout or "").strip().splitlines()[-3:]
return step, False, f"exit {proc.returncode} ({elapsed:.0f}s): {' / '.join(tail)}"
tail = ""
try:
tail = " / ".join(open(log_path, errors="replace").read().strip().splitlines()[-3:])
except OSError:
pass
return step, False, f"exit {proc.returncode} ({elapsed:.0f}s): {tail}"
if result_file and expect:
if not os.path.exists(result_file):
return step, False, f"no result file {result_file}"
@@ -74,6 +90,14 @@ def main():
help="keep the existing maps (the builders still clear their levels)")
args = parser.parse_args()
# A second editor fighting the first is what makes an Unreal commandlet hang instead of fail.
import shutil
if shutil.which("pgrep"):
others = subprocess.run(["pgrep", "-f", "UnrealEditor-Cmd"], capture_output=True, text=True)
if others.returncode == 0 and others.stdout.strip():
sys.exit("error: an UnrealEditor process is already running; close it before the check "
"(two editors on one project hang, they do not fail)")
steps = []
if not args.skip_blender:
steps.append(run("1/6 blender renders",
+2 -1
View File
@@ -14,7 +14,8 @@
# what the build rendered.
set -euo pipefail
REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# This script lives in Tools/review, so the repository root is two levels up.
REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
ENGINE="${UE_ENGINE_DIR:-/run/media/system/DATA/Engines/UE_5.8.4}"
PROJ="$REPO/Game/GigLine/GigLine.uproject"
VERIFY="no"