Skip to content

test: refresh two stale expectations against current production behavior#10

Open
nikrich wants to merge 1 commit into
mainfrom
fix/stale-test-expectations
Open

test: refresh two stale expectations against current production behavior#10
nikrich wants to merge 1 commit into
mainfrom
fix/stale-test-expectations

Conversation

@nikrich
Copy link
Copy Markdown
Owner

@nikrich nikrich commented May 18, 2026

Summary

Two test failures on dev machines that hadn't been caught because production-side changes drifted away from their original test fixtures. No production code changes — only test expectations updated.

  • test_macos_connector_normalizes_jxa_payload — The connector now tries EventKit before falling back to JXA (the subprocess.run path). On dev machines with calendar access granted, EventKit succeeds, returns real calendar events, and the subprocess.run mock is never reached. Fix: also patch _fetch_via_eventkit to return None, forcing the JXA fallback path deterministically.

  • test_render_emits_wikilinks_for_artifacts — Commit 0ab0897 humanized wikilink aliases (defer-simiDefer simi). The test was not updated and still expects the raw-slug alias. Fix: assert the humanized alias and validate the path slug separately.

Both passed everywhere CI runs (no calendar access → JXA path runs; whichever digest test order was happening). They surfaced on the dev box where I was running pytest tests ghostbrain before starting a new feature.

Test plan

  • pytest tests/test_calendar.py::test_macos_connector_normalizes_jxa_payload — passes
  • pytest tests/test_weekly_digest.py::test_render_emits_wikilinks_for_artifacts — passes
  • pytest tests ghostbrain — 324 passed, 0 failures

🤖 Generated with Claude Code

- test_macos_connector_normalizes_jxa_payload: also patch
  _fetch_via_eventkit to return None. The connector now tries EventKit
  before JXA, so on dev machines with calendar access granted the
  subprocess.run mock was bypassed and real events leaked in.
- test_render_emits_wikilinks_for_artifacts: assert the humanized alias
  (|Defer simi]]) introduced by the slug-humanizer feature. Path slug is
  still validated separately.

No production code changes — both tests were drifting from existing
behavior.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying ghost-brain with  Cloudflare Pages  Cloudflare Pages

Latest commit: a7cb3bc
Status: ✅  Deploy successful!
Preview URL: https://8ec591a9.ghost-brain.pages.dev
Branch Preview URL: https://fix-stale-test-expectations.ghost-brain.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant