mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-10 16:04:04 +00:00
test(multiplayer): recover from native Godot crashes
This commit is contained in:
@@ -14,6 +14,11 @@ class LocalMultiplayerGateTest(unittest.TestCase):
|
||||
self.assertIn("type=bind,src=$root_dir,dst=/workspace", script)
|
||||
self.assertIn("Godot executable not found", script)
|
||||
|
||||
def test_native_engine_crash_falls_back_but_test_failure_does_not(self):
|
||||
script = (ROOT / "scripts" / "verify_multiplayer_local.sh").read_text()
|
||||
self.assertIn('if [[ "$native_status" -lt 128 ]]', script)
|
||||
self.assertIn("native Godot crashed", script)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
@@ -7,8 +7,20 @@ godot_image="barichello/godot-ci@sha256:622e5ca81b54cd8038ecf7de5d157b47efc800d7
|
||||
|
||||
run_godot_harness() {
|
||||
if [[ -x "$godot_bin" ]]; then
|
||||
set +e
|
||||
"$godot_bin" --headless --path "$root_dir/Game" res://tests/test_runner.tscn
|
||||
return
|
||||
local native_status=$?
|
||||
set -e
|
||||
if [[ "$native_status" -eq 0 ]]; then
|
||||
return
|
||||
fi
|
||||
# A failing test exits 1 and must fail the gate. A signal exit (as seen
|
||||
# with the host Metal/Vulkan stack) is an engine-host failure, so rerun
|
||||
# the identical pinned Linux harness instead of losing all verification.
|
||||
if [[ "$native_status" -lt 128 ]]; then
|
||||
return "$native_status"
|
||||
fi
|
||||
echo "local multiplayer gate: native Godot crashed (status $native_status); using pinned headless fallback" >&2
|
||||
fi
|
||||
if ! command -v docker >/dev/null 2>&1 || ! docker info >/dev/null 2>&1; then
|
||||
echo "local multiplayer gate: Godot executable not found ($godot_bin), and Docker is unavailable for the pinned headless fallback" >&2
|
||||
|
||||
Reference in New Issue
Block a user