You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Type returns PeerTypeCouchbaseLite if representing a Couchbase Lite 4.x client or PeerTypeCouchbaseLiteV3
221
+
// if representing a 3.x client.
194
222
func (p*CouchbaseLiteMockPeer) Type() PeerType {
195
-
returnPeerTypeCouchbaseLite
223
+
returnp.peerType
196
224
}
197
225
198
226
// IsSymmetricRedundant returns true if there is another peer set up that is identical to this one, and this peer doesn't need to participate in unique actions.
// CompareRevTreeOnly is true for a given topology when comparing only revtree is correct.
248
+
func (toTopology) CompareRevTreeOnly() bool {
249
+
for_, peer:=rangeto.peers.ActivePeers() {
250
+
ifpeer.Type() ==PeerTypeCouchbaseLiteV3 {
251
+
returntrue
252
+
}
253
+
}
254
+
returnfalse
255
+
}
256
+
244
257
// Run is equivalent to testing.T.Run() but updates the underlying TB to the new testing.T
245
258
// so that checks are made against the right instance (otherwise the outer test complains
246
259
// "subtest may have called FailNow on a parent test")
@@ -308,10 +321,27 @@ const (
308
321
PeerTypeCouchbaseServerPeerType=iota
309
322
// PeerTypeCouchbaseLite represents a Couchbase Lite peer. This is currently backed in memory but will be backed by in memory structure that will send and receive blip messages. Future expansion to real Couchbase Lite peer in CBG-4260.
310
323
PeerTypeCouchbaseLite
324
+
// PeerTypeCouchbaseLiteV3 represents a Couchbase Lite peer. This is currently backed in memory but will be backed by in memory structure that will send and receive blip messages. Future expansion to real Couchbase Lite peer in CBG-4260.
325
+
PeerTypeCouchbaseLiteV3
311
326
// PeerTypeSyncGateway represents a Sync Gateway peer backed by a RestTester.
312
327
PeerTypeSyncGateway
313
328
)
314
329
330
+
func (ptPeerType) String() string {
331
+
switchpt {
332
+
casePeerTypeCouchbaseServer:
333
+
return"Couchbase Server Peer"
334
+
casePeerTypeCouchbaseLite:
335
+
return"Couchbase Lite Peer"
336
+
casePeerTypeCouchbaseLiteV3:
337
+
return"Couchbase Lite V3 Peer"
338
+
casePeerTypeSyncGateway:
339
+
return"Sync Gateway Peer"
340
+
default:
341
+
returnfmt.Sprintf("Unknown Peer Type %d", pt)
342
+
}
343
+
}
344
+
315
345
// PeerBucketID represents a specific bucket for a test. This allows multiple Sync Gateway instances to point to the same bucket, or a different buckets. There is no significance to the numbering of the buckets. We can use as many buckets as the MainTestBucketPool allows.
assert.Equal(t, expected.RevTreeID, version.RevTreeID, "Actual revtree id does not match expected on %s for peer %s. Expected: %#v, Actual: %#v\nActual Body: %s\n%s", docID, p, expected, version, body, topology.GetDocState(t, dsName, docID))
0 commit comments