From 8739446fed70407079f528ceae4a2a093d913886 Mon Sep 17 00:00:00 2001 From: haoranchen Date: Sat, 11 Mar 2023 10:23:57 +0800 Subject: [PATCH] ci:Specify the version of the python connector (#20411) * ci:Specify the version of the python connector * ci:Specify the version of the windows python connector * fix: install specified version taospy * test: make auto_create_table_json.py robust --------- Co-authored-by: Shuduo Sang --- Jenkinsfile2 | 5 ++- .../taosbenchmark/auto_create_table_json.py | 32 +++++++++---------- .../json/rest_auto_create_table.json | 2 +- .../json/sml_auto_create_table.json | 2 +- .../json/stmt_auto_create_table.json | 2 +- tests/parallel_test/run_case.sh | 6 ++++ tests/parallel_test/run_container.sh | 2 -- 7 files changed, 27 insertions(+), 24 deletions(-) diff --git a/Jenkinsfile2 b/Jenkinsfile2 index 0177c57538..bb7fa70c57 100644 --- a/Jenkinsfile2 +++ b/Jenkinsfile2 @@ -313,7 +313,8 @@ def pre_test_build_win() { bat ''' cd %WIN_CONNECTOR_ROOT% python.exe -m pip install --upgrade pip - python -m pip install . + python -m pip uninstall taospy -y + python -m pip install taospy==2.7.6 xcopy /e/y/i/f %WIN_INTERNAL_ROOT%\\debug\\build\\lib\\taos.dll C:\\Windows\\System32 ''' return 1 @@ -331,8 +332,6 @@ def run_win_test() { bat ''' echo "windows test ..." cd %WIN_CONNECTOR_ROOT% - python.exe -m pip install --upgrade pip - python -m pip install . xcopy /e/y/i/f %WIN_INTERNAL_ROOT%\\debug\\build\\lib\\taos.dll C:\\Windows\\System32 ls -l C:\\Windows\\System32\\taos.dll time /t diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/auto_create_table_json.py b/tests/develop-test/5-taos-tools/taosbenchmark/auto_create_table_json.py index a6167158a2..9da678bf81 100644 --- a/tests/develop-test/5-taos-tools/taosbenchmark/auto_create_table_json.py +++ b/tests/develop-test/5-taos-tools/taosbenchmark/auto_create_table_json.py @@ -108,49 +108,49 @@ class TDTestCase: tdLog.info("%s" % cmd) os.system("%s" % cmd) tdSql.execute("reset query cache") - tdSql.query("select count(*) from (select distinct(tbname) from db.stb2)") + tdSql.query("select count(*) from (select distinct(tbname) from stmt_db.stb2)") tdSql.checkData(0, 0, 8) - tdSql.query("select count(*) from db.stb2") + tdSql.query("select count(*) from stmt_db.stb2") tdSql.checkData(0, 0, 160) - tdSql.query("select * from information_schema.ins_databases") - tdSql.checkData(2, 14, "us") + tdSql.query("select * from information_schema.ins_databases where name='stmt_db'") + tdSql.checkData(0, 14, "us") tdSql.execute("reset query cache") - tdSql.query("select count(*) from (select distinct(tbname) from db.`stb2-2`)") + tdSql.query("select count(*) from (select distinct(tbname) from stmt_db.`stb2-2`)") tdSql.checkData(0, 0, 8) - tdSql.query("select count(*) from db.`stb2-2`") + tdSql.query("select count(*) from stmt_db.`stb2-2`") tdSql.checkData(0, 0, 160) cmd = "%s -f ./5-taos-tools/taosbenchmark/json/rest_auto_create_table.json" %binPath tdLog.info("%s" % cmd) os.system("%s" % cmd) tdSql.execute("reset query cache") - tdSql.query("select count(*) from (select distinct(tbname) from db.stb3)") + tdSql.query("select count(*) from (select distinct(tbname) from rest_db.stb3)") tdSql.checkData(0, 0, 8) - tdSql.query("select count(*) from db.stb3") + tdSql.query("select count(*) from rest_db.stb3") tdSql.checkData(0, 0, 160) - tdSql.query("select * from information_schema.ins_databases") - tdSql.checkData(2, 14, "ns") + tdSql.query("select * from information_schema.ins_databases where name='rest_db'") + tdSql.checkData(0, 14, "ns") tdSql.execute("reset query cache") - tdSql.query("select count(*) from (select distinct(tbname) from db.`stb3-2`)") + tdSql.query("select count(*) from (select distinct(tbname) from rest_db.`stb3-2`)") tdSql.checkData(0, 0, 8) - tdSql.query("select count(*) from db.`stb3-2`") + tdSql.query("select count(*) from rest_db.`stb3-2`") tdSql.checkData(0, 0, 160) cmd = "%s -f ./5-taos-tools/taosbenchmark/json/sml_auto_create_table.json" %binPath tdLog.info("%s" % cmd) os.system("%s" % cmd) tdSql.execute("reset query cache") - tdSql.query("select count(*) from (select distinct(tbname) from db.stb4)") + tdSql.query("select count(*) from (select distinct(tbname) from sml_db.stb4)") tdSql.checkData(0, 0, 8) - tdSql.query("select count(*) from db.stb4") + tdSql.query("select count(*) from sml_db.stb4") tdSql.checkData(0, 0, 160) tdSql.execute("reset query cache") - tdSql.query("select count(*) from (select distinct(tbname) from db.`stb4-2`)") + tdSql.query("select count(*) from (select distinct(tbname) from sml_db.`stb4-2`)") tdSql.checkData(0, 0, 8) - tdSql.query("select count(*) from db.`stb4-2`") + tdSql.query("select count(*) from sml_db.`stb4-2`") tdSql.checkData(0, 0, 160) tAdapter.stop() diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/rest_auto_create_table.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/rest_auto_create_table.json index 868ff99842..9b99521f52 100644 --- a/tests/develop-test/5-taos-tools/taosbenchmark/json/rest_auto_create_table.json +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/rest_auto_create_table.json @@ -15,7 +15,7 @@ "num_of_records_per_req": 10, "databases": [{ "dbinfo": { - "name": "db", + "name": "rest_db", "drop": "yes", "replica": 1, "precision": "ns", diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/sml_auto_create_table.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/sml_auto_create_table.json index 1bbeca672b..7b87919a6d 100644 --- a/tests/develop-test/5-taos-tools/taosbenchmark/json/sml_auto_create_table.json +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/sml_auto_create_table.json @@ -15,7 +15,7 @@ "num_of_records_per_req": 10, "databases": [{ "dbinfo": { - "name": "db", + "name": "sml_db", "drop": "yes", "replica": 1, "precision": "ms", diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/stmt_auto_create_table.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/stmt_auto_create_table.json index e6e773f616..baf0384e46 100644 --- a/tests/develop-test/5-taos-tools/taosbenchmark/json/stmt_auto_create_table.json +++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/stmt_auto_create_table.json @@ -15,7 +15,7 @@ "num_of_records_per_req": 10, "databases": [{ "dbinfo": { - "name": "db", + "name": "stmt_db", "drop": "yes", "replica": 1, "precision": "us", diff --git a/tests/parallel_test/run_case.sh b/tests/parallel_test/run_case.sh index e0b905375a..95115bc437 100755 --- a/tests/parallel_test/run_case.sh +++ b/tests/parallel_test/run_case.sh @@ -69,6 +69,12 @@ ulimit -c unlimited md5sum /usr/lib/libtaos.so.1 md5sum /home/TDinternal/debug/build/lib/libtaos.so + +#define taospy 2.7.6 +pip3 list|grep taospy +pip3 uninstall taospy -y +pip3 install taospy==2.7.6 + $TIMEOUT_CMD $cmd RET=$? echo "cmd exit code: $RET" diff --git a/tests/parallel_test/run_container.sh b/tests/parallel_test/run_container.sh index b5deb09341..8ea2f249c1 100755 --- a/tests/parallel_test/run_container.sh +++ b/tests/parallel_test/run_container.sh @@ -130,8 +130,6 @@ docker run \ -v ${SOURCEDIR}:/usr/local/src/ \ -v "$TMP_DIR/thread_volume/$thread_no/sim:${SIM_DIR}" \ -v ${TMP_DIR}/thread_volume/$thread_no/coredump:$coredump_dir \ - -v $WORKDIR/taos-connector-python/taos:/usr/local/lib/python3.8/site-packages/taos:ro \ - -v $WORKDIR/taos-connector-python/taosrest:/usr/local/lib/python3.8/site-packages/taosrest:ro \ --rm --ulimit core=-1 taos_test:v1.0 $CONTAINER_TESTDIR/tests/parallel_test/run_case.sh -d "$exec_dir" -c "$cmd" $extra_param ret=$? exit $ret -- GitLab