Skip to content

Commit ddf3ca4

Browse files
committed
test: update test runs with sort_id field
1 parent 4b2bd94 commit ddf3ca4

File tree

3 files changed

+52
-49
lines changed

3 files changed

+52
-49
lines changed

tests/lua/test_runs.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,22 @@ def test_replay_run(self, tcp_client: socket.socket, jsonl_file: Path) -> None:
6161
next_step = steps[step_num + 1]
6262
expected_game_state = next_step["game_state"]
6363

64-
# HACK: Remove highlighted field from cards before comparison
64+
# HACK: Remove non-deterministic fields from cards before comparison
6565
# The logger hook, log the game state after the card selection,
6666
# so in the replay we have the highlighted cards, while the game_state
6767
# before the action has the non-highlighted cards.
68+
# sort_id is also non-deterministic and changes between runs.
6869
if "hand" in actual_game_state and "cards" in actual_game_state["hand"]:
6970
for card in actual_game_state["hand"]["cards"]:
7071
card.pop("highlighted", None)
72+
card.pop("sort_id", None)
7173
if (
7274
"hand" in expected_game_state
7375
and "cards" in expected_game_state["hand"]
7476
):
7577
for card in expected_game_state["hand"]["cards"]:
7678
card.pop("highlighted", None)
79+
card.pop("sort_id", None)
7780

7881
# Assert game state equality
7982
assert actual_game_state == expected_game_state, (

0 commit comments

Comments
 (0)