Skip to content

Commit

Permalink
Disabled blob sindex testing on server versions less than 7.0
Browse files Browse the repository at this point in the history
Disabled blob sindex testing on server versions less than 7.0
  • Loading branch information
DomPeliniAerospike committed Nov 2, 2023
1 parent 4fe4794 commit 09f30b2
Showing 1 changed file with 29 additions and 27 deletions.
56 changes: 29 additions & 27 deletions test/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,33 +141,35 @@ describe('Queries', function () {
['qidxAggregateMapDoubleNested', 'nested', STRING, MAPKEYS, new Context().addMapKey('doubleNested')]
]

describe('server version 7.0.0 and later', function () {
helper.skipUnlessVersion('>= 7.0.0', this)
context('Adds blob records and indexes', function () {
samples.push({ name: 'blob match', blob: Buffer.from('guava') })
samples.push({ name: 'blob non-match', blob: Buffer.from('pumpkin') })
samples.push({ name: 'blob list match', lblob: [Buffer.from('guava'), Buffer.from('papaya')] })
samples.push({ name: 'blob list non-match', lblob: [Buffer.from('pumpkin'), Buffer.from('turnip')] })
samples.push({ name: 'blob map match', mblob: { a: Buffer.from('guava'), b: Buffer.from('papaya') } })
samples.push({ name: 'blob map non-match', mblob: { a: Buffer.from('pumpkin'), b: Buffer.from('turnip') } })
samples.push({ name: 'blob mapkeys match', mkblob: new Map([[Buffer.from('guava'), 1], [Buffer.from('papaya'), 2]]) })
samples.push({ name: 'blob mapkeys non-match', mkblob: new Map([[Buffer.from('pumpkin'), 3], [Buffer.from('turnip'), 4]]) })
samples.push({ name: 'nested blob match', blob: { nested: Buffer.from('guava') } })
samples.push({ name: 'nested blob non-match', blob: { nested: Buffer.from('pumpkin') } })
samples.push({ name: 'nested blob list match', lblob: { nested: [Buffer.from('guava'), Buffer.from('papaya')] } })
samples.push({ name: 'nested blob list non-match', lblob: { nested: [Buffer.from('pumpkin'), Buffer.from('turnip')] } })
samples.push({ name: 'nested blob map match', mblob: { nested: { a: Buffer.from('guava'), b: Buffer.from('papaya') } } })
samples.push({ name: 'nested blob map non-match', mblob: { nested: { a: Buffer.from('pumpkin'), b: Buffer.from('turnip') } } })
samples.push({ name: 'nested blob mapkeys match', mkblob: { nested: new Map([[Buffer.from('guava'), 1], [Buffer.from('papaya'), 2]]) } })
samples.push({ name: 'nested blob mapkeys non-match', mkblob: { nested: new Map([[Buffer.from('pumpkin'), 3], [Buffer.from('turnip'), 4]]) } })

indexes.push(['qidxBlob', 'blob', BLOB])
indexes.push(['qidxBlobList', 'lblob', BLOB, LIST])
indexes.push(['qidxBlobMap', 'mblob', BLOB, MAPVALUES])
indexes.push(['qidxBlobMapKeys', 'mkblob', BLOB, MAPKEYS])
indexes.push(['qidxBlobListNested', 'lblob', BLOB, LIST, new Context().addMapKey('nested')])
indexes.push(['qidxBlobMapNested', 'mblob', BLOB, MAPVALUES, new Context().addMapKey('nested')])
indexes.push(['qidxBlobMapKeysNested', 'mkblob', BLOB, MAPKEYS, new Context().addMapKey('nested')])
describe('Additional test data', function () {
context('server version 7.0.0 and later', function () {
helper.skipUnlessVersion('>= 7.0.0', this)
it('Adds blob records and indexes', function () {
samples.push({ name: 'blob match', blob: Buffer.from('guava') })
samples.push({ name: 'blob non-match', blob: Buffer.from('pumpkin') })
samples.push({ name: 'blob list match', lblob: [Buffer.from('guava'), Buffer.from('papaya')] })
samples.push({ name: 'blob list non-match', lblob: [Buffer.from('pumpkin'), Buffer.from('turnip')] })
samples.push({ name: 'blob map match', mblob: { a: Buffer.from('guava'), b: Buffer.from('papaya') } })
samples.push({ name: 'blob map non-match', mblob: { a: Buffer.from('pumpkin'), b: Buffer.from('turnip') } })
samples.push({ name: 'blob mapkeys match', mkblob: new Map([[Buffer.from('guava'), 1], [Buffer.from('papaya'), 2]]) })
samples.push({ name: 'blob mapkeys non-match', mkblob: new Map([[Buffer.from('pumpkin'), 3], [Buffer.from('turnip'), 4]]) })
samples.push({ name: 'nested blob match', blob: { nested: Buffer.from('guava') } })
samples.push({ name: 'nested blob non-match', blob: { nested: Buffer.from('pumpkin') } })
samples.push({ name: 'nested blob list match', lblob: { nested: [Buffer.from('guava'), Buffer.from('papaya')] } })
samples.push({ name: 'nested blob list non-match', lblob: { nested: [Buffer.from('pumpkin'), Buffer.from('turnip')] } })
samples.push({ name: 'nested blob map match', mblob: { nested: { a: Buffer.from('guava'), b: Buffer.from('papaya') } } })
samples.push({ name: 'nested blob map non-match', mblob: { nested: { a: Buffer.from('pumpkin'), b: Buffer.from('turnip') } } })
samples.push({ name: 'nested blob mapkeys match', mkblob: { nested: new Map([[Buffer.from('guava'), 1], [Buffer.from('papaya'), 2]]) } })
samples.push({ name: 'nested blob mapkeys non-match', mkblob: { nested: new Map([[Buffer.from('pumpkin'), 3], [Buffer.from('turnip'), 4]]) } })

indexes.push(['qidxBlob', 'blob', BLOB])
indexes.push(['qidxBlobList', 'lblob', BLOB, LIST])
indexes.push(['qidxBlobMap', 'mblob', BLOB, MAPVALUES])
indexes.push(['qidxBlobMapKeys', 'mkblob', BLOB, MAPKEYS])
indexes.push(['qidxBlobListNested', 'lblob', BLOB, LIST, new Context().addMapKey('nested')])
indexes.push(['qidxBlobMapNested', 'mblob', BLOB, MAPVALUES, new Context().addMapKey('nested')])
indexes.push(['qidxBlobMapKeysNested', 'mkblob', BLOB, MAPKEYS, new Context().addMapKey('nested')])
})
})
})

Expand Down

0 comments on commit 09f30b2

Please sign in to comment.