Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Tests/KeyPathTests/ContentViewDebounceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import SwiftUI
/// Phase 1 Unit Tests: ContentView Debouncing
/// Tests the save operation debouncing added in Phase 1.3 to prevent rapid successive saves
@MainActor
class ContentViewDebounceTests: XCTestCase {
class ContentViewDebounceTests: KeyPathTestCase {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Migrate the remaining logging suite too

This file still contains Phase1LoggingTests: XCTestCase at line 127, and that suite constructs RuntimeCoordinator() in testLoggingCapturesActualOperations. Because TestSeamLintTests skips an entire file once it sees : KeyPathTestCase, changing only ContentViewDebounceTests here removes the file from the allowlist while leaving the logging suite without the VHIDDeviceManager.testPIDProvider seam, so this test can still take the real pgrep path that this migration is meant to avoid.

Useful? React with 👍 / 👎.

lazy var testManager: RuntimeCoordinator = .init()

// MARK: - Debounce Logic Tests (Non-UI)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@preconcurrency import XCTest

@MainActor
final class InstallerEngineBrokerForwardingTests: XCTestCase {
final class InstallerEngineBrokerForwardingTests: KeyPathTestCase {
func testUninstallVirtualHIDDriversRoutesToBroker() async throws {
let coordinator = PrivilegedCoordinatorStub()
let broker = PrivilegeBroker(coordinator: coordinator)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import KeyPathWizardCore

/// Characterization tests to ensure auto-fix actions map to the same recipes the planner uses.
@MainActor
final class WizardRecipeParityTests: XCTestCase {
final class WizardRecipeParityTests: KeyPathTestCase {
func testRecipeIDsMatchForCommonActions() {
let engine = InstallerEngine()
let context = SystemContextBuilder(
Expand Down
2 changes: 1 addition & 1 deletion Tests/KeyPathTests/KeyboardCaptureTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import KeyPathCore
@preconcurrency import XCTest

@MainActor
final class KeyboardCaptureTests: XCTestCase {
final class KeyboardCaptureTests: KeyPathTestCase {
private let defaultNotificationCenter = NotificationCenter
.perform(NSSelectorFromString("defaultCenter"))?
.takeUnretainedValue() as? NotificationCenter
Expand Down
11 changes: 1 addition & 10 deletions Tests/KeyPathTests/Lint/TestSeamLintTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,14 @@ final class TestSeamLintTests: XCTestCase {
/// Pre-existing suites that use a hazard type but still extend XCTestCase directly.
/// Migrate these to KeyPathTestCase and remove them here. Never add new entries.
private static let allowList: Set<String> = [
"ContentViewDebounceTests.swift",
"ErrorHandlingTests.swift",
"FacadeLintTests.swift",
"GrabRecoveryGateTests.swift",
"InstallerEngineBrokerForwardingTests.swift",
"KanataViewModelTests.swift",
"KeyboardCaptureTests.swift",
"KeyPathTests.swift",
"LayerSelectorTests.swift",
"OverlayHealthIndicatorObserverTests.swift",
"PrivilegedOperationsCoordinatorTests.swift",
"RecordingCoordinatorTests.swift",
"RuntimeCoordinatorResetTests.swift",
"SystemRequirementsTests.swift",
"VHIDDeviceManagerTests.swift",
"WizardPureLogicTests.swift",
"WizardRecipeParityTests.swift"
"WizardPureLogicTests.swift"
]

func testCoordinatorSuitesUseKeyPathTestCase() throws {
Expand Down
2 changes: 1 addition & 1 deletion Tests/KeyPathTests/RecordingCoordinatorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import KeyPathPermissions
@preconcurrency import XCTest

@MainActor
final class RecordingCoordinatorTests: XCTestCase {
final class RecordingCoordinatorTests: KeyPathTestCase {
private var statusMessages: [String] = []
private lazy var permissionProvider = StubPermissionProvider(
snapshot: RecordingCoordinatorTests.snapshot(accessibility: .unknown)
Expand Down
2 changes: 1 addition & 1 deletion Tests/KeyPathTests/Services/GrabRecoveryGateTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import XCTest
/// recovery. The recover/give-up tail (the bounded budget) is covered separately by
/// `ServiceHealthMonitorTests`; these tests cover only the pre-guard gate so they
/// never touch the real recovery action (which would shell out to launchctl/pgrep).
final class GrabRecoveryGateTests: XCTestCase {
final class GrabRecoveryGateTests: KeyPathTestCase {
typealias Gate = RuntimeCoordinator.GrabRecoveryGate

func testActiveGrabRecordsSuccess() {
Expand Down
2 changes: 1 addition & 1 deletion Tests/KeyPathTests/UI/KanataViewModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/// - ViewModel delegates actions to KanataManager
/// - UI state updates correctly
@MainActor
final class KanataViewModelTests: XCTestCase {
final class KanataViewModelTests: KeyPathTestCase {
// Note: These tests are simple sanity checks to verify the MVVM architecture compiles and runs
// Full integration testing is done at the UI level

Expand Down
2 changes: 1 addition & 1 deletion Tests/KeyPathTests/UI/LayerSelectorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/// Tests for layer selector functionality in MapperViewModel
@MainActor
final class LayerSelectorTests: XCTestCase {
final class LayerSelectorTests: KeyPathTestCase {
// MARK: - getAvailableLayers Tests

func testGetAvailableLayers_defaultsToBaseAndNav() {
Expand All @@ -23,7 +23,7 @@
// System layers should come before custom layers alphabetically
if let baseIndex = layers.firstIndex(of: "base"),
let navIndex = layers.firstIndex(of: "nav")
{

Check warning on line 26 in Tests/KeyPathTests/UI/LayerSelectorTests.swift

View workflow job for this annotation

GitHub Actions / code-quality

Opening braces should be preceded by a single space and on the same line as the declaration (opening_brace)
// Both system layers should be at the beginning
XCTAssertLessThan(baseIndex, 2)
XCTAssertLessThan(navIndex, 2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import KeyPathWizardCore
import XCTest

final class OverlayHealthIndicatorObserverTests: XCTestCase {
final class OverlayHealthIndicatorObserverTests: KeyPathTestCase {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Migrate the second observer suite

This file also defines HealthObserverInitializationOrderTests: XCTestCase at line 218, and that suite creates SystemValidator(vhidDeviceManager: VHIDDeviceManager(), ...). Since the lint guard checks for : KeyPathTestCase at file scope, this partial migration makes the file pass the ratchet even though that remaining suite still does not install the pgrep-avoidance seam, leaving the deadlock-prone path possible under parallel test runs.

Useful? React with 👍 / 👎.

@MainActor
func testHealthyStateTriggersDismiss() async {
var states: [HealthIndicatorState] = []
Expand Down Expand Up @@ -55,7 +55,7 @@
description: "Resolvable conflict",
autoFixAction: nil,
userAction: nil
),

Check warning on line 58 in Tests/KeyPathTests/UI/OverlayHealthIndicatorObserverTests.swift

View workflow job for this annotation

GitHub Actions / code-quality

Collection literals should not have trailing commas (trailing_comma)
]
controller.validationState = .success

Expand Down Expand Up @@ -107,7 +107,7 @@
description: "Resolvable",
autoFixAction: nil,
userAction: nil
),

Check warning on line 110 in Tests/KeyPathTests/UI/OverlayHealthIndicatorObserverTests.swift

View workflow job for this annotation

GitHub Actions / code-quality

Collection literals should not have trailing commas (trailing_comma)
]
controller.validationState = .failed(blockingCount: 1, totalCount: 3)

Expand Down Expand Up @@ -149,7 +149,7 @@
description: "Test",
autoFixAction: nil,
userAction: nil
),

Check warning on line 152 in Tests/KeyPathTests/UI/OverlayHealthIndicatorObserverTests.swift

View workflow job for this annotation

GitHub Actions / code-quality

Collection literals should not have trailing commas (trailing_comma)
]
controller.validationState = .failed(blockingCount: 1, totalCount: 1)
try? await Task.sleep(for: .milliseconds(400))
Expand Down
Loading