-
Notifications
You must be signed in to change notification settings - Fork 0
Testing
Yakiv Kovalskyi edited this page Jul 14, 2026
·
1 revision
Mirrors ai-docs/TESTING.md in the repo.
cd PokerKit
swift testPokerKitTests uses Swift's Testing framework (import Testing, @Test
functions) rather than XCTest. That framework ships inside a full Xcode
install, not with the bare Command Line Tools. If xcode-select -p points
at /Library/Developer/CommandLineTools (or any toolchain that doesn't
bundle Xcode's Testing module), swift test fails to compile with:
error: no such module 'Testing'
Fix: point DEVELOPER_DIR at an actual Xcode.app (or any Xcode variant —
a beta build works too) before running:
DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test
# or, if only a beta is installed:
DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer swift testAs of this doc, the suite is 9 test files / 83 @Test functions, all
passing:
BankrollEntryTests.swift ChenScoreTests.swift DrillGeneratorTests.swift
HandHistoryParserTests.swift HoleCardsTests.swift LeakAnalysisTests.swift
PreflopGridTests.swift PushFoldRangeTests.swift StudyToolTests.swift
Two jobs, both on macos-15 with DEVELOPER_DIR forced to the runner's
bundled Xcode.app for the same reason as above:
-
pokerkit-tests— checkout, print toolchain versions,cd PokerKit && swift test. -
app-build— checkout,brew install xcodegen,xcodegen generateinapp/(regeneratesPoker.xcodeproj, which is gitignored), picks whichever iPhone simulator is actually available on the runner image (xcrun simctl list devices available— deliberately not a hardcoded device name, since specific iPhone models come and go between runner images), thenxcodebuild build -scheme Poker -project Poker.xcodeproj -destination "platform=iOS Simulator,name=<device>".
Runs on push to main and on every PR into main.
- Per
CLAUDE.md§2 ("Verify, don't assume"): new domain logic (range parsing, ICM math, leak detection) gets a real test, not just a compile check — poker math is easy to get subtly wrong. - Tests that assert on randomness seed their own generator rather than
relying on
SystemRandomNumberGenerator— see e.g.DrillGeneratorTests.sameSeedProducesTheSameSpotSequence— so results are reproducible. -
app/UITests/(one file per screen:PreflopRangeUITests,PushFoldTrainerUITests,BankrollTrackerUITests,HandHistoryImportUITests,DrillsUITests,LeakAnalysisUITests) are not run by CI today — onlyapp-build's plainxcodebuild buildruns, notxcodebuild test. Keep that in mind: a UI test can silently rot until someone runs it manually or CI is extended to cover it.