Say whether undo, redo and project code left the scene unsaved - #1088
Merged
Merged
Conversation
With a GODOT_BIN that cannot be started, runtime_launch answered success: false and exit_code 0, the shape of a game that ran and failed, and said to put godot on PATH whatever GODOT_BIN named. The other tools that start their own Godot answer 503 engine_unavailable since #1045. The test runner now records a spawn Windows refused, and the handler refuses that, or a POSIX child that exits 127, the same way.
scene_create, scene_pack_branch and viewport_create_test_lab with overwrite: true rebuild a tab that holds the scene they replace, whatever it holds, and the answer said only editor_scene_reloaded: true. An edit someone had open in that tab was thrown away with nothing naming it. The bridge reads the unsaved list before the rebuild, and the answer now carries editor_scene_discarded_unsaved: true or false on Godot 4.7, and null before it, where the engine cannot say.
On a runner with no Godot, runtime_launch now answers 503 engine_unavailable, and the engine identity test expected a success body with the engine fields. Nothing runs there, so the refusal is the answer; the test now checks it names the engine it tried.
editor_undo, editor_redo, scene_call_method and a delivered signal_emit said nothing about the saved state, so no save step followed them, and their follow-up entries were exempt under #1049. A history step can land back on the saved version as well as move off it, and project code can change anything. On Godot 4.7 their answers now read the edited scene against the unsaved list and carry scene_saved, which the existing rule turns into a save step when it is false. Before 4.7 they carry a limitation saying the engine cannot tell. The four move from exempt to leaves: ["save"].
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1049
Stacked on #1087, #1086. Their commits show here until they merge.
editor_undo,editor_redo,scene_call_methodand a deliveredsignal_emitsaid nothing about whether they left the edited scene unsaved, so no save step followed them. Their entries intests/follow_ups.jsonwere exempt under this issue. A history step can land back on the saved version as well as move off it, and project code can change anything, with or without an undo entry.A new bridge helper,
reportEditedSceneSaved, reads the edited scene againstEditorInterface.get_unsaved_scenesafter the call and setsscene_saved. The existing follow-up rule turnsscene_saved: falseinto a save step. Before Godot 4.7 the bind does not exist, so the answer carries noscene_savedand alimitationsaying the engine cannot tell. It runs after undo and redo, after a delivered emit, and afterscene_call_methodon both the direct path and a coroutine's completion. An emit that reached no listener ran nothing and says nothing new.The four move from exempt to
leaves: ["save"]with thescene_saved: falsefact.Tests: the harness's existing duplicate, save, undo, redo sequence (requests 2502 to 2506) now reads the answers. On 4.7.2 the undo past the save says
scene_saved: falsewith a save step, and the redo back onto it saystruewith none. On 4.5.1 and 4.6.2 both carry the limitation and noscene_saved. With the call removed from the undo path, a 4.7.2 run showed neither field, which those assertions catch.Checked locally: native suite (958), Python suite, docs validator, test inventory, and the live harness on 4.5.1, 4.6.2 and 4.7.2. CHANGELOG updated under Unreleased, Fixed.