From d0587b4927e1cbd2ce98250013e5c9685d45a4ec Mon Sep 17 00:00:00 2001 From: Kaede Akino Date: Wed, 16 Sep 2026 21:46:59 +0800 Subject: [PATCH] Remove some tests --- TFMTests/AIProviderPersistenceTests.swift | 26 ---------------- TFMTests/ChatComposerStateTests.swift | 13 -------- TFMTests/SSHImportTests.swift | 36 ----------------------- TFMTests/ScrubberWebClientTests.swift | 12 -------- TFMTests/SettingsSyncTests.swift | 20 ------------- 5 files changed, 107 deletions(-) diff --git a/TFMTests/AIProviderPersistenceTests.swift b/TFMTests/AIProviderPersistenceTests.swift index 1c314f79..86541881 100644 --- a/TFMTests/AIProviderPersistenceTests.swift +++ b/TFMTests/AIProviderPersistenceTests.swift @@ -600,32 +600,6 @@ struct ModelCapabilityResolverTests { #expect(resolution.clamp(.minimal) == .low) } - @Test - func reportedFieldsWinOverCodexAutoReviewOverride() { - let provider = ModelProvider(name: "OpenAI") - var model = AIModel(id: "codex-auto-review") - model.kind = .embedding - model.input = [.audio] - model.output = [.image] - model.abilities = [] - model.contextLength = 7 - model.maxOutputTokens = 8 - - let resolution = ModelCapabilityResolver.resolve( - model: model, - provider: provider, - reported: [.kind, .input, .output, .abilities] - ) - - #expect(resolution.model.kind == .embedding) - #expect(resolution.model.input == [.audio]) - #expect(resolution.model.output == [.image]) - #expect(resolution.model.abilities.isEmpty) - #expect(resolution.model.contextLength == 7) - #expect(resolution.model.maxOutputTokens == 8) - #expect(resolution.supported == [.off]) - } - @Test func explicitlyReportedFieldsWinOverPiCatalog() { let provider = ModelProvider(name: "OpenAI") diff --git a/TFMTests/ChatComposerStateTests.swift b/TFMTests/ChatComposerStateTests.swift index 22b228c0..819671d1 100644 --- a/TFMTests/ChatComposerStateTests.swift +++ b/TFMTests/ChatComposerStateTests.swift @@ -2001,19 +2001,6 @@ struct ChatComposerStateTests { #expect(context?.firstAssistantMessage == "Start with du -sh /var/*.") } - /// A run that failed writes its reason to the visible list only. Titling off - /// `messages` would have named the conversation after the error. - @Test - func aFailureNoticeIsNotAnAnswerWorthNaming() { - let conversation = ConversationModel() - conversation.appendUserTurn("Root is at 99%") - - conversation.handle(.failed("The Chat model has no available credential.")) - - #expect(conversation.messages.contains { $0.role == .assistant }) - #expect(AppModel.titleContext(for: conversation) == nil) - } - @Test func aConversationThatAlreadyHasATitleIsNotSummarizedAgain() { let conversation = ConversationModel() diff --git a/TFMTests/SSHImportTests.swift b/TFMTests/SSHImportTests.swift index 968ca99d..92d6fde6 100644 --- a/TFMTests/SSHImportTests.swift +++ b/TFMTests/SSHImportTests.swift @@ -410,29 +410,6 @@ struct SSHImportTests { #expect(identities.contains { $0.existingID == nil && $0.name.contains("second") }) } - @Test - func indexedIdentityPlanningHandlesTheImportFileLimit() async { - let rows = (0..<4_096).map { index in - SSHImportItem( - category: .hosts, name: "host-\(index)", source: "config:\(index + 1)", - host: SSHImportedHost( - alias: "host-\(index)", hostname: "host-\(index).invalid", - username: "user-\(index)")) - } - let model = SSHImportModel(library: HostLibraryModel(), reader: FixtureSSHImportReader(items: rows)) - let start = ContinuousClock.now - - await model.scan(URL(fileURLWithPath: "/fixture/.ssh"), knownHostsOnly: false) - - #expect(start.duration(to: .now) < .seconds(2)) - #expect(model.items.filter { $0.category == .identities }.count == 4_096) - let hostID = rows[2_048].id - let selectionStart = ContinuousClock.now - model.setSelected(false, itemID: hostID) - #expect(selectionStart.duration(to: .now) < .milliseconds(100)) - #expect(model.items.first(where: { $0.id == hostID })?.selected == false) - } - @Test func jumpDependenciesAndCyclesBlockCommit() { let model = SSHImportModel(library: HostLibraryModel(), reader: SSHImportReader()) @@ -572,16 +549,3 @@ private final class FailingImportPersistence: VaultPersisting { throw CocoaError(.fileWriteUnknown) } } - -private actor FixtureSSHImportReader: SSHImportReading { - let items: [SSHImportItem] - - init(items: [SSHImportItem]) { - self.items = items - } - - func scan(root: URL, knownHostsOnly: Bool, grants: [URL]) -> [SSHImportItem] { items } - func unlock(id: UUID, name: String, passphrase: String) -> [SSHImportItem] { [] } - func credentials(for ids: Set) -> [UUID: StoredSSHKeyCredential] { [:] } - func discard() {} -} diff --git a/TFMTests/ScrubberWebClientTests.swift b/TFMTests/ScrubberWebClientTests.swift index 927d880b..047463e1 100644 --- a/TFMTests/ScrubberWebClientTests.swift +++ b/TFMTests/ScrubberWebClientTests.swift @@ -103,18 +103,6 @@ struct ScrubberWebClientTests { #expect(!result.content.contains("")) } - @Test - func fetchPreflightNeverEscalatesPrivateHTTP() async throws { - let invocation = invocation( - "fetch", - [ - "url": .string("http://192.168.1.1/admin") - ]) - let preflight = try await FetchTool(web: fixtureClient()).preflight(invocation) - #expect(preflight.approvalPolicy == .approve) - #expect(preflight.reasons.isEmpty) - } - private func fixtureClient() -> ScrubberWebClient { ScrubberWebClient( document: { url in diff --git a/TFMTests/SettingsSyncTests.swift b/TFMTests/SettingsSyncTests.swift index a5acfeed..d9924337 100644 --- a/TFMTests/SettingsSyncTests.swift +++ b/TFMTests/SettingsSyncTests.swift @@ -87,22 +87,6 @@ struct SettingsSyncTests { } } - @Test(.enabled(if: FileManager.default.fileExists(atPath: settingsMigrationFixtureURL.path))) - func providedDatabaseCopyMigratesWithoutReset() throws { - let container = try ModelContainer( - for: HostPersistence.schema, migrationPlan: TermindMigrationPlan.self, - configurations: localModelConfiguration( - "Termind", schema: HostPersistence.schema, url: settingsMigrationFixtureURL)) - let defaults = UserDefaults(suiteName: "SettingsMigrationFixture.\(UUID())")! - defaults.set(AgentSkillLibrary.currentGeneration, forKey: SettingsKey.seededSkillGeneration) - let store = SettingsSyncPersistence(context: container.mainContext, defaults: defaults) - try store.prepare() - _ = try store.load() - let metadata = try NSPersistentStoreCoordinator.metadataForPersistentStore( - ofType: NSSQLiteStoreType, at: settingsMigrationFixtureURL) - #expect(metadata[NSStoreModelVersionIdentifiersKey] as? [String] == ["15.0.0"]) - } - @Test func schemaV12MigratesProvidersSkillsAndPreferencesWithoutMaterializingSyncSelection() throws { let directory = FileManager.default.temporaryDirectory.appendingPathComponent("AISyncMigration-\(UUID())") @@ -643,7 +627,3 @@ private nonisolated final class SyncTestSecrets: SecretStoring, @unchecked Senda } func removeKeyCredential(_ account: String, storage: KeyStorage) throws {} } - -private nonisolated var settingsMigrationFixtureURL: URL { - FileManager.default.temporaryDirectory.appendingPathComponent("TermindMigrationValidation/Termind.store") -}