Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.

Commit 00e898d

Browse files
steipeteclaude
andcommitted
Fix test infrastructure and move tests to Xcode build system
- Added Sendable conformance to LocatorType enum to fix concurrency errors - Fixed SystemSound enum to conform to Equatable, Hashable, Sendable - Updated test target in Project.swift with proper Swift Testing configuration - Fixed enum case references (sidebarActivityIndicator → sidebarActivityArea) - Fixed Criterion property access (isEmpty → attribute/value checks) - Fixed Locator property access (action → requireAction) - Added missing .slow tag to SharedTestTags - Updated timeLimit from deprecated .seconds to .minutes - Successfully eliminated Swift compiler crash by moving to Xcode build system 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d295e11 commit 00e898d

7 files changed

Lines changed: 33 additions & 35 deletions

File tree

CodeLooper.xcodeproj/project.pbxproj

Lines changed: 18 additions & 26 deletions
Large diffs are not rendered by default.

Core/Utilities/Helpers/SoundEngine.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Foundation
77
///
88
/// This enum provides a type-safe way to specify which sound to play,
99
/// supporting both the user's preferred alert sound and named system sounds.
10-
enum SystemSound {
10+
enum SystemSound: Equatable, Hashable, Sendable {
1111
/// The user's preferred alert sound as configured in System Settings
1212
case userAlert // kSystemSoundID_UserPreferredAlert
1313
/// A named system sound file (e.g. "Boop.aiff")

Features/Intervention/Domain/Heuristics/ElementHeuristic.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010
///
1111
/// This enum provides type-safe access to element locators
1212
/// and ensures consistency across the locator system.
13-
public enum LocatorType: String, CaseIterable, Codable {
13+
public enum LocatorType: String, CaseIterable, Codable, Sendable {
1414
case connectionErrorIndicator
1515
case errorMessagePopup
1616
case forceStopResumeLink

Project.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,20 @@ let project = Project(
153153
dependencies: [
154154
.target(name: "CodeLooper"),
155155
.target(name: "Diagnostics"),
156+
.package(product: "Defaults"),
157+
.package(product: "AXorcist"),
156158
],
157159
settings: .settings(
158160
base: [
159161
"SWIFT_VERSION": "6.0",
160162
"MACOSX_DEPLOYMENT_TARGET": "14.0",
161-
"OTHER_SWIFT_FLAGS": "-strict-concurrency=complete",
163+
"OTHER_SWIFT_FLAGS": "-strict-concurrency=complete -enable-experimental-feature DebugDescriptionMacro",
162164
"ENABLE_STRICT_CONCURRENCY_CHECKS": "YES",
163165
"ENABLE_TESTING": "YES",
164166
"ENABLE_TESTING_SEARCH_PATHS": "YES",
165167
"FRAMEWORK_SEARCH_PATHS": "$(inherited) $(PLATFORM_DIR)/Developer/Library/Frameworks",
168+
// Enable Swift Testing framework
169+
"SWIFT_TESTING_ENABLED": "YES",
166170
// Enable automatic macro trust for Swift Testing
167171
"ENABLE_USER_SCRIPT_SANDBOXING": "NO",
168172
"SWIFT_PACKAGE_MACRO_VALIDATION": "NO",

Tests/LocatorPatternTests.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct LocatorPatternTests {
4747
// Expected criteria count for each type
4848
switch type {
4949
case .mainInputField, .stopGeneratingButton: 1
50-
case .sidebarActivityIndicator: 2
50+
case .sidebarActivityArea: 2
5151
default: 1
5252
}
5353
}
@@ -59,9 +59,10 @@ struct LocatorPatternTests {
5959
#expect(locator.criteria.count >= expectedMinCriteria,
6060
"\(type) should have at least \(expectedMinCriteria) criteria")
6161

62-
// Validate first criterion exists
62+
// Validate first criterion exists and has content
6363
if let firstCriterion = locator.criteria.first {
64-
#expect(!firstCriterion.isEmpty, "Criteria should not be empty")
64+
#expect(!firstCriterion.attribute.isEmpty, "Criterion attribute should not be empty")
65+
#expect(!firstCriterion.value.isEmpty, "Criterion value should not be empty")
6566
}
6667
}
6768

@@ -70,7 +71,7 @@ struct LocatorPatternTests {
7071
arguments: [
7172
(type: LocatorType.mainInputField, prefix: "mainInput"),
7273
(type: .stopGeneratingButton, prefix: "stopGenerating"),
73-
(type: .sidebarActivityIndicator, prefix: "sidebar"),
74+
(type: .sidebarActivityArea, prefix: "sidebar"),
7475
]
7576
)
7677
func rawValueConsistency(testCase: (type: LocatorType, prefix: String)) {
@@ -135,7 +136,7 @@ struct LocatorPatternTests {
135136

136137
if let locator {
137138
#expect(!locator.criteria.isEmpty, "Discovered locator should have criteria")
138-
#expect(locator.action == nil || locator.action == testCase.action,
139+
#expect(locator.requireAction == nil || locator.requireAction == testCase.action,
139140
"Action should match expected type")
140141
}
141142
}

Tests/SharedTestTags.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,5 @@ extension Tag {
158158
@Tag static var collections: Self
159159
@Tag static var rules: Self
160160
@Tag static var status: Self
161+
@Tag static var slow: Self
161162
}

Tests/SoundManagerTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ struct SoundManagerTests {
164164

165165
@Suite("Performance", .tags(.performance, .timing))
166166
struct PerformanceTests {
167-
@Test("Sound playback performance", .timeLimit(.seconds(5)))
167+
@Test("Sound playback performance", .timeLimit(.minutes(1)))
168168
func soundPlaybackPerformance() {
169169
let startTime = ContinuousClock().now
170170

0 commit comments

Comments
 (0)