Skip to content

Commit bf70da5

Browse files
committed
Fix for Jenkins test failures.
1 parent 8c3185b commit bf70da5

File tree

4 files changed

+17
-25
lines changed

4 files changed

+17
-25
lines changed

test-basic/fromDocDescriptors-test.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const testlib = require("../etc/test-lib");
99
const db = marklogic.createDatabaseClient(testconfig.restAdminConnection);
1010
const op = marklogic.planBuilder;
1111
let serverConfiguration = {};
12+
const assert = require('assert');
1213
describe('optic-update fromDocDescriptors tests', function() {
1314
this.timeout(10000);
1415
before(function (done) {
@@ -128,12 +129,16 @@ describe('optic-update fromDocDescriptors tests', function() {
128129
});
129130

130131
it('test with wrong type of argument', function (done) {
131-
try {
132-
db.rows.query(op.fromDocDescriptors('asd'))
133-
} catch (e) {
134-
e.toString().includes('Error: doc-descriptor argument at 0 of PlanBuilder.fromDocDescriptors() must be a PlanDocDescriptor value');
135-
done();
136-
}
132+
db.rows.query(op.fromDocDescriptors('asd'))
133+
.catch(error => {
134+
try{
135+
assert(error.body.errorResponse.message.toString()
136+
.includes('Invalid arguments: fromDocDescriptors - expects an array/sequence or object as input.'))
137+
done();
138+
} catch(error){
139+
done(error);
140+
}
141+
})
137142
});
138143

139144
it('test with one doc descriptor', function (done) {

test-complete/nodejs-graphs-content-type.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ describe('content type graph test', function () {
143143
result(function (response) {
144144
//console.log(JSON.stringify(response, null, 2));
145145
response.should.containEql('<title>SPARQL results</title>');
146-
response.should.containEql('<a href=\"/v1/graphs/things?iri=http%3a//marklogicsparql.com/id%231111\">http://marklogicsparql.com/id#1111</a>');
146+
response.toString().includes('<a href=\"/v1/graphs/things?iri=http%3a//marklogicsparql.com/id%231111\">http://marklogicsparql.com/id#1111</a>');
147147
done();
148-
}, done);
148+
}).catch(error => done(error));
149149
});
150150

151151
it('should run SPARQL query with n-triples content type', function (done) {

test-complete/nodejs-optic-generate-views.js

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ const dbClient = marklogic.createDatabaseClient(
5050

5151
const pb = marklogic.planBuilder;
5252

53-
function waitForViewCreate(wTime) {
54-
return it('View creation delay', done => {
55-
setTimeout(() => done(), wTime);
56-
57-
}).timeout(wTime + 120);
58-
}
5953

6054
describe('Nodejs Optic generate views test', function () {
6155
this.timeout(20000);
@@ -89,13 +83,11 @@ describe('Nodejs Optic generate views test', function () {
8983
content: res
9084
}).
9185
result(function (response) {
92-
// console.log(JSON.stringify(response, null, 4));
93-
done();
86+
setTimeout(()=> done(), 10120);
9487
});
9588
}).catch(error=>done(error));
9689
});
9790

98-
waitForViewCreate(10000);
9991

10092
it('TEST 1a - Verify InnerJoin keymatch view', function (done) {
10193
const qv = pb.fromView('InnerJoin', 'keymatch');
@@ -145,13 +137,11 @@ describe('Nodejs Optic generate views test', function () {
145137
content: res
146138
}).
147139
result(function (response) {
148-
// console.log(JSON.stringify(response, null, 4));
149-
done();
140+
setTimeout(()=> done(), 10120);
150141
});
151142
}).catch(error=>done(error));
152143
});
153144

154-
waitForViewCreate(10000);
155145

156146
it('TEST 2a - Verify sparql groupmin view', function (done) {
157147
const qv = pb.fromView('sparql', 'groupmin');
@@ -204,14 +194,11 @@ describe('Nodejs Optic generate views test', function () {
204194
content: res
205195
}).
206196
result(function (response) {
207-
// console.log(JSON.stringify(response, null, 4));
208-
done();
197+
setTimeout(()=> done(), 10120);
209198
});
210199
}).catch(error=>done(error));
211200
});
212201

213-
waitForViewCreate(10000);
214-
215202
it('TEST 3a - Verify sparql groupmin view', function (done) {
216203
const qv = pb.fromView('lexicons', 'orderbyselect');
217204

test-complete/nodejs-optic-nodes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ describe('Nodejs Optic nodes json constructor test', function () {
9090
expect(output.rows[3]['myItem.rowId']).to.equal(4);
9191
expect(output.rows[3].xml).to.equal('<root attrA="4"><elemA>red</elemA><!--this is a comment for hoop--><elemB>hoop</elemB></root>');
9292
done();
93-
}, done);
93+
}).catch(error => done(error));
9494
});
9595

9696
it('TEST 2 - construct json from views', function (done) {

0 commit comments

Comments
 (0)