Skip to content

Commit

Permalink
Merge pull request #8435 from realm/tg/rework-sync-tests
Browse files Browse the repository at this point in the history
Rework the sync tests
  • Loading branch information
tgoyne authored Dec 19, 2023
2 parents d3e1735 + 710d6b6 commit a73034c
Show file tree
Hide file tree
Showing 47 changed files with 6,784 additions and 7,687 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
x.y.z Release notes (yyyy-MM-dd)
=============================================================
### Enhancements
* None.

### Fixed
* Registering new notifications inside write transactions before actually
making any changes is now actually allowed. This was supposed to be allowed
in 10.39.1, but it did not actually work due to some redundant validation.
* `SyncSession.ProgressDirection` and `SyncSession.ProgressMode` were missing
`Sendable` annotations ([PR #8435](https://github.com/realm/realm-swift/pull/8435)).
* `Realm.Error.subscriptionFailed` was reported with the incorrect error
domain, making it impossible to catch (since v10.42.2, [PR #8435](https://github.com/realm/realm-swift/pull/8435)).

### Compatibility
* Realm Studio: 14.0.1 or later.
* APIs are backwards compatible with all previous releases in the 10.x.y series.
* Carthage release for Swift is built with Xcode 15.1.0.
* CocoaPods: 1.10 or later.
* Xcode: 14.1-15.1.0.

### Internal
* Upgraded realm-core from ? to ?

10.45.1 Release notes (2023-12-18)
=============================================================

Expand Down
29 changes: 21 additions & 8 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,28 @@ let testCxxSettings: [CXXSetting] = cxxSettings + [
// SPM requires all targets to explicitly include or exclude every file, which
// gets very awkward when we have four targets building from a single directory
let objectServerTestSources = [
"AsyncSyncTests.swift",
"ClientResetTests.swift",
"CombineSyncTests.swift",
"EventTests.swift",
"Object-Server-Tests-Bridging-Header.h",
"ObjectServerTests-Info.plist",
"RLMAsymmetricSyncServerTests.mm",
"RLMBSONTests.mm",
"RLMCollectionSyncTests.mm",
"RLMFlexibleSyncServerTests.mm",
"RLMMongoClientTests.mm",
"RLMObjectServerPartitionTests.mm",
"RLMObjectServerTests.mm",
"RLMServerTestObjects.h",
"RLMServerTestObjects.m",
"RLMSubscriptionTests.mm",
"RLMSyncTestCase.h",
"RLMSyncTestCase.mm",
"RLMUser+ObjectServerTests.h",
"RLMUser+ObjectServerTests.mm",
"RLMWatchTestUtility.h",
"RLMWatchTestUtility.m",
"EventTests.swift",
"RealmServer.swift",
"SwiftAsymmetricSyncServerTests.swift",
"SwiftCollectionSyncTests.swift",
Expand Down Expand Up @@ -324,32 +330,38 @@ let package = Package(
objectServerTestSupportTarget(
name: "RealmSyncTestSupport",
dependencies: ["Realm", "RealmSwift", "RealmTestSupport"],
sources: ["RLMSyncTestCase.mm",
"RLMUser+ObjectServerTests.mm",
"RLMServerTestObjects.m"]
sources: [
"RLMServerTestObjects.m",
"RLMSyncTestCase.mm",
"RLMUser+ObjectServerTests.mm",
"RLMWatchTestUtility.m",
]
),
objectServerTestSupportTarget(
name: "RealmSwiftSyncTestSupport",
dependencies: ["RealmSwift", "RealmTestSupport", "RealmSyncTestSupport", "RealmSwiftTestSupport"],
sources: [
"RealmServer.swift",
"SwiftServerObjects.swift",
"SwiftSyncTestCase.swift",
"TimeoutProxyServer.swift",
"WatchTestUtility.swift",
"RealmServer.swift",
"SwiftServerObjects.swift"
]
),
objectServerTestTarget(
name: "SwiftObjectServerTests",
sources: [
"AsyncSyncTests.swift",
"ClientResetTests.swift",
"CombineSyncTests.swift",
"EventTests.swift",
"SwiftAsymmetricSyncServerTests.swift",
"SwiftCollectionSyncTests.swift",
"SwiftFlexibleSyncServerTests.swift",
"SwiftMongoClientTests.swift",
"SwiftObjectServerPartitionTests.swift",
"SwiftObjectServerTests.swift",
"SwiftUIServerTests.swift"
"SwiftUIServerTests.swift",
]
),
objectServerTestTarget(
Expand All @@ -359,9 +371,10 @@ let package = Package(
"RLMBSONTests.mm",
"RLMCollectionSyncTests.mm",
"RLMFlexibleSyncServerTests.mm",
"RLMMongoClientTests.mm",
"RLMObjectServerPartitionTests.mm",
"RLMObjectServerTests.mm",
"RLMWatchTestUtility.m"
"RLMSubscriptionTests.mm",
]
)
],
Expand Down
28 changes: 26 additions & 2 deletions Realm.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@
3F1F47821B9612B300CD99A3 /* KVOTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3F0F029D1B6FFE610046A4D5 /* KVOTests.mm */; };
3F222C4E1E26F51300CA0713 /* ThreadSafeReference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F222C4D1E26F51300CA0713 /* ThreadSafeReference.swift */; };
3F2633C31E9D630000B32D30 /* PrimitiveListTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F2633C21E9D630000B32D30 /* PrimitiveListTests.swift */; };
3F2B40CA2B2900DA00E30319 /* CombineSyncTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F2B40C52B2900DA00E30319 /* CombineSyncTests.swift */; };
3F2B40CB2B2900DA00E30319 /* AsyncSyncTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F2B40C62B2900DA00E30319 /* AsyncSyncTests.swift */; };
3F2B40CC2B2900DA00E30319 /* RLMSubscriptionTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3F2B40C72B2900DA00E30319 /* RLMSubscriptionTests.mm */; };
3F2B40CD2B2900DA00E30319 /* RLMMongoClientTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3F2B40C82B2900DA00E30319 /* RLMMongoClientTests.mm */; };
3F2B40CE2B2900DA00E30319 /* ClientResetTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F2B40C92B2900DA00E30319 /* ClientResetTests.swift */; };
3F2E66641CA0BA11004761D5 /* NotificationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F2E66611CA0B9D5004761D5 /* NotificationTests.m */; };
3F336E8B1DA2FA15006CB5A0 /* RLMSyncConfiguration_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A36236A1D83868F00945A54 /* RLMSyncConfiguration_Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
3F3411A6273433B300EC9D25 /* ObjcBridgeable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F3411A5273433B300EC9D25 /* ObjcBridgeable.swift */; };
Expand All @@ -109,6 +114,8 @@
3F4F3AD723F71C790048DB43 /* RLMObjectId.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F4F3AD023F71C790048DB43 /* RLMObjectId.h */; settings = {ATTRIBUTES = (Public, ); }; };
3F4F3ADB23F71C790048DB43 /* RLMObjectId.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3F4F3AD223F71C790048DB43 /* RLMObjectId.mm */; };
3F4F3ADD23F71C790048DB43 /* RLMDecimal128.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F4F3AD323F71C790048DB43 /* RLMDecimal128.h */; settings = {ATTRIBUTES = (Public, ); }; };
3F4FD2FB2B2A389A003E3DFD /* TestType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F4FD2FA2B2A389A003E3DFD /* TestType.swift */; };
3F4FD2FC2B2A389A003E3DFD /* TestType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F4FD2FA2B2A389A003E3DFD /* TestType.swift */; };
3F558C8722C29A03002F0F30 /* TestUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3F558C7E22C29A02002F0F30 /* TestUtils.mm */; };
3F558C8822C29A03002F0F30 /* TestUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3F558C7E22C29A02002F0F30 /* TestUtils.mm */; };
3F558C8A22C29A03002F0F30 /* TestUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3F558C7E22C29A02002F0F30 /* TestUtils.mm */; };
Expand Down Expand Up @@ -333,7 +340,6 @@
AC05380C2885B25A00CE27C4 /* SwiftAsymmetricSyncServerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC0538062885B1DF00CE27C4 /* SwiftAsymmetricSyncServerTests.swift */; };
AC23487E26FC8619009129F2 /* RLMUser+ObjectServerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AF64DD11DA304A90081EB15 /* RLMUser+ObjectServerTests.mm */; };
AC2C2A40268E1B0200B4DA33 /* SwiftServerObjects.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC2C2A3E268E1ACE00B4DA33 /* SwiftServerObjects.swift */; };
AC2C2A41268E1B0700B4DA33 /* SwiftServerObjects.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC2C2A3E268E1ACE00B4DA33 /* SwiftServerObjects.swift */; };
AC320BAE268E1F2D0043D484 /* SwiftServerObjects.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC2C2A3E268E1ACE00B4DA33 /* SwiftServerObjects.swift */; };
AC3B33AE29DC6CEE0042F3A0 /* RLMLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = AC3B33AB29DC6CEE0042F3A0 /* RLMLogger.h */; settings = {ATTRIBUTES = (Public, ); }; };
AC3B33AF29DC6CEE0042F3A0 /* RLMLogger.mm in Sources */ = {isa = PBXBuildFile; fileRef = AC3B33AC29DC6CEE0042F3A0 /* RLMLogger.mm */; };
Expand Down Expand Up @@ -678,6 +684,11 @@
3F222C4D1E26F51300CA0713 /* ThreadSafeReference.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ThreadSafeReference.swift; sourceTree = "<group>"; };
3F2633C21E9D630000B32D30 /* PrimitiveListTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PrimitiveListTests.swift; sourceTree = "<group>"; };
3F275EBD2433A5DA00161E7F /* RLMApp_Private.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = RLMApp_Private.hpp; sourceTree = "<group>"; };
3F2B40C52B2900DA00E30319 /* CombineSyncTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CombineSyncTests.swift; path = Realm/ObjectServerTests/CombineSyncTests.swift; sourceTree = "<group>"; };
3F2B40C62B2900DA00E30319 /* AsyncSyncTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AsyncSyncTests.swift; path = Realm/ObjectServerTests/AsyncSyncTests.swift; sourceTree = "<group>"; };
3F2B40C72B2900DA00E30319 /* RLMSubscriptionTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RLMSubscriptionTests.mm; path = Realm/ObjectServerTests/RLMSubscriptionTests.mm; sourceTree = "<group>"; };
3F2B40C82B2900DA00E30319 /* RLMMongoClientTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RLMMongoClientTests.mm; path = Realm/ObjectServerTests/RLMMongoClientTests.mm; sourceTree = "<group>"; };
3F2B40C92B2900DA00E30319 /* ClientResetTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ClientResetTests.swift; path = Realm/ObjectServerTests/ClientResetTests.swift; sourceTree = "<group>"; };
3F2E66611CA0B9D5004761D5 /* NotificationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NotificationTests.m; sourceTree = "<group>"; };
3F3411A5273433B300EC9D25 /* ObjcBridgeable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ObjcBridgeable.swift; sourceTree = "<group>"; };
3F4071342A57472F00D9C4A3 /* PrivateSymbols.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = PrivateSymbols.txt; sourceTree = "<group>"; };
Expand All @@ -693,6 +704,7 @@
3F4F3AD223F71C790048DB43 /* RLMObjectId.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RLMObjectId.mm; sourceTree = "<group>"; };
3F4F3AD323F71C790048DB43 /* RLMDecimal128.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RLMDecimal128.h; sourceTree = "<group>"; };
3F4F3AD423F71C790048DB43 /* RLMObjectId_Private.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = RLMObjectId_Private.hpp; sourceTree = "<group>"; };
3F4FD2FA2B2A389A003E3DFD /* TestType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestType.swift; sourceTree = "<group>"; };
3F558C7E22C29A02002F0F30 /* TestUtils.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TestUtils.mm; path = Realm/TestUtils/TestUtils.mm; sourceTree = "<group>"; };
3F558C7F22C29A02002F0F30 /* RLMTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RLMTestCase.h; path = Realm/TestUtils/include/RLMTestCase.h; sourceTree = "<group>"; };
3F558C8022C29A02002F0F30 /* RLMMultiProcessTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RLMMultiProcessTestCase.h; path = Realm/TestUtils/include/RLMMultiProcessTestCase.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1434,6 +1446,7 @@
AC8846772686573B00DF4A65 /* ContentView.swift */,
AC8847472687E0AA00DF4A65 /* Info.plist */,
AC8846752686573B00DF4A65 /* SwiftUISyncTestHostApp.swift */,
3F4FD2FA2B2A389A003E3DFD /* TestType.swift */,
);
path = SwiftUISyncTestHost;
sourceTree = "<group>";
Expand Down Expand Up @@ -1566,17 +1579,22 @@
isa = PBXGroup;
children = (
1AA5AEA21D98CA5300ED8C27 /* Utility */,
3F2B40C62B2900DA00E30319 /* AsyncSyncTests.swift */,
3F2B40C92B2900DA00E30319 /* ClientResetTests.swift */,
3F2B40C52B2900DA00E30319 /* CombineSyncTests.swift */,
536B7C0B24A4C223006B535D /* dependencies.list */,
3FEE4F44281C439D009194C7 /* EventTests.swift */,
AC0538052885B1DF00CE27C4 /* RLMAsymmetricSyncServerTests.mm */,
5346E7312487AC9D00595C68 /* RLMBSONTests.mm */,
CFA3A23D260B8427002C3266 /* RLMCollectionSyncTests.mm */,
CF08757C260B98E100B9BE60 /* RLMCollectionSyncTests.mm */,
ACB6FD30273C60920009712F /* RLMFlexibleSyncServerTests.mm */,
3F2B40C82B2900DA00E30319 /* RLMMongoClientTests.mm */,
AC7D182B261F2F560080E1D2 /* RLMObjectServerPartitionTests.mm */,
E8267FF01D90B8E700E001C7 /* RLMObjectServerTests.mm */,
531F956F279070A800E497F1 /* RLMServerTestObjects.h */,
531F956E279070A800E497F1 /* RLMServerTestObjects.m */,
3F2B40C72B2900DA00E30319 /* RLMSubscriptionTests.mm */,
1AA5AE9D1D98A6D800ED8C27 /* RLMSyncTestCase.h */,
1AA5AE9B1D98A68E00ED8C27 /* RLMSyncTestCase.mm */,
49D9DFC4246C8E48003AD31D /* setup_baas.rb */,
Expand Down Expand Up @@ -2606,8 +2624,8 @@
buildActionMask = 2147483647;
files = (
AC8846782686573B00DF4A65 /* ContentView.swift in Sources */,
AC2C2A41268E1B0700B4DA33 /* SwiftServerObjects.swift in Sources */,
AC8846762686573B00DF4A65 /* SwiftUISyncTestHostApp.swift in Sources */,
3F4FD2FB2B2A389A003E3DFD /* TestType.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -2625,6 +2643,7 @@
AC320BAE268E1F2D0043D484 /* SwiftServerObjects.swift in Sources */,
ACBD595328364DB0009A664E /* SwiftSyncTestCase.swift in Sources */,
AC88478626888CEE00DF4A65 /* SwiftUISyncTestHostUITests.swift in Sources */,
3F4FD2FC2B2A389A003E3DFD /* TestType.swift in Sources */,
ACBD595B2836541F009A664E /* TestUtils.mm in Sources */,
3F95F4A2295B8488006BC287 /* TestUtils.swift in Sources */,
);
Expand All @@ -2634,17 +2653,22 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3F2B40CB2B2900DA00E30319 /* AsyncSyncTests.swift in Sources */,
3F2B40CE2B2900DA00E30319 /* ClientResetTests.swift in Sources */,
3F2B40CA2B2900DA00E30319 /* CombineSyncTests.swift in Sources */,
3FEE4F45281C439D009194C7 /* EventTests.swift in Sources */,
537130C824A9E417001FDBBC /* RealmServer.swift in Sources */,
AC05380B2885B23E00CE27C4 /* RLMAsymmetricSyncServerTests.mm in Sources */,
5346E7322487AC9D00595C68 /* RLMBSONTests.mm in Sources */,
530BA61626DFA1CB008FC550 /* RLMChildProcessEnvironment.m in Sources */,
CF08757D260B98E100B9BE60 /* RLMCollectionSyncTests.mm in Sources */,
ACB6FD37273C61040009712F /* RLMFlexibleSyncServerTests.mm in Sources */,
3F2B40CD2B2900DA00E30319 /* RLMMongoClientTests.mm in Sources */,
3F558C9422C29A03002F0F30 /* RLMMultiProcessTestCase.m in Sources */,
AC7D182D261F2F560080E1D2 /* RLMObjectServerPartitionTests.mm in Sources */,
E8267FF11D90B8E700E001C7 /* RLMObjectServerTests.mm in Sources */,
531F9570279070A900E497F1 /* RLMServerTestObjects.m in Sources */,
3F2B40CC2B2900DA00E30319 /* RLMSubscriptionTests.mm in Sources */,
1AA5AE9C1D98A68E00ED8C27 /* RLMSyncTestCase.mm in Sources */,
3F558C9022C29A03002F0F30 /* RLMTestCase.m in Sources */,
1A1536481DB0408A00C0EC93 /* RLMUser+ObjectServerTests.mm in Sources */,
Expand Down
Loading

0 comments on commit a73034c

Please sign in to comment.