From b7959906ef3620f208652beb9e708bec1400484c Mon Sep 17 00:00:00 2001 From: Dominic Pelini Date: Thu, 19 Dec 2024 06:47:06 -0700 Subject: [PATCH] Fixed test setup. --- test/test_helper.js | 8 ++++++++ ts-test/tests/mrt_api.ts | 3 +-- ts-test/tests/mrt_backward_compatible.ts | 8 ++++---- ts-test/tests/mrt_functionality.ts | 3 +-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/test/test_helper.js b/test/test_helper.js index 54358aa4..170cb703 100644 --- a/test/test_helper.js +++ b/test/test_helper.js @@ -221,6 +221,14 @@ exports.skipUnlessVersion = function (versionRange, ctx) { skipUnless(ctx, () => this.cluster.isVersionInRange(versionRange), `cluster version does not meet requirements: "${versionRange}"`) } +exports.skipUnlessVersionAndEnterprise = function (versionRange, ctx) { + skipUnless(ctx, () => {this.cluster.isVersionInRange(versionRange) && this.cluster.isEnterprise() }, `cluster version does not meet requirements: "${versionRange} and/or requires enterprise"`) +} + +exports.skipUnlessVersionAndCommunity = function (versionRange, ctx) { + skipUnless(ctx, () => {this.cluster.isVersionInRange(versionRange) && (!this.cluster.isEnterprise()) }, `cluster version does not meet requirements: "${versionRange} and/or requires enterprise"`) +} + exports.skipUnlessSupportsTtl = function (ctx) { skipUnless(ctx, () => this.cluster.supportsTtl(), 'test namespace does not support record TTLs') } diff --git a/ts-test/tests/mrt_api.ts b/ts-test/tests/mrt_api.ts index b3205e10..ae2727db 100644 --- a/ts-test/tests/mrt_api.ts +++ b/ts-test/tests/mrt_api.ts @@ -31,8 +31,7 @@ const recgen: any = helper.recgen const status: typeof statusModule = Aerospike.status describe('MRT API Tests', function () { - helper.skipUnlessVersion('>= 8.0.0', this) - helper.skipUnlessEnterprise(this) + helper.skipUnlessVersionAndEnterprise('>= 8.0.0', this) const client: Cli = helper.client diff --git a/ts-test/tests/mrt_backward_compatible.ts b/ts-test/tests/mrt_backward_compatible.ts index 47b86c94..57da5e98 100644 --- a/ts-test/tests/mrt_backward_compatible.ts +++ b/ts-test/tests/mrt_backward_compatible.ts @@ -31,8 +31,8 @@ const recgen: any = helper.recgen const status: typeof statusModule = Aerospike.status describe('MRT functionality tests', function () { - - helper.skipUnlessVersion('< 8.0.0', this) + helper.skipUnlessVersionAndCommunity('< 8.0.0', this) + const client: Cli = helper.client const key1: K = keygen.string(helper.namespace, helper.set, { prefix: 'test/mrt/1' })() @@ -87,8 +87,8 @@ describe('MRT functionality tests', function () { }; await client.put(key2, record2, meta, policy) - //await client.put(key3, record2, meta, policy) - //await client.put(key4, record2, meta, policy) + await client.put(key3, record2, meta, policy) + await client.put(key4, record2, meta, policy) let get_result: AerospikeRecord = await client.get(key2, policy) expect(get_result.bins).to.eql(record2) diff --git a/ts-test/tests/mrt_functionality.ts b/ts-test/tests/mrt_functionality.ts index 8fd4c6af..fae441ac 100644 --- a/ts-test/tests/mrt_functionality.ts +++ b/ts-test/tests/mrt_functionality.ts @@ -31,8 +31,7 @@ const recgen: any = helper.recgen const status: typeof statusModule = Aerospike.status describe('MRT functionality tests', function () { - helper.skipUnlessVersion('>= 8.0.0', this) - helper.skipUnlessEnterprise(this) + helper.skipUnlessVersionAndEnterprise('>= 8.0.0', this) const client: Cli = helper.client