Skip to content

Commit 19ace38

Browse files
committed
Hide realtime pipelines
1 parent ffebd5b commit 19ace38

File tree

8 files changed

+11
-677
lines changed

8 files changed

+11
-677
lines changed

Firestore/Example/Firestore.xcodeproj/project.pbxproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,6 @@
153153
128F2B032E254E2C0006327E /* QueryToPipelineTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 128F2B002E254E2C0006327E /* QueryToPipelineTests.swift */; };
154154
1290FA77A922B76503AE407C /* lru_garbage_collector_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 277EAACC4DD7C21332E8496A /* lru_garbage_collector_test.cc */; };
155155
1291D9F5300AFACD1FBD262D /* array_sorted_map_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 54EB764C202277B30088B8F3 /* array_sorted_map_test.cc */; };
156-
1296CECE2DEE97F5007F8552 /* RealtimePipelineTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1296CECD2DEE97EF007F8552 /* RealtimePipelineTests.swift */; };
157-
1296CECF2DEE97F5007F8552 /* RealtimePipelineTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1296CECD2DEE97EF007F8552 /* RealtimePipelineTests.swift */; };
158-
1296CED02DEE97F5007F8552 /* RealtimePipelineTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1296CECD2DEE97EF007F8552 /* RealtimePipelineTests.swift */; };
159156
129A369A28CA555B005AE7E2 /* FIRCountTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 129A369928CA555B005AE7E2 /* FIRCountTests.mm */; };
160157
129A369B28CA555B005AE7E2 /* FIRCountTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 129A369928CA555B005AE7E2 /* FIRCountTests.mm */; };
161158
129A369C28CA555B005AE7E2 /* FIRCountTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 129A369928CA555B005AE7E2 /* FIRCountTests.mm */; };
@@ -1920,7 +1917,6 @@
19201917
1235769422B86E65007DDFA9 /* FirestoreEncoderTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FirestoreEncoderTests.swift; sourceTree = "<group>"; };
19211918
124C932B22C1642C00CA8C2D /* CodableIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableIntegrationTests.swift; sourceTree = "<group>"; };
19221919
128F2B002E254E2C0006327E /* QueryToPipelineTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QueryToPipelineTests.swift; sourceTree = "<group>"; };
1923-
1296CECD2DEE97EF007F8552 /* RealtimePipelineTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RealtimePipelineTests.swift; sourceTree = "<group>"; };
19241920
129A369928CA555B005AE7E2 /* FIRCountTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FIRCountTests.mm; sourceTree = "<group>"; };
19251921
12F4357299652983A615F886 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
19261922
132E32997D781B896672D30A /* reference_set_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = reference_set_test.cc; sourceTree = "<group>"; };
@@ -2503,7 +2499,6 @@
25032499
861684E49DAC993D153E60D0 /* PipelineTests.swift */,
25042500
621D620928F9CE7400D2FA26 /* QueryIntegrationTests.swift */,
25052501
128F2B002E254E2C0006327E /* QueryToPipelineTests.swift */,
2506-
1296CECD2DEE97EF007F8552 /* RealtimePipelineTests.swift */,
25072502
4D65F6E69993611D47DC8E7C /* SnapshotListenerSourceTests.swift */,
25082503
EFF22EA92C5060A4009A369B /* VectorIntegrationTests.swift */,
25092504
);
@@ -4983,7 +4978,6 @@
49834978
655F8647F57E5F2155DFF7B5 /* PipelineTests.swift in Sources */,
49844979
621D620C28F9CE7400D2FA26 /* QueryIntegrationTests.swift in Sources */,
49854980
128F2B022E254E2C0006327E /* QueryToPipelineTests.swift in Sources */,
4986-
1296CECF2DEE97F5007F8552 /* RealtimePipelineTests.swift in Sources */,
49874981
1CFBD4563960D8A20C4679A3 /* SnapshotListenerSourceTests.swift in Sources */,
49884982
EE4C4BE7F93366AE6368EE02 /* TestHelper.swift in Sources */,
49894983
EFF22EAC2C5060A4009A369B /* VectorIntegrationTests.swift in Sources */,
@@ -5265,7 +5259,6 @@
52655259
C8C2B945D84DD98391145F3F /* PipelineTests.swift in Sources */,
52665260
621D620B28F9CE7400D2FA26 /* QueryIntegrationTests.swift in Sources */,
52675261
128F2B032E254E2C0006327E /* QueryToPipelineTests.swift in Sources */,
5268-
1296CECE2DEE97F5007F8552 /* RealtimePipelineTests.swift in Sources */,
52695262
A0BC30D482B0ABD1A3A24CDC /* SnapshotListenerSourceTests.swift in Sources */,
52705263
A78366DBE0BFDE42474A728A /* TestHelper.swift in Sources */,
52715264
EFF22EAB2C5060A4009A369B /* VectorIntegrationTests.swift in Sources */,
@@ -5829,7 +5822,6 @@
58295822
E04CB0D580980748D5DC453F /* PipelineTests.swift in Sources */,
58305823
621D620A28F9CE7400D2FA26 /* QueryIntegrationTests.swift in Sources */,
58315824
128F2B012E254E2C0006327E /* QueryToPipelineTests.swift in Sources */,
5832-
1296CED02DEE97F5007F8552 /* RealtimePipelineTests.swift in Sources */,
58335825
B00F8D1819EE20C45B660940 /* SnapshotListenerSourceTests.swift in Sources */,
58345826
AD34726BFD3461FF64BBD56D /* TestHelper.swift in Sources */,
58355827
EFF22EAA2C5060A4009A369B /* VectorIntegrationTests.swift in Sources */,

Firestore/Example/Tests/Integration/API/FIRAggregateTests.mm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,9 @@ - (void)testCannotPerformMoreThanMaxAggregations {
516516
[self awaitExpectation:expectation];
517517

518518
XCTAssertNotNil(result);
519-
XCTAssertTrue([[result localizedDescription] containsString:@"maximum number of aggregations"]);
519+
if (!FSTIntegrationTestCase.isRunningAgainstEmulator) {
520+
XCTAssertTrue([[result localizedDescription] containsString:@"maximum number of aggregations"]);
521+
}
520522
}
521523

522524
- (void)testThrowsAnErrorWhenGettingTheResultOfAnUnrequestedAggregation {

Firestore/Swift/Source/SwiftAPI/Firestore+Pipeline.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import Foundation
3030
}
3131

3232
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
33-
@nonobjc func realtimePipeline() -> PipelineSource<RealtimePipeline> {
33+
@nonobjc internal func realtimePipeline() -> PipelineSource<RealtimePipeline> {
3434
return PipelineSource<RealtimePipeline>(db: self) { stages, db in
3535
RealtimePipeline(stages: stages, db: db)
3636
}

Firestore/Swift/Source/SwiftAPI/Pipeline/RealtimePipeline.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import Foundation
2121

2222
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
23-
public struct PipelineListenOptions: Sendable, Equatable, Hashable {
23+
struct PipelineListenOptions: Sendable, Equatable, Hashable {
2424
// MARK: - Stored Properties
2525

2626
/// The desired behavior for handling pending server timestamps.
@@ -68,7 +68,7 @@ public struct PipelineListenOptions: Sendable, Equatable, Hashable {
6868
}
6969

7070
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
71-
public struct RealtimePipeline: @unchecked Sendable {
71+
struct RealtimePipeline: @unchecked Sendable {
7272
private var stages: [Stage]
7373

7474
let bridge: RealtimePipelineBridge

Firestore/Swift/Source/SwiftAPI/Pipeline/RealtimePipelineSnapshot.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import Foundation
2121

2222
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
23-
public struct RealtimePipelineSnapshot: Sendable {
23+
struct RealtimePipelineSnapshot: Sendable {
2424
/// The Pipeline on which `execute()` was called to obtain this `PipelineSnapshot`.
2525
public let pipeline: RealtimePipeline
2626

@@ -51,7 +51,7 @@ public struct RealtimePipelineSnapshot: Sendable {
5151
}
5252

5353
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
54-
public struct PipelineResultChange: Sendable {
54+
struct PipelineResultChange: Sendable {
5555
public enum ChangeType {
5656
case added, modified, removed
5757
}

Firestore/Swift/Tests/Integration/AggregationIntegrationTests.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ class AggregationIntegrationTests: FSTIntegrationTestCase {
9090
XCTFail("Error expected.")
9191
} catch let error as NSError {
9292
XCTAssertNotNil(error)
93-
XCTAssertTrue(error.localizedDescription.contains("maximum number of aggregations"))
93+
if !AggregationIntegrationTests.isRunningAgainstEmulator() {
94+
XCTAssertTrue(error.localizedDescription.contains("maximum number of aggregations"))
95+
}
9496
}
9597
}
9698

Firestore/Swift/Tests/Integration/QueryIntegrationTests.swift

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -332,41 +332,3 @@ class QueryIntegrationTests: FSTIntegrationTestCase {
332332
)
333333
}
334334
}
335-
336-
class QueryAsPipelineIntegrationTests: QueryIntegrationTests {
337-
override class var isRunningPipeline: Bool {
338-
return true
339-
}
340-
341-
override func check(_ coll: CollectionReference, query: Query,
342-
matchesResult expectedKeys: [String]) async throws {
343-
let collPipeline = coll.firestore.realtimePipeline().create(from: coll)
344-
var collIterator = collPipeline.snapshotStream().makeAsyncIterator()
345-
var _ = try await collIterator.next()
346-
347-
let pipeline = query.firestore.realtimePipeline().create(from: query)
348-
349-
var cacheIterator = pipeline.snapshotStream(options: .init(source: .cache)).makeAsyncIterator()
350-
let cacheSnapshot = try await cacheIterator.next()
351-
let cacheResultIds = cacheSnapshot?.results().map { $0.id }
352-
353-
var serverIterator = pipeline.snapshotStream(options: .init(
354-
includeMetadataChanges: true,
355-
source: .default
356-
)).makeAsyncIterator()
357-
var serverSnapshot = try await serverIterator.next()
358-
if serverSnapshot?.metadata.isFromCache == true {
359-
serverSnapshot = try await serverIterator.next()
360-
}
361-
let serverResultIds = serverSnapshot?.results().map { $0.id }
362-
363-
var remoteKeysIterator = pipeline.snapshotStream(options: .init(source: .cache))
364-
.makeAsyncIterator()
365-
let remoteKeysSnapshot = try await remoteKeysIterator.next()
366-
let remoteKeysResultIds = remoteKeysSnapshot?.results().map { $0.id }
367-
368-
XCTAssertEqual(cacheResultIds, serverResultIds)
369-
XCTAssertEqual(serverResultIds, remoteKeysResultIds)
370-
XCTAssertEqual(remoteKeysResultIds, expectedKeys)
371-
}
372-
}

0 commit comments

Comments
 (0)