From 5a1acbd9ca0034854d8362fe2b50e8b41cebe908 Mon Sep 17 00:00:00 2001 From: Disco DeDisco Date: Mon, 25 May 2026 11:12:16 -0400 Subject: [PATCH] =?UTF-8?q?CI=20test-FTs-room=20#334=20fix=20=E2=80=94=20`?= =?UTF-8?q?=5Fseed=5Fearthman=5Fsig=5Fpile`=20missing=20`is=5Fpolarized=3D?= =?UTF-8?q?True`=20+=20`has=5Fcard=5Fimages=3DFalse`=20defaults=20(13=20er?= =?UTF-8?q?rors)=20+=20stale=20`id=5Fkit=5Ffiorentine=5Fdeck`=20selector?= =?UTF-8?q?=20=E2=86=92=20`id=5Fkit=5Ftarot=5Fdeck`=20(1=20error).=20CI=20?= =?UTF-8?q?pipeline=20#334=20test-FTs-room=20reported=201=20FAIL=20+=2013?= =?UTF-8?q?=20errors=20after=20retry=20on=20a=20clean=20local-green=20bran?= =?UTF-8?q?ch;=20user=20asked=20for=20diagnosis.=20Two=20unrelated=20root?= =?UTF-8?q?=20causes=20=E2=80=94=20both=20pure=20FT-helper=20/=20FT-select?= =?UTF-8?q?or=20bugs=20surfaced=20by=20today's=20earlier=20landings=20(150?= =?UTF-8?q?25b4=20my=5Fsea=20single-stack=20collapse=20+=20f107522=20RWS?= =?UTF-8?q?=20rename).=20No=20app=20code=20touched.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (1) **`_seed_earthman_sig_pile` helper missing two field defaults** — 13 errors + 1 FAIL across `MySeaCardDrawTest`. All 13 errors fail at `_draw_open_modal` line 716 looking for `.sea-deck-stack--levity`; the FAIL at `test_form_col_renders_decks_lock_hand_del_and_reversal_pct` asserts `len(stacks) == 2` and gets 1. Today's 15025b4 (A.7-polish my_sea single-stack collapse) added `{% if request.user.equipped_deck.is_polarized %}` branching to `my_sea.html:224`: polarized decks render `--gravity` + `--levity` stacks; non-polarized decks render a single `--single` stack. The `_seed_earthman_sig_pile()` helper at `functional_tests/sig_page.py` calls `DeckVariant.objects.get_or_create(slug="earthman", defaults={...})` w. only `name`, `card_count`, `is_default` in the defaults dict — `is_polarized` falls through to the model default of `False` (`epic/models.py:260`). Migration 0012 sets the field on the migration-seeded Earthman row via an explicit `.update(is_polarized=True, has_card_images=False, family="earthman")`, but `TransactionTestCase` flushes all tables on teardown (no `serialized_rollback` per [[feedback-transactiontestcase-flush]]) — once the first test method runs + tears down, the migration-seeded row is gone, and every subsequent test's setUp re-creates Earthman via the helper's incomplete defaults → `is_polarized=False` → my_sea picker renders single-stack → FT selector miss. Why local passed: `MySeaCardDrawTest` is class #5 of 6 in test_game_my_sea.py (setUps at lines 49, 208, 381, 474, 691, 1146); local runs typically scope to a single class or method (per [[feedback-ft-run-discipline]]), so the FIRST setUp finds the migration-seeded Earthman row still intact w. `is_polarized=True` and `get_or_create` returns it as-is. In CI's 152-test FT-room batch, four prior classes each truncate `epic_deckvariant` before class #5 runs, so the helper's defaults are all that's left. Fix: add `is_polarized=True, has_card_images=False` to the helper's defaults dict, mirroring migration 0012's explicit `.update()`. `family` stays implicit since the model default of `EARTHMAN` (`"earthman"`) already matches. Note: the parallel `_equip_earthman` helper in `test_game_room_deck_contrib.py:31-40` carries the same incomplete defaults but its tests don't depend on `is_polarized` — left untouched to avoid scope creep; would tighten consistency in a follow-up if the same trap bites again (2) **Stale `#id_kit_fiorentine_deck` selector** — 1 error at `DeckInUseGameKitTest.test_non_contributing_deck_has_normal_don_doff`. f107522 (A.0 image-rendering schema + RWS rename) renamed the existing `fiorentine-minchiate` DeckVariant slug to `tarot-rider-waite-smith` (audit revealed the deck was actually 78-card RWS Tarot, not 97-card Minchiate). The kit panel template at `_applet-game-kit.html:87` derives the element id from `deck.short_key` (`epic/models.py:291`, first dash-separated word of slug) — so `tarot-rider-waite-smith` produces id `id_kit_tarot_deck`, not the old `id_kit_fiorentine_deck`. f107522's rename pass updated `test_game_room_deck_contrib.py`'s click target on line 194 (`#id_kit_tarot_deck`) but missed the immediately-following assertion's `wait_for` selector on line 198, leaving a mixed-slug FT that clicks the new id but waits for the old. Pure FT-selector swap Tests: not run locally per [[feedback-ft-run-discipline]] — both fixes are FT-only (helper defaults + selector string); CI verification on next push will confirm the 14 reds go green. Files: `functional_tests/sig_page.py` (+1, -1) + `functional_tests/test_game_room_deck_contrib.py` (+1, -1) Co-Authored-By: Claude Opus 4.7 (1M context) --- src/functional_tests/sig_page.py | 3 ++- src/functional_tests/test_game_room_deck_contrib.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/functional_tests/sig_page.py b/src/functional_tests/sig_page.py index 61dd177..3374536 100644 --- a/src/functional_tests/sig_page.py +++ b/src/functional_tests/sig_page.py @@ -37,7 +37,8 @@ def _seed_earthman_sig_pile(): separately or extend this helper w. a flag.""" earthman, _ = DeckVariant.objects.get_or_create( slug="earthman", - defaults={"name": "Earthman", "card_count": 106, "is_default": True}, + defaults={"name": "Earthman", "card_count": 106, "is_default": True, + "is_polarized": True, "has_card_images": False}, ) _NAME = {11: "Maid", 12: "Jack", 13: "Queen", 14: "King"} for suit in ("BRANDS", "CROWNS", "BLADES", "GRAILS"): diff --git a/src/functional_tests/test_game_room_deck_contrib.py b/src/functional_tests/test_game_room_deck_contrib.py index e36810e..3a6e94c 100644 --- a/src/functional_tests/test_game_room_deck_contrib.py +++ b/src/functional_tests/test_game_room_deck_contrib.py @@ -195,7 +195,7 @@ class DeckInUseGameKitTest(FunctionalTest): ).click() don_btn = self.wait_for( lambda: self.browser.find_element( - By.CSS_SELECTOR, "#id_kit_fiorentine_deck .btn-equip" + By.CSS_SELECTOR, "#id_kit_tarot_deck .btn-equip" ) ) self.assertNotIn("btn-disabled", don_btn.get_attribute("class"))