Skip to content

Commit

Permalink
cluster removal is not yet supported in release. Skip test if running…
Browse files Browse the repository at this point in the history
… on older server.
  • Loading branch information
aricart committed Mar 13, 2018
1 parent 426f7aa commit 2a53d06
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/dyncluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ describe('Dynamic Cluster - Connect URLs', function() {
});

nc.on('connect', function() {
if(!testVersion("1.0.7", nc)) {
done();
}
console.log(nc.info);
nc.servers.should.have.length(3);
countImplicit(nc).should.be.equal(1);

Expand All @@ -229,3 +233,23 @@ describe('Dynamic Cluster - Connect URLs', function() {
});


function parseVersion(verstr) {
// this will break
var a = verstr.split(".");
if(a.length > 3) {
a.splice(3, a.length - 3);
}
a[0] *= 100;
a[1] *= 10;

return a[0] + a[1] + a[2];
}

function testVersion(required, nc) {
var vers = parseVersion(nc.info.version);
var req = parseVersion(required);

return vers >= req;
}


0 comments on commit 2a53d06

Please sign in to comment.