Skip to content

Commit f95f2fd

Browse files
committed
MLE-28498 Skip optic-fromDocs tests for < 12.1
After confirming with the MarkLogic Server team, op:from-docs is only supported in MLS 12.1 since it is a new feature. I have added a skip for anything lower than MLS 12.1
1 parent c9f3216 commit f95f2fd

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

test-basic/optic-fromDocs.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ let uris = [];
2020
let serverConfiguration = {};
2121

2222
describe('optic-update fromDocs tests', function() {
23+
// NOTE: op.fromDocs() with op.columnBuilder() is only supported in MarkLogic 12.1.0 and later.
24+
// Tests in this suite are skipped automatically on earlier versions.
2325

2426
this.timeout(15000);
2527
before(function (done) {
@@ -34,6 +36,10 @@ describe('optic-update fromDocs tests', function() {
3436
describe('fromDocs', function () {
3537

3638
before(function (done) {
39+
if (serverConfiguration.serverVersion < 12.1) {
40+
this.skip();
41+
return;
42+
}
3743
// Insert test documents
3844
const testDocs = [
3945
{
@@ -73,7 +79,7 @@ describe('optic-update fromDocs tests', function() {
7379
}
7480
},
7581
{
76-
// we already have a geospatial element index for 'point' in wgs84
82+
// we already have a geospatial element index for 'point' in wgs84
7783
// in the test-app ml-gradle project. Use that. Use 'point' to indicate location.
7884
uri: '/test/fromDocs/location-portland.json',
7985
contentType: 'application/json',
@@ -127,14 +133,14 @@ describe('optic-update fromDocs tests', function() {
127133
}
128134
}
129135
];
130-
136+
131137
let readable = new Stream.Readable({objectMode: true});
132138
testDocs.forEach(doc => {
133139
readable.push(doc);
134140
uris.push(doc.uri);
135141
});
136142
readable.push(null);
137-
143+
138144
db.documents.writeAll(readable, {
139145
onCompletion: () => done()
140146
});
@@ -252,7 +258,7 @@ describe('optic-update fromDocs tests', function() {
252258

253259
const portlandPoint = op.cts.point(45.52, -122.68);
254260
const searchRadius = 650; // miles
255-
// geospatial element index is defined for 'point' in wgs84
261+
// geospatial element index is defined for 'point' in wgs84
256262
const plan = op.fromDocs(
257263
op.cts.collectionQuery('fromDocs'),
258264
'/location',
@@ -270,7 +276,7 @@ describe('optic-update fromDocs tests', function() {
270276
['coordinate-system=wgs84']
271277
)
272278
);
273-
279+
274280
execPlan(plan).then(function (response) {
275281
const output = getResults(response);
276282
output.length.should.be.equal(3);
@@ -340,4 +346,4 @@ describe('optic-update fromDocs tests', function() {
340346

341347

342348
});
343-
});
349+
});

0 commit comments

Comments
 (0)