Skip to content

Commit 5031056

Browse files
authored
[HZ-5350] Exclude CP tests with community (hazelcast#1579)
Exclude CP tests when ran with Hazelcast community. The enterpise environment is inferred solely using the `HAZELCAST_ENTERPRISE_KEY` environment variable.
1 parent 90627dd commit 5031056

9 files changed

Lines changed: 44 additions & 12 deletions

File tree

test/TestUtil.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,24 +159,20 @@ exports.fillMap = function (map, size = 10, keyPrefix = 'key', valuePrefix = 'va
159159
return map.putAll(entries);
160160
};
161161

162+
exports.isEnterprise = function() {
163+
return !!process.env.HAZELCAST_ENTERPRISE_KEY;
164+
}
165+
162166
exports.markCommunity = function (_this) {
163167
// the following two env vars are set in compat test suite
164-
if (process.env.SERVER_TYPE === 'enterprise' || process.env.HZ_TYPE === 'enterprise') {
165-
_this.skip();
166-
}
167-
168-
if (process.env.HAZELCAST_ENTERPRISE_KEY) {
168+
if (exports.isEnterprise()) {
169169
_this.skip();
170170
}
171171
};
172172

173173
exports.markEnterprise = function (_this) {
174174
// the following two env vars are set in compat test suite
175-
if (process.env.SERVER_TYPE === 'oss' || process.env.HZ_TYPE === 'oss') {
176-
_this.skip();
177-
}
178-
179-
if (!process.env.HAZELCAST_ENTERPRISE_KEY) {
175+
if (!exports.isEnterprise()) {
180176
_this.skip();
181177
}
182178
};

test/integration/backward_compatible/parallel/cpsubsystem/AtomicLongTest.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ describe('AtomicLongTest', function () {
3737
}
3838

3939
before(async function () {
40+
TestUtil.markEnterprise(this);
41+
if (!TestUtil.isEnterprise()) {
42+
return;
43+
}
4044
cluster = await testFactory.createClusterForParallelTests(null,
4145
fs.readFileSync(__dirname + '/hazelcast_cpsubsystem.xml', 'utf8'));
4246
const members = await Promise.all([

test/integration/backward_compatible/parallel/cpsubsystem/AtomicReferenceTest.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ describe('AtomicReferenceTest', function () {
3131
const testFactory = new TestUtil.TestFactory();
3232

3333
before(async function () {
34+
TestUtil.markEnterprise(this);
35+
if (!TestUtil.isEnterprise()) {
36+
return;
37+
}
3438
cluster = await testFactory.createClusterForParallelTests(null,
3539
fs.readFileSync(__dirname + '/hazelcast_cpsubsystem.xml', 'utf8'));
3640
const members = await Promise.all([

test/integration/backward_compatible/parallel/cpsubsystem/CountDownLatchTest.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ describe('CountDownLatchTest', function () {
4141
}
4242

4343
before(async function () {
44+
TestUtil.markEnterprise(this);
45+
if (!TestUtil.isEnterprise()) {
46+
return;
47+
}
4448
cluster = await testFactory.createClusterForParallelTests(null,
4549
fs.readFileSync(__dirname + '/hazelcast_cpsubsystem.xml', 'utf8'));
4650
const members = await Promise.all([

test/integration/backward_compatible/parallel/cpsubsystem/FencedLockTest.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ describe('FencedLockTest', function () {
6868
}
6969

7070
before(async function () {
71+
TestUtil.markEnterprise(this);
72+
if (!TestUtil.isEnterprise()) {
73+
return;
74+
}
7175
cluster = await testFactory.createClusterForParallelTests(null,
7276
fs.readFileSync(__dirname + '/hazelcast_cpsubsystem.xml', 'utf8'));
7377
members = await Promise.all([

test/integration/backward_compatible/parallel/cpsubsystem/SemaphoreCommonTest.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ describe('SemaphoreCommonTest', function () {
4141
}
4242

4343
before(async function () {
44+
TestUtil.markEnterprise(this);
45+
if (!TestUtil.isEnterprise()) {
46+
return;
47+
}
4448
cluster = await testFactory.createClusterForParallelTests(null,
4549
fs.readFileSync(__dirname + '/hazelcast_cpsubsystem.xml', 'utf8'));
4650
const members = await Promise.all([

test/integration/backward_compatible/parallel/cpsubsystem/SessionAwareSemaphoreTest.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ describe('SessionAwareSemaphoreTest', function () {
4040
}
4141

4242
before(async function () {
43+
TestUtil.markEnterprise(this);
44+
if (!TestUtil.isEnterprise()) {
45+
return;
46+
}
4347
cluster = await testFactory.createClusterForParallelTests(null,
4448
fs.readFileSync(__dirname + '/hazelcast_cpsubsystem.xml', 'utf8'));
4549
const members = await Promise.all([

test/integration/backward_compatible/parallel/cpsubsystem/SessionlessSemaphoreTest.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ describe('SessionlessSemaphoreTest', function () {
4040
}
4141

4242
before(async function () {
43+
TestUtil.markEnterprise(this);
44+
if (!TestUtil.isEnterprise()) {
45+
return;
46+
}
4347
cluster = await testFactory.createClusterForParallelTests(null,
4448
fs.readFileSync(__dirname + '/hazelcast_cpsubsystem.xml', 'utf8'));
4549
members = await Promise.all([

test/integration/backward_compatible/parallel/serialization/compact/CompactPublicAPIsTest.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,9 @@ describe('CompactPublicAPIsTest', function () {
255255
multimap = await client.getMultiMap(name);
256256
replicatedMap = await client.getReplicatedMap(name);
257257
list = await client.getList(name);
258-
atomicReference = await client.getCPSubsystem().getAtomicReference(name);
258+
if (TestUtil.isEnterprise()) {
259+
atomicReference = await client.getCPSubsystem().getAtomicReference(name);
260+
}
259261
queue = await client.getQueue(name);
260262
set = await client.getSet(name);
261263
topic = await client.getReliableTopic(name);
@@ -274,7 +276,9 @@ describe('CompactPublicAPIsTest', function () {
274276
await multimap.destroy();
275277
await replicatedMap.destroy();
276278
await list.destroy();
277-
await atomicReference.destroy();
279+
if (TestUtil.isEnterprise()) {
280+
await atomicReference.destroy();
281+
}
278282
await queue.destroy();
279283
await set.destroy();
280284
await topic.destroy();
@@ -933,6 +937,10 @@ describe('CompactPublicAPIsTest', function () {
933937
});
934938

935939
describe('AtomicReference', function () {
940+
before(function() {
941+
TestUtil.markEnterprise(this);
942+
});
943+
936944
it('compareAndSet', async function () {
937945
const fn = atomicReference.compareAndSet.bind(atomicReference, OUTER_INSTANCE, employee);
938946
await fn();

0 commit comments

Comments
 (0)