Remove some tests

This commit is contained in:
Kaede Akino committed 2026-09-16 21:46:59 +08:00
1 parent 0eb533f317
commit d0587b4927
5 files changed
-107

No files matched your search

-26
View File
@@ -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")
-13
View File
@@ -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()
-36
View File
@@ -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>) -> [UUID: StoredSSHKeyCredential] { [:] }
func discard() {}
}
-12
View File
@@ -103,18 +103,6 @@ struct ScrubberWebClientTests {
#expect(!result.content.contains("<html>"))
}
@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
-20
View File
@@ -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")
}