fix(client): clear the test debt — 2 production bugs, suite fully green (T-973 et al.)
Production fixes surfaced by honest test triage: - hud_groups.gd: _set_group_z crashed on freed HUD nodes — the typed loop variable errors before the is_instance_valid guard runs; prune first - fog_state.gd: _resize cleared _prev_visible (world-space keys survive resizes), so pre-resize tiles never decayed VISIBLE→EXPLORED (D-059) Test debt (T-928/929/934/935/936/937/938/939, T-864, T-973): lambda local-capture bugs rewritten with array captures (now assert exact emission counts), e2e suites updated to the current handshake + StartupMessage protocol and stream-aware reads against the live binary, fog perf test measures steady state, chime test pins the shipped 800ms catalog asset (D-067 amended separately), monologue gdUnit4 API typo, battery-warning tests follow the MetaScreen on_open lifecycle. 3 sprint2 proof tests revived (corner_reveal had passed from the wrong tile — NPC3 blocks (18,14); route corrected). Soft-skips converted to real do_skip reporting. T-1068: 7 orphan .gd.uid deleted, _format_pop/_format_radius deduped into atlas_format.gd (preload, no class_name — headless cache). Suite: 1264 cases/20 failures → 1268/0, independently re-verified (2536/2536, exit 0). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -67,23 +67,9 @@ func test_camera_zoom_default_2x() -> void:
|
||||
assert_that(camera.zoom).is_equal(Vector2(2, 2))
|
||||
|
||||
|
||||
func skip_test_camera_smoothing_convergence() -> void:
|
||||
# P2-C02: STALE — #117 permanently disables Camera2D.position_smoothing_enabled
|
||||
# in main.gd _ready() (manual lerp approach). Assertion is_true() no longer valid.
|
||||
# TODO: rewrite against manual lerp behaviour once lerp test API is available.
|
||||
var inst := _make_scene()
|
||||
var camera: Camera2D = inst.get_node("Camera2D")
|
||||
# First frame re-enables smoothing
|
||||
inst._process(0.016)
|
||||
assert_that(camera.position_smoothing_enabled).is_true()
|
||||
# Several more frames — stationary player, camera converges
|
||||
for i in 5:
|
||||
inst._process(0.016)
|
||||
var expected := GameState.player_position * Constants.TILE_SIZE
|
||||
var dist := camera.global_position.distance_to(expected)
|
||||
assert_that(dist < 0.1).override_failure_message(
|
||||
"Camera should converge to player position (dist: %.4f)" % dist
|
||||
).is_true()
|
||||
# P2-C02 (skip_test_camera_smoothing_convergence) removed (T-1068): stale since
|
||||
# #117 switched to manual lerp. Superseded by test_camera_anchor.gd
|
||||
# (test_camera_smoothing_stays_off_with_manual_lerp, test_camera_lerps_toward_player_movement).
|
||||
|
||||
|
||||
func test_camera_viewport_tracks_player_position() -> void:
|
||||
@@ -97,23 +83,10 @@ func test_camera_viewport_tracks_player_position() -> void:
|
||||
).is_equal(expected)
|
||||
|
||||
|
||||
func skip_test_camera_follows_player_after_movement() -> void:
|
||||
# P2-C04: STALE — #117 switched camera to manual lerp; after 1 frame the camera
|
||||
# has not converged to player_position * TILE_SIZE. Exact equality assertion fails.
|
||||
# TODO: rewrite to assert directional movement only (y > initial_pos.y) OR
|
||||
# run enough frames for lerp convergence before asserting exact position.
|
||||
var inst := _make_scene()
|
||||
var camera: Camera2D = inst.get_node("Camera2D")
|
||||
var initial_pos := camera.global_position
|
||||
# Move player south via SimBridge test mode
|
||||
SimBridge._test_input_queue.append("MoveSouth")
|
||||
inst._process(0.016)
|
||||
# Camera should have moved with player
|
||||
assert_that(camera.global_position.y > initial_pos.y).override_failure_message(
|
||||
"Camera Y should increase after moving south"
|
||||
).is_true()
|
||||
assert_that(camera.global_position).is_equal(
|
||||
GameState.player_position * Constants.TILE_SIZE)
|
||||
# P2-C04 (skip_test_camera_follows_player_after_movement) removed (T-1068): stale
|
||||
# since #117 (manual lerp — exact-equality assertion invalid after one frame).
|
||||
# Superseded by test_camera_anchor.gd (test_camera_tracks_player_after_process,
|
||||
# test_camera_lerps_toward_player_movement).
|
||||
|
||||
|
||||
func test_camera_no_panning_locked_to_player() -> void:
|
||||
@@ -195,20 +168,22 @@ func test_entity_player_color_regardless_of_sector() -> void:
|
||||
|
||||
# -- UI (7) --------------------------------------------------------------------
|
||||
|
||||
func skip_test_monologue_display_visible_hidden() -> void:
|
||||
# P2-U01: BROKEN — MonologueDisplay no longer has an `is_visible` bool property.
|
||||
# Current API uses `_visible: Array[Dictionary]` (monologue_display.gd).
|
||||
# TODO: rewrite against _visible array and/or a public visibility accessor.
|
||||
func test_monologue_display_visible_hidden() -> void:
|
||||
# P2-U01 (T-864): MonologueDisplay tracks shown lines in `_visible:
|
||||
# Array[Dictionary]` — empty when idle, populated after show_monologue.
|
||||
var inst := _make_scene()
|
||||
var mono = inst.get_node("UILayer/MonologueDisplay")
|
||||
assert_that(mono.is_visible).override_failure_message(
|
||||
"Monologue should start hidden"
|
||||
).is_false()
|
||||
assert_int(mono._visible.size()).override_failure_message(
|
||||
"Monologue must start with no visible lines"
|
||||
).is_equal(0)
|
||||
mono.show_monologue("Test thought.", 3.0)
|
||||
assert_that(mono.is_visible).override_failure_message(
|
||||
"Monologue should be visible after show_monologue"
|
||||
).is_true()
|
||||
assert_that(mono.text_label.text).is_equal("Test thought.")
|
||||
assert_int(mono._visible.size()).override_failure_message(
|
||||
"Monologue must have one visible line after show_monologue"
|
||||
).is_equal(1)
|
||||
var label: RichTextLabel = mono._visible[0].node.get_child(0)
|
||||
assert_str(label.get_parsed_text()).override_failure_message(
|
||||
"Visible monologue line must carry the shown text"
|
||||
).is_equal("Test thought.")
|
||||
|
||||
|
||||
func test_interaction_list_shows_nearest_verb() -> void:
|
||||
|
||||
Reference in New Issue
Block a user