Skip to content

test(infra) AP scraper-pipeline integration tests#46

Merged
jkeeley2073 merged 1 commit into
mainfrom
Dev-ApScraperTestInfra
May 3, 2026
Merged

test(infra) AP scraper-pipeline integration tests#46
jkeeley2073 merged 1 commit into
mainfrom
Dev-ApScraperTestInfra

Conversation

@jkeeley2073
Copy link
Copy Markdown
Contributor

Summary

Backfill of the PR #41 family-wide test-infra template for the
ApGamePageScraper. AP is the closest sibling to CGC — both
multi-yield (.Game then .Link(s) per game), both HTML-index →
HTML-per-game with PDF link extraction — so the structure mirrors
CgcGamePageScraperTests tightly. The only material differences are
the discovery surface (XML sitemap vs HTML index page) and the
manufacturer-specific provenance values (SourceType.AmericanPinballGamePage,
"American Pinball Game Page", game_ap_{slug}, ap_games).

5 tests, +5 over the previous 430 = 435 total. Build clean,
zero warnings.

Tests added

  1. ScrapeAsync_HappyPath_YieldsGameThenLinksWithProvenance — sitemap
    with 2 games, each with PDF/ZIP downloads. Asserts yield order
    (.Game, .Link(s), .Game, .Link(s) in sitemap order),
    .Link.GameSlug lineage to parent game, full provenance fields
    (SourceType, DiscoveryUrl, DiscoveryContext, ScrapedFrom,
    ScrapedAt, DiscoveredOn), and gate-vs-wire URL equality.
  2. ScrapeAsync_PerPageFetchFailure_DoesNotAbortRun — one game page
    500s, the other two still yield. Politeness invariants hold under
    failure.
  3. ScrapeAsync_DiscoveryFailure_AbortsThisSourceOnly/sitemap.xml
    500s; scraper yields nothing and does not throw.
  4. ScrapeAsync_PolitenessExceptionFromGate_PropagatesUp — gate
    throws on Acquire; exception propagates, no HTTP requests fire.
  5. ScrapeAsync_GateThrowsOnReport_BubblesUp — symmetric Report-side
    throw also propagates.

Test plan

  • dotnet test --filter ApGamePageScraperTests — 5/5 pass
  • dotnet test — 435/435 pass (was 430)
  • dotnet build -warnaserror — 0 warnings, 0 errors

Pre-push self-audit

/local-review deferred to the reviewer at merge time. 7-item
mechanical checklist:

  1. Every option field is read. No new options added — uses
    existing ApOptions.BaseUrl. ✅
  2. Sibling-diff for drift. Test file mirrors
    CgcGamePageScraperTests (same five test names, same assertion
    order, same helper-method shape). Manufacturer-specific values
    (slugs, source enum, discovery context, GameId prefix,
    DiscoveredOn token, sitemap content type) are the only
    intentional differences. ✅
  3. No bare catch { }. Grep confirms zero matches in the new
    file. ✅
  4. CLI / orchestrator wiring is end-to-end. No new scraper
    registered — this is a test-only change. AP scraper's CLI alias
    was wired in its original PR and the SourceAliasContractTests
    suite still passes. ✅
  5. Tests assert behavior, not just structure. Happy-path asserts
    yield count, yield order, .Link.GameSlug lineage, full
    provenance fields, and gate-wire URL equality. Failure-isolation
    test asserts that 2 of 3 games still yield and that politeness
    invariants hold under failure. Discovery-failure test asserts
    empty result. Both PolitenessException tests assert the
    exception propagates and (in the Acquire case) that no HTTP
    requests fire. ✅
  6. Build is zero-warning. dotnet build -warnaserror clean. ✅
  7. Identity check. git log -1 --format='%an <%ae>' shows
    Jim Keeley <94459922+jkeeley2073@users.noreply.github.com>. ✅

🤖 Generated with Claude Code

@jkeeley2073 jkeeley2073 added the claude-code Generated with Claude Code label May 3, 2026
Backfill of the PR #41 template across the family. 5 tests covering
happy-path with full provenance + gate-vs-wire URL equality, per-page
failure isolation, discovery failure, PolitenessException on both Acquire
and Report. Multi-yield (.Game + .Link) scraper so tests pin both kinds
plus .Link.GameSlug lineage to parent game.

Pre-push audit: 7-item mechanical (all pass). /local-review deferred to
human reviewer at merge time.
@jkeeley2073 jkeeley2073 force-pushed the Dev-ApScraperTestInfra branch from 0f6b4e9 to 6487c0f Compare May 3, 2026 11:54
@jkeeley2073 jkeeley2073 merged commit 1933e6d into main May 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-code Generated with Claude Code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant