Skip to content

Commit 330fd01

Browse files
authored
Merge pull request #165 from rarestype/use-latest-swift
[none]: use latest swift
2 parents 83a7ca2 + 828f2e2 commit 330fd01

7 files changed

Lines changed: 34 additions & 9 deletions

File tree

.github/workflows/Tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
--user root \
6161
-v $PWD:/swift-mongodb \
6262
-w /swift-mongodb \
63-
swift:6.2.4-noble \
63+
swift:noble \
6464
/bin/bash Scripts/TestAll
6565
6666
- name: 💖 Update badge 💖

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ let package: Package = .init(
1919
.package(url: "https://github.com/rarestype/swift-bson", from: "2.0.2"),
2020
.package(url: "https://github.com/rarestype/h", from: "1.0.0"),
2121
.package(url: "https://github.com/rarestype/u", from: "1.1.0"),
22-
.package(url: "https://github.com/rarestype/gram", from: "1.0.0"),
22+
.package(url: "https://github.com/rarestype/gram", from: "1.1.0"),
2323

2424
.package(url: "https://github.com/apple/swift-collections", from: "1.1.0"),
2525
.package(url: "https://github.com/apple/swift-nio", from: "2.79.0"),

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,31 @@ print(configuration)
5050
// ...
5151
```
5252

53+
## developing swift-mongodb
54+
55+
Development environments for MongoDB drivers can be challenging to set up. The easiest way to work on swift-mongodb is to use Docker. This repository contains some configurations to help you get started.
56+
57+
```bash
58+
# launch a cluster of Docker containers, each hosting a `mongod` instance
59+
docker compose -f .github/mongonet/docker-compose.yml up -d
60+
docker exec -t mongonet-mongo-0-1 /bin/mongosh --file /create-replica-set.js
61+
```
62+
63+
Importantly, your *own* devcontainer must be connected to the cluster’s Docker network (`mongonet`).
64+
65+
```yaml
66+
services:
67+
your-vscode-container:
68+
image: your-devcontainer-image
69+
hostname: vscode
70+
networks:
71+
- mongonet
72+
73+
networks:
74+
mongonet:
75+
external: true
76+
```
77+
5378
## license and acknowledgements
5479
5580
This library is Apache 2.0 licensed. It originally began as a re-write of [*MongoKitten*](https://github.com/orlandos-nl/MongoKitten) by [Joannis Orlandos](https://github.com/Joannis) and [Robbert Brandsma](https://github.com/Obbut).

Sources/MongoClusters/ServerSelection/Mongo.Unreachable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ extension Mongo.Unreachable: Equatable {
1313
case (.queued, .queued):
1414
true
1515
case (.errored(let lhs), .errored(let rhs)):
16-
lhs == rhs
16+
lhs ~= rhs
1717
case (_, _):
1818
false
1919
}

Sources/MongoDriver/Authenticator/Mongo.AuthenticationError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extension Mongo {
1515
extension Mongo.AuthenticationError: Equatable {
1616
public static func == (lhs: Self, rhs: Self) -> Bool {
1717
lhs.credentials == rhs.credentials &&
18-
lhs.underlying == rhs.underlying
18+
lhs.underlying ~= rhs.underlying
1919
}
2020
}
2121
extension Mongo.AuthenticationError: TraceableError {

Sources/MongoDriver/Connections/Mongo.ConnectionPoolDrainedError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extension Mongo {
1515
extension Mongo.ConnectionPoolDrainedError: Equatable {
1616
public static func == (lhs: Self, rhs: Self) -> Bool {
1717
lhs.host == rhs.host &&
18-
lhs.underlying == rhs.underlying
18+
lhs.underlying ~= rhs.underlying
1919
}
2020
}
2121
extension Mongo.ConnectionPoolDrainedError: TraceableError {

Sources/MongoDriverTests/Authentication.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import Testing
1515

1616
static var login: (String, String) { (Self.username, Self.password) }
1717

18-
@Test func defaulted() async throws {
18+
@Test func Defaulted() async throws {
1919
let bootstrap: Mongo.DriverBootstrap = mongodb / Self.login * self.seedlist /? {
2020
$0.executors = MultiThreadedEventLoopGroup.singleton
2121
}
@@ -25,7 +25,7 @@ import Testing
2525
}
2626
}
2727

28-
@Test func scramSHA256() async throws {
28+
@Test func ScramSHA256() async throws {
2929
let bootstrap: Mongo.DriverBootstrap = mongodb / Self.login * self.seedlist /? {
3030
$0.authentication = .sasl(.sha256)
3131
$0.executors = MultiThreadedEventLoopGroup.singleton
@@ -36,7 +36,7 @@ import Testing
3636
}
3737
}
3838

39-
@Test func unsupported() async throws {
39+
@Test func Unsupported() async throws {
4040
let bootstrap: Mongo.DriverBootstrap = mongodb / Self.login * self.seedlist /? {
4141
$0.connectionTimeout = .milliseconds(500)
4242
$0.authentication = .x509
@@ -58,7 +58,7 @@ import Testing
5858
}
5959
}
6060

61-
@Test func wrongPassword() async throws {
61+
@Test func WrongPassword() async throws {
6262
let bootstrap: Mongo.DriverBootstrap =
6363
mongodb / (Self.username, "1234") * self.seedlist /? {
6464
$0.connectionTimeout = .milliseconds(500)

0 commit comments

Comments
 (0)