test(infra) AP scraper-pipeline integration tests#46
Merged
Conversation
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.
0f6b4e9 to
6487c0f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backfill of the PR #41 family-wide test-infra template for the
ApGamePageScraper. AP is the closest sibling to CGC — bothmulti-yield (
.Gamethen.Link(s)per game), both HTML-index →HTML-per-game with PDF link extraction — so the structure mirrors
CgcGamePageScraperTeststightly. The only material differences arethe 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
ScrapeAsync_HappyPath_YieldsGameThenLinksWithProvenance— sitemapwith 2 games, each with PDF/ZIP downloads. Asserts yield order
(
.Game,.Link(s),.Game,.Link(s)in sitemap order),.Link.GameSluglineage to parent game, full provenance fields(
SourceType,DiscoveryUrl,DiscoveryContext,ScrapedFrom,ScrapedAt,DiscoveredOn), and gate-vs-wire URL equality.ScrapeAsync_PerPageFetchFailure_DoesNotAbortRun— one game page500s, the other two still yield. Politeness invariants hold under
failure.
ScrapeAsync_DiscoveryFailure_AbortsThisSourceOnly—/sitemap.xml500s; scraper yields nothing and does not throw.
ScrapeAsync_PolitenessExceptionFromGate_PropagatesUp— gatethrows on Acquire; exception propagates, no HTTP requests fire.
ScrapeAsync_GateThrowsOnReport_BubblesUp— symmetric Report-sidethrow also propagates.
Test plan
dotnet test --filter ApGamePageScraperTests— 5/5 passdotnet test— 435/435 pass (was 430)dotnet build -warnaserror— 0 warnings, 0 errorsPre-push self-audit
/local-reviewdeferred to the reviewer at merge time. 7-itemmechanical checklist:
existing
ApOptions.BaseUrl. ✅CgcGamePageScraperTests(same five test names, same assertionorder, same helper-method shape). Manufacturer-specific values
(slugs, source enum, discovery context, GameId prefix,
DiscoveredOntoken, sitemap content type) are the onlyintentional differences. ✅
catch { }. Grep confirms zero matches in the newfile. ✅
registered — this is a test-only change. AP scraper's CLI alias
was wired in its original PR and the
SourceAliasContractTestssuite still passes. ✅
yield count, yield order,
.Link.GameSluglineage, fullprovenance 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. ✅
dotnet build -warnaserrorclean. ✅git log -1 --format='%an <%ae>'showsJim Keeley <94459922+jkeeley2073@users.noreply.github.com>. ✅🤖 Generated with Claude Code