-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
P0Production blocker - must fix immediatelyProduction blocker - must fix immediatelybugSomething isn't workingSomething isn't workingsub-taskPart of a larger epicPart of a larger epictestingTesting related changesTesting related changes
Description
📋 Sub-task of Epic #102
Problem
Test targets cannot find module dependencies, preventing any tests from compiling.
Error Messages
error: cannot find 'XCTest' in scope
error: cannot find type 'XCTestCase' in scope
error: no such module 'SnapshotTesting'
Root Causes
- Test targets not properly linked to SPM modules
- Missing test dependencies in Package.swift files
- Incorrect import paths
- XCTest framework not linked
Required Fixes
1. Update Module Package.swift Files
// Each module's Package.swift needs:
.testTarget(
name: "CoreTests",
dependencies: [
"Core",
.product(name: "SnapshotTesting", package: "swift-snapshot-testing")
],
path: "Tests"
)2. Fix Test Target Configuration
- Ensure test targets have proper framework search paths
- Link XCTest framework explicitly
- Set up proper module maps
3. Test File Structure
Modules/Core/
├── Package.swift
├── Sources/
└── Tests/
└── CoreTests/
├── ItemTests.swift
└── Resources/
Acceptance Criteria
- All test targets compile without errors
- XCTest properly imported in all test files
- SnapshotTesting available where needed
- Module dependencies resolved
- Tests can access public APIs from modules
- Xcode test navigator shows all tests
Verification Steps
- Clean build folder
- Run
swift package resolve - Build test targets:
swift build --build-tests - Run tests:
swift test
Copilot
Metadata
Metadata
Assignees
Labels
P0Production blocker - must fix immediatelyProduction blocker - must fix immediatelybugSomething isn't workingSomething isn't workingsub-taskPart of a larger epicPart of a larger epictestingTesting related changesTesting related changes