Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package update #2660

Merged
merged 3 commits into from
Oct 9, 2023
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
24 changes: 12 additions & 12 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/SwiftPackageIndex/ShellOut.git",
"state" : {
"revision" : "79bc247323691d6689a358b4bbb24e5ef952e73f",
"version" : "3.1.3"
"revision" : "e862e8866c9d5d3fbc394aefdc8428f31c99355c",
"version" : "3.1.4"
}
},
{
Expand All @@ -167,8 +167,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/soto-project/soto.git",
"state" : {
"revision" : "939e61467a9adfd78520b46eddf756a09291f7e1",
"version" : "6.7.0"
"revision" : "c28c3efa72e6beceae6f38f8c8fe18e7c57e3418",
"version" : "6.8.0"
}
},
{
Expand All @@ -185,8 +185,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/SwiftPackageIndex/SPIManifest.git",
"state" : {
"revision" : "0cbefa29ada12cfb4544073c70b3b1bfaf77c04b",
"version" : "1.1.0"
"revision" : "b2da637b069e5b224047fe11820356d919d776f5",
"version" : "1.1.1"
}
},
{
Expand All @@ -203,8 +203,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-algorithms.git",
"state" : {
"revision" : "b14b7f4c528c942f121c8b860b9410b2bf57825e",
"version" : "1.0.0"
"revision" : "bcd4f369ac962bc3e5244c9df778739f8f5bdbf1",
"version" : "1.1.0"
}
},
{
Expand Down Expand Up @@ -392,8 +392,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-snapshot-testing.git",
"state" : {
"revision" : "506b6052384d8e97a4bb16fe8680325351c23c64",
"version" : "1.14.0"
"revision" : "5b356adceabff6ca027f6574aac79e9fee145d26",
"version" : "1.14.1"
}
},
{
Expand Down Expand Up @@ -455,8 +455,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/vapor.git",
"state" : {
"revision" : "c17d9b90d1e94cffa2a10cba63ec5b97147f7472",
"version" : "4.84.3"
"revision" : "e38dfe4877cd376e2af84e5a35c163cf73f41bb8",
"version" : "4.84.4"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let package = Package(
.package(url: "https://github.com/SwiftPackageIndex/DependencyResolution", from: "1.1.2"),
.package(url: "https://github.com/SwiftPackageIndex/SPIManifest.git", from: "1.1.0"),
.package(url: "https://github.com/SwiftPackageIndex/SemanticVersion", from: "0.3.0"),
.package(url: "https://github.com/SwiftPackageIndex/ShellOut.git", from: "3.1.0"),
.package(url: "https://github.com/SwiftPackageIndex/ShellOut.git", from: "3.1.4"),
.package(url: "https://github.com/apple/swift-package-manager.git", revision: "swift-5.9-RELEASE"),
.package(url: "https://github.com/dankinsoid/VaporToOpenAPI.git", from: "4.0.0"),
.package(url: "https://github.com/pointfreeco/swift-custom-dump.git", from: "0.10.0"),
Expand Down
13 changes: 0 additions & 13 deletions Tests/AppTests/AnalyzerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1520,19 +1520,6 @@ class AnalyzerTests: AppTestCase {
}


// We shouldn't be conforming a type we don't own to protocols we don't own
// but in a test module we can loosen that rule a bit.
extension ShellOutCommand: Equatable, Hashable {
public static func == (lhs: ShellOutCommand, rhs: ShellOutCommand) -> Bool {
lhs.description == rhs.description
}

public func hash(into hasher: inout Hasher) {
hasher.combine(description)
}
}


private struct Command: CustomStringConvertible {
var kind: Kind
var path: String
Expand Down
24 changes: 12 additions & 12 deletions Tests/AppTests/QueryPerformanceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,72 +38,72 @@ class QueryPerformanceTests: XCTestCase {

func test_01_Search_packageMatchQuery() async throws {
let query = Search.packageMatchQueryBuilder(on: app.db, terms: ["a"], filters: [])
try await assertQueryPerformance(query, expectedCost: 1140, variation: 150)
try await assertQueryPerformance(query, expectedCost: 1180, variation: 150)
}

func test_02_Search_keywordMatchQuery() async throws {
let query = Search.keywordMatchQueryBuilder(on: app.db, terms: ["a"])
try await assertQueryPerformance(query, expectedCost: 4540, variation: 200)
try await assertQueryPerformance(query, expectedCost: 4680, variation: 200)
}

func test_03_Search_authorMatchQuery() async throws {
let query = Search.authorMatchQueryBuilder(on: app.db, terms: ["a"])
try await assertQueryPerformance(query, expectedCost: 800, variation: 50)
try await assertQueryPerformance(query, expectedCost: 810, variation: 50)
}

func test_04_Search_query_noFilter() async throws {
let query = try Search.query(app.db, ["a"], page: 1)
.unwrap()
try await assertQueryPerformance(query, expectedCost: 6230, variation: 200)
try await assertQueryPerformance(query, expectedCost: 6410, variation: 200)
}

func test_05_Search_query_authorFilter() async throws {
let filter = try AuthorSearchFilter(expression: .init(operator: .is, value: "apple"))
let query = try Search.query(app.db, ["a"], filters: [filter], page: 1)
.unwrap()
try await assertQueryPerformance(query, expectedCost: 5950, variation: 200)
try await assertQueryPerformance(query, expectedCost: 6120, variation: 200)
}

func test_06_Search_query_keywordFilter() async throws {
let filter = try KeywordSearchFilter(expression: .init(operator: .is, value: "apple"))
let query = try Search.query(app.db, ["a"], filters: [filter], page: 1)
.unwrap()
try await assertQueryPerformance(query, expectedCost: 6020, variation: 200)
try await assertQueryPerformance(query, expectedCost: 6200, variation: 200)
}

func test_07_Search_query_lastActicityFilter() async throws {
let filter = try LastActivitySearchFilter(expression: .init(operator: .greaterThan, value: "2000-01-01"))
let query = try Search.query(app.db, ["a"], filters: [filter], page: 1)
.unwrap()
try await assertQueryPerformance(query, expectedCost: 6250, variation: 200)
try await assertQueryPerformance(query, expectedCost: 6430, variation: 200)
}

func test_08_Search_query_licenseFilter() async throws {
let filter = try LicenseSearchFilter(expression: .init(operator: .is, value: "mit"))
let query = try Search.query(app.db, ["a"], filters: [filter], page: 1)
.unwrap()
try await assertQueryPerformance(query, expectedCost: 6150, variation: 200)
try await assertQueryPerformance(query, expectedCost: 6330, variation: 200)
}

func test_09_Search_query_platformFilter() async throws {
let filter = try PlatformSearchFilter(expression: .init(operator: .is, value: "macos,ios"))
let query = try Search.query(app.db, ["a"], filters: [filter], page: 1)
.unwrap()
try await assertQueryPerformance(query, expectedCost: 6050, variation: 200)
try await assertQueryPerformance(query, expectedCost: 6210, variation: 200)
}

func test_10_Search_query_productTypeFilter() async throws {
let filter = try ProductTypeSearchFilter(expression: .init(operator: .is, value: "plugin"))
let query = try Search.query(app.db, ["a"], filters: [filter], page: 1)
.unwrap()
try await assertQueryPerformance(query, expectedCost: 5950, variation: 200)
try await assertQueryPerformance(query, expectedCost: 6120, variation: 200)
}

func test_11_Search_query_starsFilter() async throws {
let filter = try StarsSearchFilter(expression: .init(operator: .greaterThan, value: "5"))
let query = try Search.query(app.db, ["a"], filters: [filter], page: 1)
.unwrap()
try await assertQueryPerformance(query, expectedCost: 6130, variation: 300)
try await assertQueryPerformance(query, expectedCost: 6310, variation: 300)
}

func test_12_Search_refresh() async throws {
Expand Down Expand Up @@ -146,7 +146,7 @@ class QueryPerformanceTests: XCTestCase {
JOIN versions v ON v.package_id = p.id
WHERE v.reference ->> 'branch' = r.default_branch
""")
try await assertQueryPerformance(query, expectedCost: 58_200, variation: 500)
try await assertQueryPerformance(query, expectedCost: 61_000, variation: 500)
}

}
Expand Down