Skip to content

Commit 52713dd

Browse files
committed
fix: repair broken test target compilation
1 parent 64bdcc0 commit 52713dd

11 files changed

Lines changed: 75 additions & 1083 deletions

TablePro.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3012,6 +3012,7 @@
30123012
CURRENT_PROJECT_VERSION = 1;
30133013
DEVELOPMENT_TEAM = "";
30143014
GENERATE_INFOPLIST_FILE = YES;
3015+
HEADER_SEARCH_PATHS = "$(SRCROOT)/TablePro/Core/SSH/CLibSSH2/include";
30153016
MACOSX_DEPLOYMENT_TARGET = 26.2;
30163017
MARKETING_VERSION = 1.0;
30173018
PRODUCT_BUNDLE_IDENTIFIER = com.ngoquocdat.TableProTests;
@@ -3020,6 +3021,7 @@
30203021
STRING_CATALOG_GENERATE_SYMBOLS = NO;
30213022
SWIFT_APPROACHABLE_CONCURRENCY = YES;
30223023
SWIFT_EMIT_LOC_STRINGS = NO;
3024+
SWIFT_INCLUDE_PATHS = "$(SRCROOT)/TablePro/Core/SSH/CLibSSH2";
30233025
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
30243026
SWIFT_VERSION = 5.0;
30253027
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TablePro.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/TablePro";
@@ -3034,6 +3036,7 @@
30343036
CURRENT_PROJECT_VERSION = 1;
30353037
DEVELOPMENT_TEAM = "";
30363038
GENERATE_INFOPLIST_FILE = YES;
3039+
HEADER_SEARCH_PATHS = "$(SRCROOT)/TablePro/Core/SSH/CLibSSH2/include";
30373040
MACOSX_DEPLOYMENT_TARGET = 26.2;
30383041
MARKETING_VERSION = 1.0;
30393042
PRODUCT_BUNDLE_IDENTIFIER = com.ngoquocdat.TableProTests;
@@ -3042,6 +3045,7 @@
30423045
STRING_CATALOG_GENERATE_SYMBOLS = NO;
30433046
SWIFT_APPROACHABLE_CONCURRENCY = YES;
30443047
SWIFT_EMIT_LOC_STRINGS = NO;
3048+
SWIFT_INCLUDE_PATHS = "$(SRCROOT)/TablePro/Core/SSH/CLibSSH2";
30453049
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
30463050
SWIFT_VERSION = 5.0;
30473051
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TablePro.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/TablePro";

TableProTests/Core/Plugins/PluginModelsTests.swift

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,52 +8,61 @@ import TableProPluginKit
88
import Testing
99
@testable import TablePro
1010

11-
@Suite("PluginEntry Computed Properties — Fallback Behavior")
12-
struct PluginEntryFallbackTests {
11+
@Suite("PluginEntry Computed Properties")
12+
struct PluginEntryTests {
1313

14-
private func makeNonPluginEntry() -> PluginEntry {
14+
private func makeEntry(
15+
databaseTypeId: String? = nil,
16+
additionalTypeIds: [String] = [],
17+
pluginIconName: String = "puzzlepiece",
18+
defaultPort: Int? = nil
19+
) -> PluginEntry {
1520
PluginEntry(
16-
id: "test.non-plugin",
21+
id: "test.plugin",
1722
bundle: Bundle.main,
1823
url: Bundle.main.bundleURL,
1924
source: .builtIn,
20-
name: "Non-Plugin Bundle",
25+
name: "Test Plugin",
2126
version: "1.0.0",
22-
pluginDescription: "A bundle whose principalClass is not a DriverPlugin",
27+
pluginDescription: "A test plugin",
2328
capabilities: [.databaseDriver],
24-
isEnabled: true
29+
isEnabled: true,
30+
databaseTypeId: databaseTypeId,
31+
additionalTypeIds: additionalTypeIds,
32+
pluginIconName: pluginIconName,
33+
defaultPort: defaultPort
2534
)
2635
}
2736

28-
@Test("driverPlugin returns nil for a non-plugin bundle")
29-
func driverPluginReturnsNil() {
30-
let entry = makeNonPluginEntry()
31-
#expect(entry.driverPlugin == nil)
32-
}
33-
34-
@Test("iconName falls back to puzzlepiece when driverPlugin is nil")
35-
func iconNameFallback() {
36-
let entry = makeNonPluginEntry()
37-
#expect(entry.iconName == "puzzlepiece")
38-
}
39-
40-
@Test("databaseTypeId returns nil when driverPlugin is nil")
37+
@Test("databaseTypeId returns nil when not set")
4138
func databaseTypeIdNil() {
42-
let entry = makeNonPluginEntry()
39+
let entry = makeEntry()
4340
#expect(entry.databaseTypeId == nil)
4441
}
4542

46-
@Test("additionalTypeIds returns empty array when driverPlugin is nil")
43+
@Test("databaseTypeId returns value when set")
44+
func databaseTypeIdSet() {
45+
let entry = makeEntry(databaseTypeId: "MySQL")
46+
#expect(entry.databaseTypeId == "MySQL")
47+
}
48+
49+
@Test("additionalTypeIds returns empty array by default")
4750
func additionalTypeIdsEmpty() {
48-
let entry = makeNonPluginEntry()
51+
let entry = makeEntry()
4952
#expect(entry.additionalTypeIds.isEmpty)
5053
}
5154

52-
@Test("defaultPort returns nil when driverPlugin is nil")
55+
@Test("defaultPort returns nil when not set")
5356
func defaultPortNil() {
54-
let entry = makeNonPluginEntry()
57+
let entry = makeEntry()
5558
#expect(entry.defaultPort == nil)
5659
}
60+
61+
@Test("pluginIconName returns provided value")
62+
func pluginIconName() {
63+
let entry = makeEntry(pluginIconName: "mysql-icon")
64+
#expect(entry.pluginIconName == "mysql-icon")
65+
}
5766
}
5867

5968
@Suite("PluginSource Enum")
@@ -82,7 +91,11 @@ struct PluginEntryIdentityTests {
8291
version: "0.1.0",
8392
pluginDescription: "",
8493
capabilities: [],
85-
isEnabled: false
94+
isEnabled: false,
95+
databaseTypeId: nil,
96+
additionalTypeIds: [],
97+
pluginIconName: "puzzlepiece",
98+
defaultPort: nil
8699
)
87100
#expect(entry.id == "com.example.test-plugin")
88101
}

TableProTests/Core/SSH/SSHTunnelManagerHealthTests.swift

Lines changed: 0 additions & 120 deletions
This file was deleted.

TableProTests/Core/SSH/SSHTunnelManagerTests.swift

Lines changed: 0 additions & 49 deletions
This file was deleted.

TableProTests/Core/Storage/SQLFavoriteStorageTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ struct SQLFavoriteStorageTests {
161161
// Favorite should now be in parent folder
162162
let fetched = await storage.fetchFavorites()
163163
let found = fetched.first { $0.id == fav.id }
164-
#expect(found?.folderId == parent.id.uuidString || found?.folderId == parent.id)
164+
#expect(found?.folderId == parent.id)
165165
}
166166

167167
// MARK: - Keyword

TableProTests/Core/Utilities/JsonRowConverterTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// TableProTests
44
//
55

6+
import Foundation
7+
68
@testable import TablePro
79
import Testing
810

0 commit comments

Comments
 (0)