Repository navigation
test: stop the Orkney and Broxbourne tests failing on the calendar and the network - #2341
Conversation
…work The nightly unit-test job has failed since 12 Nov. The Orkney fixture used hardcoded collection dates (21 Oct, 28 Oct, 11 Nov), and the scraper drops dates in the past, so once 11 Nov passed parse_data returned no bins and test_area_or_street_text_is_searched_and_first_address_looked_up failed. It only surfaced now because the unit-test job used to ignore failures. The fixture dates are now relative to today. Reproduced with the clock frozen at 2026-11-12 (old test fails, new passes), and the new test also passes at 2027-03-01. The Broxbourne error tests called api.postcodes.io through check_postcode (a pure parsing test depending on a third-party API being up), so they are stubbed offline, as was done for Tower Hamlets. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015MaCS29izthZp2dwtvLwf4
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2341 +/- ##
=======================================
Coverage 83.57% 83.57%
=======================================
Files 43 43
Lines 3380 3380
=======================================
Hits 2825 2825
Misses 555 555 ☔ View full report in Codecov by Harness. |
Why
The nightly Run Unit Tests job has failed on 12, 13 and 14 Nov (it was green until 11 Nov), and every open PR's unit-test check will now be red as well.
The cause is in a test I added in #2275, not in the product code.
test_orkney_islands_council.pyused hardcoded collection dates (21 Oct, 28 Oct, 11 Nov), andOrkneyIslandsCouncilcorrectly drops dates in the past. Once 11 Nov had passed,parse_datareturned no bins andtest_area_or_street_text_is_searched_and_first_address_looked_upfailed (assert []).It only surfaced now because the unit-test job used to ignore failures (fixed in #2273), so this is the gate doing its job, just 4 weeks after I wrote a time bomb into it.
Changes
api.postcodes.iothroughcheck_postcode, so a pure parsing test depended on a third-party API being up. They now stub it, as was done for Tower Hamlets in ci/test: restore coverage above 80%, stop hiding unit-test failures, 4-session Selenium grid #2273.No product code changes.
Test plan
1 failed, 3 passed), matching the nightly.make unit-testson Python 3.14.10 with Home Assistant installed: 499 passed. The 3 failures are the known sandbox-only tests that need real network access (test_check_postcode_valid/_invalid,test_create_webdriver_local), which pass in CI.Merge with a
test:title. It isn't a releasable commit type, so the bump workflow will skip cleanly.Generated by Claude Code
Summary by CodeRabbit