Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
637568a
Convert test suite from XCTest to Swift Testing framework
steipete Jun 6, 2025
077facf
Optimize Swift Testing implementation with advanced features
steipete Jun 6, 2025
82fccf9
Optimize NotificationHandlingTests with advanced Swift Testing features
steipete Jun 6, 2025
a56c048
Improve tests with advanced Swift Testing features
steipete Jun 6, 2025
5e3087d
Fix KeyboardShortcuts concurrency issues for Swift 6
steipete Jun 6, 2025
196294a
Fix remaining KeyboardShortcuts concurrency issues
steipete Jun 6, 2025
e12c484
Fix notification observer concurrency issues
steipete Jun 6, 2025
61a8429
Complete KeyboardShortcuts concurrency fixes for Swift 6
steipete Jun 6, 2025
97ac275
Final KeyboardShortcuts concurrency fixes for Swift 6
steipete Jun 6, 2025
93b1da6
Fix all issues identified in PR comments
steipete Jun 6, 2025
2a43b24
Fix remaining issues from PR review comments
steipete Jun 6, 2025
a4c19c1
Fix Swift Testing _TestingInternals error by enabling ENABLE_TESTING_…
steipete Jun 6, 2025
10ce6c0
Skip UI interactions in test environment and update Tuist to 4.52.0 v…
steipete Jun 6, 2025
8599aa1
Skip login item registration during tests
steipete Jun 6, 2025
57d2d3d
Update CI to use Xcode 16.3
steipete Jun 6, 2025
3f398f9
Fix CI tests: disable code signing for test execution
steipete Jun 6, 2025
7e448cf
Remove invalid xcodebuild flags for test execution
steipete Jun 6, 2025
f8b0136
Fix CI tests: use build-for-testing and test-without-building
steipete Jun 6, 2025
1e016b7
Simplify CI tests: use swift test directly
steipete Jun 7, 2025
0346326
Complete Swift Testing conversion for remaining test files
steipete Jun 7, 2025
0da46b8
Improve Swift Testing tests: fix compilation errors and enhance asser…
steipete Jun 7, 2025
a942b70
Enhance Swift Testing: add comprehensive error handling, time limits,…
steipete Jun 7, 2025
008a87a
Complete advanced Swift Testing patterns: lifecycle demos, confirmati…
steipete Jun 7, 2025
5860449
Complete comprehensive Swift Testing modernization with advanced patt…
steipete Jun 7, 2025
193b8f1
Fix DiagnosticsTests and NotificationHandlingTests compilation errors
steipete Jun 7, 2025
e85ec9e
Refactor SoundManagerTests to use Swift Testing patterns
steipete Jun 7, 2025
b1e96e0
Improve test assertions in IconAnimationTests and AccessibilityTests
steipete Jun 7, 2025
4ca0958
Apply Swift Testing best practices from WWDC 2024
steipete Jun 7, 2025
c79b43d
Fix test compilation errors
steipete Jun 7, 2025
64201c6
Fix #expectAll macro usage (doesn't exist in Swift Testing)
steipete Jun 7, 2025
868a9ac
Remove demonstration test files that don't test actual functionality
steipete Jun 7, 2025
898c2ed
Fix comprehensive SwiftLint and SwiftFormat violations across codebase
steipete Jun 7, 2025
aea1e52
Remove demonstration tests that test the testing framework
steipete Jun 7, 2025
b9d42a3
Achieve zero SwiftLint violations with targeted disable commands
steipete Jun 7, 2025
8ec4a21
Fix compilation errors from Swift Testing conversion
steipete Jun 7, 2025
7720028
Fix test infrastructure and move tests to Xcode build system
steipete Jun 7, 2025
2bea83d
Final test infrastructure improvements and CI fixes
steipete Jun 7, 2025
892cfa1
Fix trailing closure SwiftLint violation - achieve 0 linter violations
steipete Jun 7, 2025
c0f3cd4
Final Swift 6 compliance fixes for DesignSystem and Settings
steipete Jun 7, 2025
ad3deb2
Fix CI configuration for Swift Testing framework support
steipete Jun 7, 2025
c8694c3
Fix SessionLogger ambiguity in test files
steipete Jun 7, 2025
db7374d
Improve CI test execution and error handling
steipete Jun 7, 2025
64251dc
Fix CI workflow syntax issues
steipete Jun 7, 2025
bf7e50d
Fix YAML syntax issue with HEREDOC in CI workflow
steipete Jun 7, 2025
986f9d1
Fix remaining CI warnings in test files
steipete Jun 7, 2025
1685ef2
Fix final LogCategory ambiguity in SessionLoggingTests
steipete Jun 7, 2025
30f9628
Fix boolean assertion conversion bug in LoginItemManagerTests
steipete Jun 7, 2025
4f05410
Fix remaining CI warnings in Swift Testing conversion
steipete Jun 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 131 additions & 7 deletions .github/workflows/build-mac-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ on:
- 'CodeLooper/**'
- 'Resources/**'
- 'scripts/**'
- 'Tests/**'
- '.github/workflows/build-mac-app.yml'
- 'Project.swift'
- 'Package.swift'
Expand All @@ -39,6 +40,7 @@ on:
- 'CodeLooper/**'
- 'Resources/**'
- 'scripts/**'
- 'Tests/**'
- '.github/workflows/build-mac-app.yml'
- 'Project.swift'
- 'Package.swift'
Expand Down Expand Up @@ -80,16 +82,16 @@ jobs:
fetch-depth: 0
submodules: recursive

# Set up Swift environment - use Xcode 16 which includes Swift 6.0
- name: Setup Xcode 16 with Swift 6.0
# Set up Swift environment - use Xcode 16.3 which includes Swift 6.0.3
- name: Setup Xcode 16.3 with Swift 6.0.3
run: |
# List available Xcode versions for debugging
echo "Available Xcode versions:"
ls /Applications/ | grep Xcode || true

# Select Xcode 16.x (macOS 15 runner should have it)
# Select Xcode 16.3 (macOS 15 runner should have it)
# Try multiple versions in order of preference
for version in "16.2" "16.1" "16.0"; do
for version in "16.3" "16.2" "16.1" "16.0"; do
if [ -d "/Applications/Xcode_${version}.app" ]; then
echo "Using Xcode ${version}"
sudo xcode-select -s "/Applications/Xcode_${version}.app"
Expand All @@ -115,6 +117,16 @@ jobs:
echo "::error::Swift 6.0 or higher is required, but found Swift $SWIFT_VERSION"
exit 1
fi

# Verify Swift Testing framework availability
echo "Verifying Swift Testing framework support..."
echo 'import Testing; @Test func sample() { #expect(true) }' > /tmp/test_swift_testing.swift
if xcrun swift -parse /tmp/test_swift_testing.swift 2>/dev/null; then
echo "✅ Swift Testing framework is available"
else
echo "::warning::Swift Testing framework may not be fully available"
fi
rm -f /tmp/test_swift_testing.swift

- name: Set build version and cache fingerprints
id: set-version
Expand Down Expand Up @@ -223,14 +235,29 @@ jobs:
chmod +x scripts/build.sh
chmod +x scripts/codesign-app.sh

- name: Install build tools (Tuist, xcbeautify, SwiftLint, SwiftFormat)
- name: Install mise
run: |
# Use Homebrew to install all build tools
brew install tuist xcbeautify swiftlint swiftformat
# Install mise (formerly rtx) for tool version management
curl https://mise.run | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Install build tools (Tuist via mise, xcbeautify, SwiftLint, SwiftFormat)
run: |
# Install Tuist via mise to ensure consistent version
mise install
eval "$(mise activate bash)"

# Install other tools via Homebrew
brew install xcbeautify swiftlint swiftformat

# Verify Tuist installation
tuist version
tuist --help | head -5

- name: Generate Xcode project with Tuist
run: |
# Ensure mise environment is activated
eval "$(mise activate bash)"
# Generate Xcode project with Swift 6.0
./scripts/generate-xcproj.sh

Expand All @@ -250,6 +277,93 @@ jobs:
scripts/ci-swiftlint.sh --verbose || echo "::warning::SwiftLint found linting issues"
echo "::endgroup::"

- name: Verify Swift Testing Framework
run: |
echo "Checking Swift Testing framework availability in dependencies..."

# Verify Testing framework is available in Package.swift
if grep -q "swift-testing" Package.swift; then
echo "✅ Swift Testing framework found in Package.swift dependencies"
else
echo "::warning::Swift Testing framework not found in Package.swift dependencies"
fi

# Test compilation with Swift Testing import in the context of the project
echo "Testing Swift Testing framework compilation with project context..."
echo 'import Testing; @Test func check() { #expect(true) }' > /tmp/testing_check.swift

# Try to compile with the project's build context
if swift package resolve >/dev/null 2>&1 && xcrun swift -package-path . -I .build/debug -c -o /tmp/testing_check /tmp/testing_check.swift >/dev/null 2>&1; then
echo "✅ Swift Testing framework compilation test passed with project context"
elif xcrun swift -c -o /tmp/testing_check /tmp/testing_check.swift >/dev/null 2>&1; then
echo "✅ Swift Testing framework compilation test passed with basic context"
else
echo "::warning::Swift Testing framework compilation test failed - may impact test execution but not critical"
echo "::warning::This is expected if Swift Testing is only available in the Xcode build context"
fi

# Clean up
rm -f /tmp/testing_check.swift /tmp/testing_check

- name: Run Tests
continue-on-error: true
run: |
echo "::group::Running Tests with Swift Testing Framework"
echo "Running test suite with Swift Testing framework support..."

# Create test results directory
mkdir -p test-results

# Run main app tests with Swift Testing support
echo "Running main app tests via xcodebuild..."
MAIN_TEST_EXIT_CODE=0
set -o pipefail
if ! xcodebuild test \
-workspace CodeLooper.xcworkspace \
-scheme CodeLooper \
-destination "platform=macOS" \
-configuration Debug \
-enableCodeCoverage YES \
-resultBundlePath test-results/CodeLooper.xcresult \
OTHER_SWIFT_FLAGS="-enable-testing" \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO | xcbeautify; then
MAIN_TEST_EXIT_CODE=$?
echo "::warning::Main app tests failed with exit code $MAIN_TEST_EXIT_CODE"
else
echo "✅ Main app tests completed successfully"
fi

# Check if test results were generated
if [ -d "test-results/CodeLooper.xcresult" ]; then
echo "✅ Test results bundle created successfully"
# Extract basic test summary
echo "Test results summary:"
xcrun xcresulttool get --format json --path test-results/CodeLooper.xcresult | head -20 || true
else
echo "::warning::No test results bundle was created"
fi

# Run subpackage tests (these use XCTest, not Swift Testing)
echo "::group::Running Subpackage Tests"

echo "Running AXorcist tests (XCTest-based)..."
cd AXorcist
swift test --enable-code-coverage > ../test-results/axorcist-output.log 2>&1 || echo "::warning::AXorcist tests failed - these use XCTest framework which may have integration dependencies"
cd ..

echo "Running DesignSystem tests..."
cd DesignSystem
swift test --enable-code-coverage --verbose > ../test-results/designsystem-output.log 2>&1 || echo "::warning::DesignSystem tests failed"
cd ..

echo "::endgroup::"

# Summary
echo "Test execution completed. Main tests exit code: $MAIN_TEST_EXIT_CODE"
echo "::endgroup::"

- name: Build, Sign, and Optionally Notarize macOS App
id: build_sign_notarize_step
env:
Expand Down Expand Up @@ -513,6 +627,16 @@ jobs:
retention-days: 14
if-no-files-found: error

- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: CodeLooper-Test-Results-${{ steps.set-version.outputs.version }}
path: |
test-results/
retention-days: 7
if-no-files-found: ignore

- name: Upload Lint and Format Reports
if: always()
uses: actions/upload-artifact@v4
Expand Down
2 changes: 2 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tools]
tuist = "4.52.0"
9 changes: 0 additions & 9 deletions .package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,6 @@
"version" : "600.0.1"
}
},
{
"identity" : "swift-testing",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-testing.git",
"state" : {
"revision" : "399f76dcd91e4c688ca2301fa24a8cc6d9927211",
"version" : "0.99.0"
}
},
{
"identity" : "swiftui-introspect",
"kind" : "remoteSourceControl",
Expand Down
5 changes: 4 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,7 @@ identifier_name:
- vc
- i
- p
- c
- c
- n
- CTL_KERN
- KERN_PROCARGS2
8 changes: 4 additions & 4 deletions AXpector/Sources/AXpector/AXpectorViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,24 @@ class AXpectorViewModel: ObservableObject {
deinit {
Task { @MainActor [weak self] in
guard let self else { return }

// Clean up timers and tasks
self.permissionCheckTimer?.invalidate()
self.permissionCheckTimer = nil
self.permissionTask?.cancel()
self.permissionTask = nil

// Remove app observers
if let observer = self.appLaunchObserver {
NotificationCenter.default.removeObserver(observer)
}
if let observer = self.appTerminateObserver {
NotificationCenter.default.removeObserver(observer)
}

self.windowRefreshTimer?.invalidate()
self.windowRefreshTimer = nil

self.stopHoverMonitoring()
self.stopFocusTrackingMonitoring()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ extension AXpectorViewModel {
if self.selectedApplicationPID == appPID {
self.selectedApplicationPID = nil
}

// Refresh the list
self.fetchRunningApplications()
}
Expand Down
Loading
Loading