-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CBG-4253 create interfaces for integration testing #7112
Conversation
aa68be6
to
7c82870
Compare
7c82870
to
c23d887
Compare
topologytest/topologies.go
Outdated
peers: map[string]PeerOptions{ | ||
"cbs1": {Type: PeerTypeCouchbaseServer, BucketID: PeerBucketID1}, | ||
"sg1": {Type: PeerTypeSyncGateway, BucketID: PeerBucketID1}, | ||
"cbl1": {Type: PeerTypeCouchbaseLiteMock, BucketID: PeerBucketID1}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can/should BucketID be omitted for CBL peers?
topologytest/topologies.go
Outdated
peers: map[string]PeerOptions{ | ||
"cbs1": {Type: PeerTypeCouchbaseServer, BucketID: PeerBucketID1}, | ||
"sg1": {Type: PeerTypeSyncGateway, BucketID: PeerBucketID1}, | ||
"cbl1": {Type: PeerTypeCouchbaseLiteMock, BucketID: PeerBucketID1}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expected this to be PeerTypeCouchbaseLite (and CouchbaseLiteMock would be one possible implementation of that peer).
topologytest/sync_gateway_peer.go
Outdated
}) | ||
config := rt.NewDbConfig() | ||
config.AutoImport = base.BoolPtr(true) | ||
rest.RequireStatus(t, rt.CreateDatabase("db", config), http.StatusCreated) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should database name be name
instead of "db", or is db required?
- move code to _test.go - force removal of BucketID for couchbase lite peers - remove uneeded SyncGatewayPeerID, now defined at replication time - use a better name to define a database (since peer ids are unique, but test names are too long) - define CouchbaseLitePeerType but the only implementation is a mock peer
* CBG-4253 create interfaces for integration testing * fixups: - move code to _test.go - force removal of BucketID for couchbase lite peers - remove uneeded SyncGatewayPeerID, now defined at replication time - use a better name to define a database (since peer ids are unique, but test names are too long) - define CouchbaseLitePeerType but the only implementation is a mock peer
* CBG-4253 create interfaces for integration testing * fixups: - move code to _test.go - force removal of BucketID for couchbase lite peers - remove uneeded SyncGatewayPeerID, now defined at replication time - use a better name to define a database (since peer ids are unique, but test names are too long) - define CouchbaseLitePeerType but the only implementation is a mock peer
* CBG-4253 create interfaces for integration testing * fixups: - move code to _test.go - force removal of BucketID for couchbase lite peers - remove uneeded SyncGatewayPeerID, now defined at replication time - use a better name to define a database (since peer ids are unique, but test names are too long) - define CouchbaseLitePeerType but the only implementation is a mock peer
* CBG-4253 create interfaces for integration testing * fixups: - move code to _test.go - force removal of BucketID for couchbase lite peers - remove uneeded SyncGatewayPeerID, now defined at replication time - use a better name to define a database (since peer ids are unique, but test names are too long) - define CouchbaseLitePeerType but the only implementation is a mock peer
These tests are intended to support https://docs.google.com/document/d/1oiPwTNKkdBkWbACvwEBsc3EbVD-PCTO1s6WCNvtwY7k work for version vectors, but are general enough to support any type of testing that requires replication.
This package lives outside the rest package since it doesn't necessarily use a REST API at all (it can for 1.x replications) and this allows easy skipping of these tests. Even in a minimal form, they take 75 secs to run under Couchbase Server and 5 seconds for rosmar.
A few test bugs were fixed:
controller/createReplication
. Creating two unidirectional replications would cause one to fail.blip_client_test.go
code public in therest
package to facilitate moving to a separate package. Minor modifications were needed to allow callingNewBlipTesterClientOptsWithRT
outside ofbtcRunner.Run
, since the tests are not conceptually run under a blip tester, blip testing just happens to be included. The check forbtcRunner.Run
is used to be able to run withCBMobileReplicationV4
andCBMobileReplicationV3
in a loop correctly. With these tests, havingCBMobileReplicationV3
would probably be a separate flag for a couchbase peer. A single test can have multiple CouchbaseLitePeers unlike standard testing so creatingAllowCreationWithoutBlipTesterClientRunner
is used only for these tests.Integration Tests
GSI=true,xattrs=true
https://jenkins.sgwdev.com/job/SyncGateway-Integration/2714/