From d4e6b9aafce3c59d0656d90afa22fc337832c97c Mon Sep 17 00:00:00 2001 From: xiaolei li <85657333+xleili@users.noreply.github.com> Date: Tue, 14 Dec 2021 23:37:36 +0800 Subject: [PATCH] [TD-11519]:add nodejs sample to ci (#9035) * [TD-11519]:add nodejs sample to ci * add nodejs install * ci test 4th * ci test 5 * fix ident --- Jenkinsfile | 3 +++ src/connector/nodejs/test/testNanoseconds.js | 1 - src/connector/nodejs/test/testUnsignedType.js | 7 +++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 491e707428..2c2a766ecd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -476,6 +476,9 @@ pipeline { ''' sh ''' + cd ${WKC}/src/connector/nodejs + npm install + npm run test cd ${WKC}/tests/examples/nodejs npm install td2.0-connector > /dev/null 2>&1 node nodejsChecker.js host=localhost diff --git a/src/connector/nodejs/test/testNanoseconds.js b/src/connector/nodejs/test/testNanoseconds.js index 85a7600b01..c3089aab3e 100644 --- a/src/connector/nodejs/test/testNanoseconds.js +++ b/src/connector/nodejs/test/testNanoseconds.js @@ -3,7 +3,6 @@ var conn = taos.connect(); var c1 = conn.cursor(); let stime = new Date(); let interval = 1000; - function convertDateToTS(date) { let tsArr = date.toISOString().split("T") return "\"" + tsArr[0] + " " + tsArr[1].substring(0, tsArr[1].length - 1) + "\""; diff --git a/src/connector/nodejs/test/testUnsignedType.js b/src/connector/nodejs/test/testUnsignedType.js index 82413afeba..14b102972a 100644 --- a/src/connector/nodejs/test/testUnsignedType.js +++ b/src/connector/nodejs/test/testUnsignedType.js @@ -1,14 +1,13 @@ const taos = require('../tdengine'); var conn = taos.connect({ host: "127.0.0.1", user: "root", password: "taosdata", config: "/etc/taos", port: 10 }); var c1 = conn.cursor(); -executeUpdate("create database nodedb;"); +executeUpdate("create database if not exists nodedb;"); executeUpdate("use nodedb;"); -executeUpdate("create table unsigntest(ts timestamp,ut tinyint unsigned,us smallint unsigned,ui int unsigned,ub bigint unsigned,bi bigint);"); +executeUpdate("create table if not exists unsigntest(ts timestamp,ut tinyint unsigned,us smallint unsigned,ui int unsigned,ub bigint unsigned,bi bigint);"); executeUpdate("insert into unsigntest values (now, 254,65534,4294967294,18446744073709551614,9223372036854775807);"); executeUpdate("insert into unsigntest values (now, 0,0,0,0,-9223372036854775807);"); executeQuery("select * from unsigntest;"); -executeUpdate("drop database nodedb;"); - +executeUpdate("drop database if exists nodedb;"); function executeUpdate(sql) { console.log(sql); -- GitLab