Skip to content

Commit

Permalink
Add skipped check before asserting in CompactPublicAPIsTest.afterEach (
Browse files Browse the repository at this point in the history
…#1398)

* Add skipped check before asserting in CompactPublicAPIsTest.afterEach

* Reviews

* Reviews
  • Loading branch information
srknzl committed Oct 11, 2022
1 parent 68424b1 commit 7fdd497
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ describe('CompactPublicAPIsTest', function () {
let employee;
let SchemaNotReplicatedError;
let clientConfig;
let skipped = false;

const CLUSTER_CONFIG_XML = `
<hazelcast xmlns="http://www.hazelcast.com/schema/config"
Expand All @@ -191,10 +192,12 @@ describe('CompactPublicAPIsTest', function () {
TestUtil.markClientVersionAtLeast(this, '5.1.0');
employee = new CompactUtil.Employee(1, Long.ONE);
if ((await TestUtil.compareServerVersionWithRC(RC, '5.1.0')) < 0) {
skipped = true;
this.skip();
}
// Compact serialization 5.2 server is not compatible with clients older than 5.2
if ((await TestUtil.compareServerVersionWithRC(RC, '5.2.0')) >= 0 && !TestUtil.isClientVersionAtLeast('5.2.0')) {
skipped = true;
this.skip();
}
cluster = await testFactory.createClusterForParallelTests(null, CLUSTER_CONFIG_XML);
Expand All @@ -203,6 +206,7 @@ describe('CompactPublicAPIsTest', function () {
});

beforeEach(async function () {
skipped = false;
const name = TestUtil.randomString(12);

clientConfig = {
Expand Down Expand Up @@ -260,7 +264,9 @@ describe('CompactPublicAPIsTest', function () {
});

afterEach(async function () {
compactSerializerUsed.should.be.true;
if (!skipped) {
compactSerializerUsed.should.be.true;
}
sandbox.restore();
await map.destroy();
await nearCachedMap1.destroy();
Expand Down Expand Up @@ -404,7 +410,10 @@ describe('CompactPublicAPIsTest', function () {
});

it('removeAll', async function () {
TestUtil.markClientVersionAtLeast(this, '5.2.0');
if (!TestUtil.isClientVersionAtLeast('5.2.0')) {
skipped = true;
this.skip();
}
for (const obj of [map, nearCachedMap1, nearCachedMap2]) {
const fn = obj.removeAll.bind(obj, new CompactPredicate());
await fn();
Expand Down

0 comments on commit 7fdd497

Please sign in to comment.