Skip to content

Commit

Permalink
CI : testing correction
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Apr 17, 2018
1 parent 0d40ea6 commit a1d6924
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 24 deletions.
6 changes: 3 additions & 3 deletions appveyor.yml
Expand Up @@ -59,9 +59,9 @@ install:
- cmd: echo innodb_buffer_pool_size=200M >> c:\projects\server\data\my.ini
- cmd: echo character-set-server=utf8mb4 >> c:\projects\server\data\my.ini
- cmd: echo collation-server=utf8mb4_unicode_ci >> c:\projects\server\data\my.ini
- cmd: echo ssl-ca=c:/projects/mariadb-connector-nodejs/test/certificats/ca.crt >> c:\projects\server\data\my.ini
- cmd: echo ssl-cert=c:/projects/mariadb-connector-nodejs/test/certificats/server.crt >> c:\projects\server\data\my.ini
- cmd: echo ssl-key=c:/projects/mariadb-connector-nodejs/test/certificats/server.key >> c:\projects\server\data\my.ini
- cmd: echo ssl-ca=c:\\projects\\mariadb-connector-nodejs\\test\\certificats\\ca.crt >> c:\projects\server\data\my.ini
- cmd: echo ssl-cert=c:\\projects\\mariadb-connector-nodejs\\test\\certificats\\server.crt >> c:\projects\server\data\my.ini
- cmd: echo ssl-key=c:\\projects\\mariadb-connector-nodejs\\test\\certificats\\server.key >> c:\projects\server\data\my.ini
- cmd: echo enable-named-pipe=1 >> c:\projects\server\data\my.ini
- ps: Restart-Service "mariadb"
- ps: Install-Product node $env:nodejs_version
Expand Down
1 change: 0 additions & 1 deletion src/io/compression-output-stream.js
Expand Up @@ -118,7 +118,6 @@ class CompressionOutputStream {
//reset buffer
this.buf = this.smallBuffer;
this.pos = 7;

} else {
//*******************************************************************************
// compressing packet
Expand Down
1 change: 1 addition & 0 deletions test/base.js
Expand Up @@ -15,6 +15,7 @@ before("share initialization", done => {
} else {
console.log("connecting share connection : ");
console.log(connOptions);
console.log(" ");
let conn = new Connection(connOptions);
conn.connect(err => {
if (err) {
Expand Down
14 changes: 9 additions & 5 deletions test/integration/test-pipelining.js
Expand Up @@ -33,13 +33,17 @@ describe("pipelining", () => {
if (shareConn.hasMinVersion(10, 2, 0)) {
//before 10.1, speed is sometime nearly equivalent using pipelining or not
//remove speed test then to avoid random error in CIs
if (diff[0] < pipelineDiff[0] || (diff[0] === pipelineDiff[0] && diff[1] < pipelineDiff[1])) {
if (
diff[0] < pipelineDiff[0] ||
(diff[0] === pipelineDiff[0] && diff[1] < pipelineDiff[1])
) {
console.log(
"time to insert 1000 : std=" +
Math.floor(diff[0] * 1000 + diff[1] / 1000000) +
"ms pipelining=" +
Math.floor(pipelineDiff[0] * 1000 + pipelineDiff[1] / 1000000) +
"ms");
Math.floor(diff[0] * 1000 + diff[1] / 1000000) +
"ms pipelining=" +
Math.floor(pipelineDiff[0] * 1000 + pipelineDiff[1] / 1000000) +
"ms"
);
}
}
done();
Expand Down
30 changes: 15 additions & 15 deletions test/integration/test-ssl.js
Expand Up @@ -27,16 +27,14 @@ describe("ssl", function() {
} else {
//ssl is not enable on database, skipping test.
shareConn.query("SHOW VARIABLES LIKE 'ssl'", (err, rows) => {
console.log("ssl is not enable on database, skipping test :")
console.log("ssl is not enable on database, skipping test :");
for (let i = 0; i < rows.length; i++) {
console.log(rows[0]["Variable_name"] + " = " + rows[0]["Value"]);
}
done();
})

});
}
});

});

after(function(done) {
Expand All @@ -47,7 +45,7 @@ describe("ssl", function() {

it("signed certificate error ", function(done) {
if (!sslEnable) this.skip();
const conn = base.createConnection({ user:"ssltestUser", password:null, ssl: true });
const conn = base.createConnection({ user: "ssltestUser", password: null, ssl: true });
conn.connect(err => {
if (err) {
assert.isTrue(err.message.includes("self signed certificate"));
Expand All @@ -58,7 +56,6 @@ describe("ssl", function() {
});
});


it("signed certificate forcing", function(done) {
if (!sslEnable) this.skip();
const conn = base.createConnection({ ssl: { rejectUnauthorized: false } });
Expand All @@ -74,7 +71,11 @@ describe("ssl", function() {

it("ensure connection use SSL ", function(done) {
if (!sslEnable) this.skip();
const conn = base.createConnection({ user:"ssltestUser", password:null, ssl: { rejectUnauthorized: false } });
const conn = base.createConnection({
user: "ssltestUser",
password: null,
ssl: { rejectUnauthorized: false }
});
conn.connect(err => {
if (err) {
done(err);
Expand Down Expand Up @@ -290,10 +291,14 @@ describe("ssl", function() {
if (!shareConn.isMariaDB() && !shareConn.shareConn.hasMinVersion(5, 7, 10)) this.skip();
if (Conf.baseConfig.host !== "localhost") this.skip();

const conn = base.createConnection({host: "127.0.0.1", ssl: {ca: ca} });
const conn = base.createConnection({ host: "127.0.0.1", ssl: { ca: ca } });
conn.connect(err => {
if (err) {
assert.isTrue(err.message.includes("Hostname/IP doesn't match certificate's altnames: \"IP: 127.0.0.1 is not in the cert's list"));
assert.isTrue(
err.message.includes(
"Hostname/IP doesn't match certificate's altnames: \"IP: 127.0.0.1 is not in the cert's list"
)
);
done();
} else {
done(new Error("Must have thrown an exception !"));
Expand All @@ -312,14 +317,12 @@ describe("ssl", function() {
done(err);
} else {
const isWin = process.platform === "win32";
checkProtocol(conn, (isWin || !shareConn.isMariaDB()) ? "TLSv1.1" : "TLSv1.2");
checkProtocol(conn, isWin || !shareConn.isMariaDB() ? "TLSv1.1" : "TLSv1.2");
conn.end();
done();
}
});
});


});

function checkProtocol(conn, protocol) {
Expand All @@ -328,6 +331,3 @@ function checkProtocol(conn, protocol) {
assert.equal(conn._socket.getProtocol(), protocol);
}
}



0 comments on commit a1d6924

Please sign in to comment.