Skip to content

Commit 7bcf85c

Browse files
committed
Turn off rev tree testing and turn on encrypted version vector
This will massively reduce testing time for modes that we no longer support
1 parent 90b7670 commit 7bcf85c

File tree

3 files changed

+6
-25
lines changed

3 files changed

+6
-25
lines changed

C/tests/c4Test.cc

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,8 @@ string C4Test::sReplicatorFixturesDir = "Replicator/tests/data/";
133133

134134
C4Test::C4Test(int num) : _storage(kC4SQLiteStorageEngine) { // NOLINT(cppcoreguidelines-pro-type-member-init)
135135
constexpr static TestOptions numToTestOption[] = {
136-
#if SkipVersionVectorTest
137-
RevTreeOption,
138-
EncryptedRevTreeOption
139-
#else
140-
RevTreeOption,
141136
VersionVectorOption,
142-
EncryptedRevTreeOption
143-
#endif
137+
EncryptedVersionVectorOption
144138
};
145139
static_assert(sizeof(numToTestOption) / sizeof(TestOptions) >= numberOfOptions);
146140
TestOptions testOption = numToTestOption[num];
@@ -203,7 +197,7 @@ C4Test::C4Test(int num) : _storage(kC4SQLiteStorageEngine) { // NOLINT(cppcoreg
203197
kRev4ID = C4STR("4-44444444");
204198
}
205199

206-
if ( testOption == EncryptedRevTreeOption ) {
200+
if ( testOption == EncryptedVersionVectorOption ) {
207201
_dbConfig.encryptionKey.algorithm = kC4EncryptionAES256;
208202
memcpy(_dbConfig.encryptionKey.bytes, "this is not a random key at all.", kC4EncryptionKeySizeAES256);
209203
}

C/tests/c4Test.hh

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -171,22 +171,13 @@ void C4ExpectException(C4ErrorDomain domain, int code, const std::function<void(
171171
/// and closes & deletes it in tearDown. Also checks for leaks of classes that are InstanceCounted.
172172
class C4Test {
173173
public:
174-
enum TestOptions { RevTreeOption = 0, VersionVectorOption, EncryptedRevTreeOption };
174+
enum TestOptions { VersionVectorOption = 0, EncryptedVersionVectorOption };
175175
#if defined(COUCHBASE_ENTERPRISE)
176-
# if SkipVersionVectorTest
177-
static constexpr int numberOfOptions = 2; // rev-tree, rev-tree encrypted
178-
static constexpr const char* nameOfOption[numberOfOptions] = {"RevTree", "EncryptedRevTree"};
179-
# else
180-
static constexpr int numberOfOptions = 3; // rev-tree, version vector, rev-tree encrypted
181-
static constexpr const char* nameOfOption[numberOfOptions] = {"RevTree", "VersionVector", "EncryptedRevTree"};
182-
# endif
176+
static constexpr int numberOfOptions = 2; // See nameOfOption
177+
static constexpr const char* nameOfOption[numberOfOptions] = {"VersionVector", "EncryptedVersionVector"};
183178
#else
184-
# if SkipVersionVectorTest
185179
static constexpr int numberOfOptions = 1; // rev-tree
186-
# else
187-
static constexpr int numberOfOptions = 2; // rev-tree, version vector
188-
# endif
189-
static constexpr const char* nameOfOption[2] = {"RevTree", "VersionVector"};
180+
static constexpr const char* nameOfOption[numberOfOptions] = {"VersionVector"};
190181
#endif
191182

192183
static std::string sFixturesDir; // directory where test files live

Replicator/tests/ReplicatorLoopbackTest.hh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,7 @@ class ReplicatorLoopbackTest
5353

5454
slice kNonLocalRev1ID, kNonLocalRev2ID, kNonLocalRev3ID, kConflictRev2AID, kConflictRev2BID;
5555

56-
#if SkipVersionVectorTest
5756
static constexpr int numberOfOptions = 1;
58-
#else
59-
static constexpr int numberOfOptions = 2;
60-
#endif
6157

6258
ReplicatorLoopbackTest(int which) : C4Test(which), db2(createDatabase("2")) {
6359
// Change tuning param so that tests will actually create deltas, despite using small

0 commit comments

Comments
 (0)