Refine world setup copy and validation fixtures

This commit is contained in:
Alexander Sellite 2026-08-20 22:38:37 -04:00
parent 3d34ed0bee
commit 4731bfae61
4 changed files with 63 additions and 9 deletions

View file

@ -145,7 +145,10 @@ wait_for_network_host() {
sleep 2
return 0
fi
for _attempt in {1..100}; do
# A cold generated-world startup can take longer than ten seconds before
# NetworkSession is ready to bind. Keep the client launch tied to the actual
# listener instead of treating that normal startup work as a host failure.
for _attempt in {1..600}; do
if ! kill -0 "${host_pid}" 2>/dev/null; then
return 1
fi
@ -231,7 +234,7 @@ run_session_switch_network_test() {
--headless --path "${PROJECT_ROOT}" --script "${script}" -- second_host \
>"${second_root}/output.log" 2>&1 &
second_pid=$!
for _attempt in {1..100}; do
for _attempt in {1..600}; do
if ! kill -0 "${first_pid}" 2>/dev/null \
|| ! kill -0 "${second_pid}" 2>/dev/null; then
break

View file

@ -353,6 +353,8 @@ func _validate_data_settings_navigation() -> void:
"Open Data Folder left a controller-activatable dialog behind.",
)
var change_data_folder := panel.get_node("%ChangeDataFolder") as Button
var export_progression := panel.get_node("%ExportProgression") as Button
var import_progression := panel.get_node("%ImportProgression") as Button
var copy_fingerprint := panel.get_node("%CopyPlayerFingerprint") as Button
var export_player := panel.get_node("%ExportPlayerIdentity") as Button
var import_player := panel.get_node("%ImportPlayerIdentity") as Button
@ -362,6 +364,8 @@ func _validate_data_settings_navigation() -> void:
data_tab,
open_data_folder,
change_data_folder,
export_progression,
import_progression,
copy_fingerprint,
export_player,
import_player,
@ -385,7 +389,7 @@ func _validate_data_settings_navigation() -> void:
_assert_neighbor(
open_data_folder,
&"focus_neighbor_bottom",
copy_fingerprint,
export_progression,
)
_assert_neighbor(
change_data_folder,
@ -395,12 +399,42 @@ func _validate_data_settings_navigation() -> void:
_assert_neighbor(
change_data_folder,
&"focus_neighbor_bottom",
import_progression,
)
_assert_neighbor(
export_progression,
&"focus_neighbor_top",
open_data_folder,
)
_assert_neighbor(
export_progression,
&"focus_neighbor_right",
import_progression,
)
_assert_neighbor(
export_progression,
&"focus_neighbor_bottom",
copy_fingerprint,
)
_assert_neighbor(
import_progression,
&"focus_neighbor_top",
change_data_folder,
)
_assert_neighbor(
import_progression,
&"focus_neighbor_left",
export_progression,
)
_assert_neighbor(
import_progression,
&"focus_neighbor_bottom",
copy_fingerprint,
)
_assert_neighbor(
copy_fingerprint,
&"focus_neighbor_top",
open_data_folder,
export_progression,
)
_assert_neighbor(
copy_fingerprint,

View file

@ -2,6 +2,7 @@ extends SceneTree
const MainScene = preload("res://main/main.tscn")
const FishingSpotType = preload("res://fishing/fishing_spot.gd")
const TEST_SEED: int = 864209
func _initialize() -> void:
@ -22,9 +23,23 @@ func _run() -> void:
func _run_host() -> void:
var main: Node = await _create_initialized_main()
assert(bool(main.call(
"_apply_world",
WorldLayout.STARTER_ISLAND,
TEST_SEED,
true,
)))
assert(bool(main.call(
"_prepare_host_world",
WorldLayout.STARTER_ISLAND,
TEST_SEED,
)))
assert(bool(main.call("_prepare_private_host")))
var save_manager := main.get("_save_manager") as PlayerSaveManager
assert(save_manager.initialize_new_game())
assert(save_manager.initialize_new_game(
TEST_SEED,
WorldLayout.STARTER_ISLAND,
))
main.call("_enter_gameplay")
var session := main.get_node("%NetworkSession") as NetworkSession
assert(session.set_host_open(true))
@ -217,7 +232,9 @@ func _run_client() -> void:
int(player.get("_fishing_visual_phase"))
== Player.FishingVisualPhase.CASTING
)
for _frame: int in 30:
# Keep the transient pull-back pose visible long enough for the separate host
# process to observe it even when a cold validation run is CPU-bound.
for _frame: int in 120:
await physics_frame
player.set_fishing_visual(false)
player.call("_set_sitting", true, true)

View file

@ -187,10 +187,10 @@ func _refresh_presentation() -> void:
_generated_button.set_pressed_no_signal(generated)
_starter_button.set_pressed_no_signal(not generated)
_world_description.text = (
"build a new island from terrain chunks. the same seed always "
+ "builds the same world."
"build a new island from terrain chunks.\n"
+ "the same seed always builds the same world."
if generated
else "play on the authored starter island."
else "play on the starter island."
)
_seed_section.visible = generated
_random_seed_button.set_pressed_no_signal(