Skip to content

Commit 4808c53

Browse files
authored
Update minimum Swift version to 5.5 (#201)
* Update minimum Swift version to 5.5 * Match default values used by other drivers for test connection env vars
1 parent 0e6e0b6 commit 4808c53

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,14 @@ jobs:
8282
strategy:
8383
fail-fast: false
8484
matrix:
85-
dbimage: ['postgres:15', 'postgres:14', 'postgres:11']
85+
dbimage: ['postgres:15', 'postgres:13', 'postgres:11']
8686
swiftver: [
87-
'swift:5.4-focal', 'swift:5.5-focal', 'swift:5.6-focal',
88-
'swift:5.7-jammy',
87+
'swift:5.5-bionic', 'swift:5.6-focal', 'swift:5.7-jammy',
8988
'swiftlang/swift:nightly-main-jammy'
9089
]
9190
include: [
9291
{dbimage: 'postgres:15', dbauth: 'scram-sha-256'},
93-
{dbimage: 'postgres:14', dbauth: 'md5'},
92+
{dbimage: 'postgres:13', dbauth: 'md5'},
9493
{dbimage: 'postgres:11', dbauth: 'trust'}
9594
]
9695
container: ${{ matrix.swiftver }}

Package.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.4
1+
// swift-tools-version:5.5
22
import PackageDescription
33

44
let package = Package(
@@ -10,9 +10,9 @@ let package = Package(
1010
.library(name: "FluentPostgresDriver", targets: ["FluentPostgresDriver"]),
1111
],
1212
dependencies: [
13-
.package(url: "https://github.com/vapor/async-kit.git", from: "1.2.0"),
14-
.package(url: "https://github.com/vapor/fluent-kit.git", from: "1.31.0"),
15-
.package(url: "https://github.com/vapor/postgres-kit.git", from: "2.5.1"),
13+
.package(url: "https://github.com/vapor/async-kit.git", from: "1.14.0"),
14+
.package(url: "https://github.com/vapor/fluent-kit.git", from: "1.36.0"),
15+
.package(url: "https://github.com/vapor/postgres-kit.git", from: "2.9.0"),
1616
],
1717
targets: [
1818
.target(name: "FluentPostgresDriver", dependencies: [

Tests/FluentPostgresDriverTests/FluentPostgresDriverTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ final class FluentPostgresDriverTests: XCTestCase {
141141
let db = self.dbs.database(
142142
.iso8601,
143143
logger: .init(label: "test"),
144-
on: self.eventLoopGroup.next()
144+
on: self.eventLoopGroup.any()
145145
)!
146146

147147
let date = Date()
@@ -200,11 +200,11 @@ final class FluentPostgresDriverTests: XCTestCase {
200200
self.dbs.use(.testPostgres(subconfig: "A"), as: .a)
201201
self.dbs.use(.testPostgres(subconfig: "B"), as: .b)
202202

203-
let a = self.dbs.database(.a, logger: Logger(label: "test.fluent.a"), on: self.eventLoopGroup.next())
203+
let a = self.dbs.database(.a, logger: Logger(label: "test.fluent.a"), on: self.eventLoopGroup.any())
204204
_ = try (a as! PostgresDatabase).query("drop schema public cascade").wait()
205205
_ = try (a as! PostgresDatabase).query("create schema public").wait()
206206

207-
let b = self.dbs.database(.b, logger: Logger(label: "test.fluent.b"), on: self.eventLoopGroup.next())
207+
let b = self.dbs.database(.b, logger: Logger(label: "test.fluent.b"), on: self.eventLoopGroup.any())
208208
_ = try (b as! PostgresDatabase).query("drop schema public cascade").wait()
209209
_ = try (b as! PostgresDatabase).query("create schema public").wait()
210210
}
@@ -225,9 +225,9 @@ extension DatabaseConfigurationFactory {
225225
let baseSubconfig = PostgresConfiguration(
226226
hostname: env("POSTGRES_HOSTNAME_\(subconfig)") ?? "localhost",
227227
port: env("POSTGRES_PORT_\(subconfig)").flatMap(Int.init) ?? PostgresConfiguration.ianaPortNumber,
228-
username: env("POSTGRES_USER_\(subconfig)") ?? "vapor_username",
229-
password: env("POSTGRES_PASSWORD_\(subconfig)") ?? "vapor_password",
230-
database: env("POSTGRES_DB_\(subconfig)") ?? "vapor_database"
228+
username: env("POSTGRES_USER_\(subconfig)") ?? "test_username",
229+
password: env("POSTGRES_PASSWORD_\(subconfig)") ?? "test_password",
230+
database: env("POSTGRES_DB_\(subconfig)") ?? "test_database"
231231
)
232232

233233
return .postgres(configuration: baseSubconfig, connectionPoolTimeout: .seconds(30), encoder: encoder, decoder: decoder)

0 commit comments

Comments
 (0)