Skip to content

Commit

Permalink
Update minimum required versions for dependencies (#604)
Browse files Browse the repository at this point in the history
* Update minimum required dependency versions in Package.swift, especially SQLKit

* Guard against stale tables in one of the benchmark tests

* Reduce minimum required SwiftNIO version
  • Loading branch information
gwynne authored Apr 29, 2024
1 parent c4533db commit 0f32c02
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ let package = Package(
.library(name: "XCTFluent", targets: ["XCTFluent"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-nio.git", from: "2.55.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.2"),
.package(url: "https://github.com/vapor/sql-kit.git", from: "3.28.0"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.62.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.4"),
.package(url: "https://github.com/vapor/sql-kit.git", from: "3.29.2"),
.package(url: "https://github.com/vapor/async-kit.git", from: "1.17.0"),
],
targets: [
Expand Down
6 changes: 3 additions & 3 deletions [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ let package = Package(
.library(name: "XCTFluent", targets: ["XCTFluent"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-nio.git", from: "2.55.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.2"),
.package(url: "https://github.com/vapor/sql-kit.git", from: "3.28.0"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.62.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.4"),
.package(url: "https://github.com/vapor/sql-kit.git", from: "3.29.2"),
.package(url: "https://github.com/vapor/async-kit.git", from: "1.17.0"),
],
targets: [
Expand Down
21 changes: 13 additions & 8 deletions Sources/FluentBenchmark/Tests/ModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,21 @@ extension FluentBenchmarker {
}
}

try (self.database as? any SQLDatabase)?.drop(table: Enclosure.schema).ifExists().run().wait()
try Enclosure.Migration().prepare(on: self.database).wait()

let enclosure = Enclosure()
enclosure.primary = .init()
enclosure.primary.something = ""
enclosure.primary.another = 0
enclosure.additional = []
try enclosure.save(on: self.database).wait()

try! Enclosure.Migration().revert(on: self.database).wait()
do {
let enclosure = Enclosure()
enclosure.primary = .init()
enclosure.primary.something = ""
enclosure.primary.another = 0
enclosure.additional = []
try enclosure.save(on: self.database).wait()
} catch {
try? Enclosure.Migration().revert(on: self.database).wait()
throw error
}
try Enclosure.Migration().revert(on: self.database).wait()
}
}
}
Expand Down

0 comments on commit 0f32c02

Please sign in to comment.