Skip to content

Commit 1a742cf

Browse files
authored
Use lots of threads and make db username/pw env-controllable (#154)
1 parent 8828d56 commit 1a742cf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Tests/FluentPostgresDriverTests/FluentPostgresDriverTests.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -179,20 +179,20 @@ final class FluentPostgresDriverTests: XCTestCase {
179179
let aConfig = PostgresConfiguration(
180180
hostname: env("POSTGRES_HOSTNAME_A") ?? "localhost",
181181
port: env("POSTGRES_PORT_A").flatMap(Int.init) ?? 5432,
182-
username: "vapor_username",
183-
password: "vapor_password",
182+
username: env("POSTGRES_USERNAME_A") ?? "vapor_username",
183+
password: env("POSTGRES_PASSWORD_A") ?? "vapor_password",
184184
database: env("POSTGRES_DATABASE_A") ?? "vapor_database"
185185
)
186186
let bConfig = PostgresConfiguration(
187187
hostname: env("POSTGRES_HOSTNAME_B") ?? "localhost",
188188
port: env("POSTGRES_PORT_B").flatMap(Int.init) ?? 5432,
189-
username: "vapor_username",
190-
password: "vapor_password",
189+
username: env("POSTGRES_USERNAME_B") ?? "vapor_username",
190+
password: env("POSTGRES_PASSWORD_B") ?? "vapor_password",
191191
database: env("POSTGRES_DATABASE_B") ?? "vapor_database"
192192
)
193193
XCTAssert(isLoggingConfigured)
194-
self.eventLoopGroup = MultiThreadedEventLoopGroup(numberOfThreads: 1)
195-
self.threadPool = NIOThreadPool(numberOfThreads: 1)
194+
self.eventLoopGroup = MultiThreadedEventLoopGroup(numberOfThreads: System.coreCount)
195+
self.threadPool = NIOThreadPool(numberOfThreads: System.coreCount)
196196
self.dbs = Databases(threadPool: threadPool, on: self.eventLoopGroup)
197197

198198
self.dbs.use(.postgres(configuration: aConfig), as: .a)

0 commit comments

Comments
 (0)