Merge branch 'setup'

This commit is contained in:
2026-08-02 02:34:42 +02:00
135 changed files with 5735 additions and 976 deletions
@@ -1,9 +1,16 @@
import Logging
import MySQLNIO
import NIOCore
import NIOPosix
import NIOSSL
import Testing
@testable import Persistence
@Suite("TLS enumeration")
@Suite(
"TLS enumeration",
.tags(.enumeration)
)
struct TLSTests {
// MARK: Properties tests
@@ -25,4 +32,27 @@ struct TLSTests {
#expect(configuration.bestEffortEquals(.makeClientConfiguration()))
}
@Test
func `prefer falls back to plaintext when the server offers no TLS`() async throws {
// The fake server never advertises `CLIENT_SSL`, so this connection can only succeed by downgrading to
// plaintext pinning the driver behavior the `prefer` posture relies on.
let server = try await PlaintextMySQLServer.start()
let tlsConfiguration = try #require(TLS.prefer.tlsConfiguration)
let connection = try await MySQLConnection.connect(
to: .init(ipAddress: "127.0.0.1", port: server.port),
username: "loud",
database: "loud",
tlsConfiguration: tlsConfiguration,
logger: Logger(label: "test"),
on: MultiThreadedEventLoopGroup.singleton.any()
).get()
let isConnected = !connection.isClosed
try await connection.close().get()
try await server.stop()
#expect(isConnected)
}
}
@@ -1,12 +1,14 @@
import FluentKit
import HummingbirdFluent
import Logging
import NIOCore
import Testing
@testable import Persistence
@Suite("Probe method")
@Suite(
"Probe method",
.tags(.method)
)
struct ProbeTests {
// MARK: Methods tests
@@ -5,7 +5,10 @@ import Testing
@testable import Persistence
@Suite("Service method")
@Suite(
"Service method",
.tags(.method)
)
struct ServiceTests {
// MARK: Methods tests