Skip to content

Commit

Permalink
Fixed test setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
DomPeliniAerospike committed Dec 19, 2024
1 parent a361f08 commit b795990
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
8 changes: 8 additions & 0 deletions test/test_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down
3 changes: 1 addition & 2 deletions ts-test/tests/mrt_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions ts-test/tests/mrt_backward_compatible.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' })()
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions ts-test/tests/mrt_functionality.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b795990

Please sign in to comment.