Repository navigation
refactor(test-support): extract shared ASC-screenshot render into GameTestSupportKit - #784
Merged
Merged
Conversation
…eTestSupportKit The ASC-screenshot render machinery (ASCProfile, ASCScreenshotEmit, emitASCScreenshot, ascScreenshotsRoot) was duplicated across SudokuUITests and MinesweeperUITests and had already started drifting (divergent headers/doc-comments) — the exact failure mode the mirror principle predicts (#750, found by the #713 upkeep round). One shared implementation now lives in a new leaf package Packages/GameTestSupportKit (shaped like TimeKit/DeterminismKit: one library target, zero dependencies — the render code needs only Foundation/AppKit/SwiftUI, so it does not belong in GameAppKit's Persistence/GameCenter-heavy graph). It is referenced ONLY from the two UI-test targets' dependency arrays, never a production target, so it cannot leak into shipped binaries. Tuist needs no Project.swift change (transitive package discovery; tuist generate verified). Per-app seam: emitASCScreenshot gained a host: closure parameter — each test target passes its own hostingView (theme/size-class injection), which was the only genuinely per-app piece; the @testable imports in the old copies were vestigial (nothing app-specific in the machinery). Both old copies are deleted outright, no shim files. ASCProfile is now explicitly Sendable (public cross-module type under strict concurrency). ascScreenshotsRoot's #filePath-walk is location-independent (it walks up to the unique docs/app-store/screenshots root); proven empirically, not just argued: ASC_EMIT_SCREENSHOTS=1 emit of sudoku/iphone-6.9/en/01-home after the move wrote a byte-identical PNG (zero git diff) at the identical path, 1290x2796 no-alpha as before. Also lists the new kit in CLAUDE.md's architecture block (test-support line) so the inventory stays drift-free for the upkeep audit. Verification: GameTestSupportKit 3/3; MinesweeperKit full suite 240/240 (--no-parallel); SudokuKit builds clean, ASCScreenshotEmitTests 9/9 (env-gate intact), BoardViewTests 18/18; swiftlint --strict 0 violations; tuist generate succeeds. Run by the Developer and re-run independently by the Leader. Closes #750 Co-Authored-By: Claude Fable 5 <[email protected]>
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.
What
Extracts the ASC-screenshot render machinery (
ASCProfile/ASCScreenshotEmit/emitASCScreenshot/ascScreenshotsRoot) — previously duplicated and already drifting across SudokuUITests and MinesweeperUITests — into a new zero-dependency leaf packagePackages/GameTestSupportKit(TimeKit/DeterminismKit shape), consumed ONLY by the two UI-test targets. Both old copies deleted outright; the one genuinely per-app piece (each target'shostingViewtheme injection) stays put and is passed in via a newhost:closure parameter.tuist generateascScreenshotsRoot's #filePath walk-up is location-independent — proven empirically: post-moveASC_EMIT_SCREENSHOTS=1emit wrote a byte-identical PNG (zero git diff) at the identical pathVerification
Closes #750
🤖 Generated with Claude Code