Skip to content

Commit 25156db

Browse files
NODEJS-674 and NODEJS-677: CI for C* 4.1, 5.0, DSE-6.9 and HCD (#426)
Also includes fixes for NODEJS-678 (Add node.js 22.x to CI) and NODEJS-679 (CI of TypeScript Compilation fails due to [email protected])
1 parent f767bcc commit 25156db

File tree

9 files changed

+217
-119
lines changed

9 files changed

+217
-119
lines changed

Jenkinsfile

Lines changed: 57 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
def initializeEnvironment() {
5-
def nodeVersions = ['16': '16.20.2', '18': '18.17.1', '20': '20.5.1']
5+
def nodeVersions = ['18': '18.20.4', '20': '20.17.0', '22': '22.8.0']
66
env.DRIVER_DISPLAY_NAME = 'Cassandra Node.js Driver'
77
env.DRIVER_METRIC_TYPE = 'oss'
88
if (env.GIT_URL.contains('riptano/nodejs-driver')) {
@@ -19,6 +19,9 @@ def initializeEnvironment() {
1919
env.GITHUB_COMMIT_URL = "${GITHUB_PROJECT_URL}/commit/${env.GIT_COMMIT}"
2020
env.NODEJS_VERSION_FULL = nodeVersions[env.NODEJS_VERSION]
2121

22+
env.JAVA8_HOME="${JABBA_HOME}/jdk/1.8"
23+
env.JAVA11_HOME="${JABBA_HOME}/jdk/[email protected]"
24+
2225
sh label: 'Assign Node.js global environment', script: '''#!/bin/bash -lex
2326
nodenv versions
2427
echo "Using Node.js runtime ${NODEJS_VERSION} (${NODEJS_VERSION_FULL})"
@@ -38,13 +41,25 @@ CCM_CASSANDRA_VERSION=${DSE_FIXED_VERSION} # maintain for backwards compatibilit
3841
CCM_VERSION=${DSE_FIXED_VERSION}
3942
CCM_SERVER_TYPE=dse
4043
DSE_VERSION=${DSE_FIXED_VERSION}
41-
CCM_IS_DSE=true
44+
CCM_DISTRIBUTION=dse
4245
CCM_BRANCH=${DSE_FIXED_VERSION}
4346
DSE_BRANCH=${DSE_FIXED_VERSION}
4447
ENVIRONMENT_EOF
4548
'''
4649
}
4750

51+
if (env.CASSANDRA_VERSION.split('-')[0] == 'hcd'){
52+
env.HCD_FIXED_VERSION = env.CASSANDRA_VERSION.split('-')[1]
53+
sh label: 'Update environment for HCD', script: '''#!/bin/bash -le
54+
cat >> ${HOME}/environment.txt << ENVIRONMENT_EOF
55+
CCM_PATH=${HOME}/ccm
56+
CCM_CASSANDRA_VERSION=${HCD_FIXED_VERSION} # maintain for backwards compatibility
57+
CCM_VERSION=${HCD_FIXED_VERSION}
58+
CCM_DISTRIBUTION=hcd
59+
ENVIRONMENT_EOF
60+
'''
61+
}
62+
4863
sh label: 'Display Node.js and environment information', script: '''#!/bin/bash -le
4964
# Load CCM environment variables
5065
set -o allexport
@@ -201,6 +216,12 @@ def describeAdhocTestingStage() {
201216
}
202217
}
203218

219+
def describeInstallAndLint(){
220+
describePerCommitStage()
221+
installDriverAndDependencies()
222+
executeLinter()
223+
}
224+
204225
// branch pattern for cron
205226
def branchPatternCron() {
206227
~"(master)"
@@ -240,15 +261,19 @@ pipeline {
240261
</table>''')
241262
choice(
242263
name: 'ADHOC_BUILD_AND_EXECUTE_TESTS_NODEJS_VERSION',
243-
choices: ['16', '18', '20', 'ALL'],
264+
choices: ['18', '20', '22', 'ALL'],
244265
description: 'Node.js version to use for adhoc <b>BUILD-AND-EXECUTE-TESTS</b> <strong>ONLY!</strong>')
245266
choice(
246267
name: 'ADHOC_BUILD_AND_EXECUTE_TESTS_SERVER_VERSION',
247268
choices: [
248-
'3.11', // Current Apache Cassandra
249-
'4.0', // Development Apache Cassandra
269+
'3.11', // Previous Apache Cassandra
270+
'4.0', // Previous Apache Cassandra
271+
'4.1', // Previous Apache Cassandra
272+
'5.0', // Current Apache Cassandra
250273
'dse-5.1.35', // Legacy DataStax Enterprise
251-
'dse-6.8.30', // Development DataStax Enterprise
274+
'dse-6.8.30', // Previoius DataStax Enterprise
275+
'dse-6.9.0', // Current DataStax Enterprise
276+
'hcd-1.0.0', // HCD
252277
'ALL'],
253278
description: '''Apache Cassandra and DataStax Enterprise server version to use for adhoc <b>BUILD-AND-EXECUTE-TESTS</b> <strong>ONLY!</strong>
254279
<table style="width:100%">
@@ -326,14 +351,16 @@ pipeline {
326351
axes {
327352
axis {
328353
name 'CASSANDRA_VERSION'
329-
values '3.11', // Current Apache Cassandra
330-
'4.0', // Development Apache Cassandra
331-
'dse-5.1.35', // Legacy DataStax Enterprise
332-
'dse-6.8.30' // Development DataStax Enterprise
354+
values '3.11', // Previous Apache Cassandra
355+
'4.1', // Previous Apache Cassandra
356+
'5.0', // Current Apache Cassandra
357+
'dse-6.8.30', // Previous DataStax Enterprise
358+
'dse-6.9.0', // Current DataStax Enterprise
359+
'hcd-1.0.0' // HCD
333360
}
334361
axis {
335362
name 'NODEJS_VERSION'
336-
values '16', '18', '20'
363+
values '18', '20', '22'
337364
}
338365
}
339366

@@ -352,19 +379,9 @@ pipeline {
352379
}
353380
}
354381
}
355-
stage('Describe-Build') {
382+
stage('Describe-Install-And-Lint') {
356383
steps {
357-
describePerCommitStage()
358-
}
359-
}
360-
stage('Install-Driver-And-Dependencies') {
361-
steps {
362-
installDriverAndDependencies()
363-
}
364-
}
365-
stage('Execute-Linter') {
366-
steps {
367-
executeLinter()
384+
describeInstallAndLint()
368385
}
369386
}
370387
stage('Execute-Tests') {
@@ -419,14 +436,16 @@ pipeline {
419436
axes {
420437
axis {
421438
name 'CASSANDRA_VERSION'
422-
values '3.11', // Current Apache Cassandra
423-
'4.0', // Development Apache Cassandra
424-
'dse-5.1.35', // Legacy DataStax Enterprise
425-
'dse-6.8.30' // Development DataStax Enterprise
439+
values '3.11', // Previous Apache Cassandra
440+
'4.1', // Previous Apache Cassandra
441+
'5.0', // Current Apache Cassandra
442+
'dse-6.8.30', // Previous DataStax Enterprise
443+
'dse-6.9.0', // Current DataStax Enterprise
444+
'hcd-1.0.0' // HCD
426445
}
427446
axis {
428447
name 'NODEJS_VERSION'
429-
values '16', '18', '20'
448+
values '18', '20', '22'
430449
}
431450
}
432451

@@ -445,19 +464,9 @@ pipeline {
445464
}
446465
}
447466
}
448-
stage('Describe-Build') {
449-
steps {
450-
describeScheduledTestingStage()
451-
}
452-
}
453-
stage('Install-Driver-And-Dependencies') {
454-
steps {
455-
installDriverAndDependencies()
456-
}
457-
}
458-
stage('Execute-Linter') {
467+
stage('Describe-Install-And-Lint') {
459468
steps {
460-
executeLinter()
469+
describeInstallAndLint()
461470
}
462471
}
463472
stage('Execute-Tests') {
@@ -486,12 +495,6 @@ pipeline {
486495
aborted {
487496
notifySlack('aborted')
488497
}
489-
success {
490-
notifySlack('completed')
491-
}
492-
unstable {
493-
notifySlack('unstable')
494-
}
495498
failure {
496499
notifySlack('FAILED')
497500
}
@@ -510,14 +513,17 @@ pipeline {
510513
axes {
511514
axis {
512515
name 'CASSANDRA_VERSION'
513-
values '3.11', // Current Apache Cassandra
514-
'4.0', // Development Apache Cassandra
515-
'dse-5.1.35', // Legacy DataStax Enterprise
516-
'dse-6.8.30' // Development DataStax Enterprise
516+
values '3.11', // Previous Apache Cassandra
517+
'4.1', // Previous Apache Cassandra
518+
'5.0', // Current Apache Cassandra
519+
'dse-6.8.30', // Previous DataStax Enterprise
520+
'dse-6.9.0', // Current DataStax Enterprise
521+
'hcd-1.0.0' // HCD
522+
517523
}
518524
axis {
519525
name 'NODEJS_VERSION'
520-
values '16', '18', '20'
526+
values '18', '20', '22'
521527
}
522528
}
523529
when {

package-lock.json

Lines changed: 21 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"types": "./index.d.ts",
2222
"dependencies": {
2323
"@types/long": "~5.0.0",
24-
"@types/node": ">=8",
24+
"@types/node": "^18.11.18",
2525
"adm-zip": "~0.5.10",
2626
"long": "~5.2.3"
2727
},

test/integration/short/control-connection-tests.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ describe('ControlConnection', function () {
121121

122122
// While the host is started, it's not a given that it will have been connected and marked up,
123123
// wait for that to be the case.
124-
await helper.wait.forNodeToBeAdded(cc.hosts, 3);
124+
await helper.wait.forNodeToBeAdded(cc.hosts, 3, 5000, 200);
125125
await helper.wait.forNodeUp(cc.hosts, 3);
126126

127127
const countUp = cc.hosts.values().reduce((value, host) => value + (host.isUp() ? 1 : 0), 0);
@@ -220,7 +220,7 @@ describe('ControlConnection', function () {
220220

221221
// restart node 2 and make sure it comes up.
222222
await util.promisify(helper.ccmHelper.startNode)(2);
223-
await helper.wait.forNodeUp(cc.hosts, 2);
223+
await helper.wait.forNodeUp(cc.hosts, 2, 5000, 200);
224224

225225
// check that host 1 is down, host 2 is up and the control connection is to host 2.
226226
cc.hosts.forEach(h => {
@@ -232,7 +232,7 @@ describe('ControlConnection', function () {
232232
}
233233
});
234234

235-
await helper.wait.until(() => cc.host);
235+
await helper.wait.until(() => cc.host, 5000, 200);
236236

237237
assert.strictEqual(helper.lastOctetOf(cc.host), '2');
238238
});

test/integration/short/geometry/polygon-tests.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,12 @@ vdescribe('dse-5.0', 'Polygon @SERVER_API', function () {
130130
normalizedCoordinates.push([c[0], c[2], c[1], c[3]]);
131131
}
132132
}
133-
assert.deepEqual(normalizedCoordinates, polygon.toJSON().coordinates);
133+
if (helper.isDseGreaterThan('6.9')) {
134+
//TODO: find documentation
135+
assert.deepEqual(value, polygon.toJSON());
136+
}else{
137+
assert.deepEqual(normalizedCoordinates, polygon.toJSON().coordinates);
138+
}
134139
eachNext();
135140
});
136141
});

test/integration/short/graph/graph-olap-tests.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,21 @@ vdescribe('dse-5.0', 'Client with spark workload', function () {
134134
{loadBalancing: new DefaultLoadBalancingPolicy(), graphOptions: {source: 'a'}})]}, true)
135135
);
136136
context('with no callback specified', function () {
137-
it('should return a promise for OLAP query', function () {
138-
const client = newInstance();
139-
const p = client.executeGraph('g.V().count()', { graphSource: 'a' });
140-
helper.assertInstanceOf(p, Promise);
141-
return p.then(function (result) {
142-
helper.assertInstanceOf(result, graphModule.GraphResultSet);
143-
assert.strictEqual(typeof result.first(), 'number');
144-
});
145-
});
137+
// if dse-6.9.0, skip this test because NODEJS-676 and DSP-24336
138+
if (helper.getServerInfo().version === '6.9.0' && helper.getServerInfo().isDse) {
139+
xit('should return a promise for OLAP query');
140+
} else {
141+
it(
142+
'should return a promise for OLAP query', function () {
143+
const client = newInstance();
144+
const p = client.executeGraph('g.V().count()', { graphSource: 'a' });
145+
helper.assertInstanceOf(p, Promise);
146+
return p.then(function (result) {
147+
helper.assertInstanceOf(result, graphModule.GraphResultSet);
148+
assert.strictEqual(typeof result.first(), 'number');
149+
});
150+
});
151+
}
146152
});
147153
});
148154
});

test/integration/short/graph/graph-tests.js

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -449,21 +449,26 @@ vdescribe('dse-5.0', 'Client @SERVER_API', function () {
449449
done();
450450
});
451451
}));
452-
it('should retrieve a Int64 scalar', wrapClient(function (client, done) {
453-
const query = JSON.stringify({
454-
'@type': 'g:Bytecode',
455-
'@value': {
456-
'step': [["V"], ["count"]]
457-
}
458-
});
459-
client.executeGraph(query, null, { graphLanguage: 'bytecode-json' }, function (err, result) {
460-
assert.ifError(err);
461-
helper.assertInstanceOf(result, graphModule.GraphResultSet);
462-
const count = result.first();
463-
helper.assertInstanceOf(count, types.Long);
464-
done();
465-
});
466-
}));
452+
// if dse-6.9.0, skip this test because NODEJS-676 and DSP-24336
453+
if (helper.getServerInfo().version === '6.9.0' && helper.getServerInfo().isDse) {
454+
it.skip('should retrieve a Int64 scalar');
455+
} else {
456+
it('should retrieve a Int64 scalar', wrapClient(function (client, done) {
457+
const query = JSON.stringify({
458+
'@type': 'g:Bytecode',
459+
'@value': {
460+
'step': [["V"], ["count"]]
461+
}
462+
});
463+
client.executeGraph(query, null, { graphLanguage: 'bytecode-json' }, function (err, result) {
464+
assert.ifError(err);
465+
helper.assertInstanceOf(result, graphModule.GraphResultSet);
466+
const count = result.first();
467+
helper.assertInstanceOf(count, types.Long);
468+
done();
469+
});
470+
}));
471+
}
467472
it('should allow graph language to be set from the execution profile', wrapClient(function (client, done) {
468473
const query = JSON.stringify({
469474
'@type': 'g:Bytecode',
@@ -480,7 +485,7 @@ vdescribe('dse-5.0', 'Client @SERVER_API', function () {
480485
});
481486
done();
482487
});
483-
}, { profiles: [ new ExecutionProfile('graph-profile1', { graphOptions: { language: 'bytecode-json' } }) ]}));
488+
}, { profiles: [new ExecutionProfile('graph-profile1', { graphOptions: { language: 'bytecode-json' } })] }));
484489
});
485490
});
486491
it('should use list as a parameter', wrapClient(function(client, done) {

0 commit comments

Comments
 (0)