From c68c1e320123c83136aba1408bc43e0842f991c3 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Mon, 12 Aug 2024 19:56:11 +0800 Subject: [PATCH 01/13] test:set debug in address sanitizer model --- tests/ci/Dockerfile | 24 +++++++++++++----------- tests/parallel_test/container_build.sh | 12 +++++++----- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/tests/ci/Dockerfile b/tests/ci/Dockerfile index 213570dfb2..8381f1bb57 100644 --- a/tests/ci/Dockerfile +++ b/tests/ci/Dockerfile @@ -1,9 +1,14 @@ FROM python:3.8 -RUN pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple -RUN pip3 install pandas psutil fabric2 requests faker simplejson toml pexpect tzlocal distro -RUN apt-get update -RUN apt-get install -y psmisc sudo tree libgeos-dev libjansson-dev libsnappy-dev liblzma-dev libz-dev zlib1g pkg-config build-essential valgrind \ - vim libjemalloc-dev openssh-server screen sshpass net-tools dirmngr gnupg apt-transport-https ca-certificates software-properties-common r-base iputils-ping +COPY sources.list /etc/apt/ +COPY id_ecdsa /root/.ssh/id_ecdsa +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C +RUN apt-get update +RUN apt-get install -y locales psmisc sudo tree libgeos-dev libgflags2.2 libgflags-dev libgoogle-glog-dev libjansson-dev libsnappy-dev liblzma-dev libz-dev zlib1g pkg-config build-essential valgrind rsync vim libjemalloc-dev openssh-server screen sshpass net-tools dirmngr gnupg apt-transport-https ca-certificates software-properties-common r-base iputils-ping clang-tools-16 +RUN sed -i 's/# en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen && locale-gen +RUN pip3 config set global.index-url http://admin:123456@192.168.0.212:3141/admin/dev/+simple/ +RUN pip3 config set global.trusted-host 192.168.0.212 +RUN pip3 install taospy==2.7.15 taos-ws-py==0.3.1 pandas psutil fabric2 requests faker simplejson toml pexpect tzlocal distro decorator loguru hyperloglog +ENV LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8 RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 RUN add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/' RUN apt install -y r-base @@ -17,17 +22,16 @@ RUN apt-get install wget -y \ && apt-get update && apt-get install -y dotnet-sdk-5.0 && apt-get install -y dotnet-sdk-6.0 ADD node-v12.20.0-linux-x64.tar.gz /usr/local/ RUN sh -c "rm -f /etc/localtime;ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime;echo \"Asia/Shanghai\" >/etc/timezone" -COPY id_rsa /root/.ssh/id_rsa COPY .m2 /root/.m2 COPY .nuget /root/.nuget COPY .dotnet /root/.dotnet -COPY .cargo /root/.cargo COPY go /root/go ADD cmake-3.21.5-linux-x86_64.tar.gz /usr/local/ RUN echo " export RUSTUP_DIST_SERVER=\"https://rsproxy.cn\" " >> /root/.bashrc RUN echo " export RUSTUP_UPDATE_ROOT=\"https://rsproxy.cn/rustup\" " >> /root/.bashrc RUN curl https://sh.rustup.rs -o /tmp/rustup-init.sh RUN sh /tmp/rustup-init.sh -y +COPY .cargo/config /root/.cargo/config ENV PATH /usr/local/go/bin:/usr/local/node-v12.20.0-linux-x64/bin:/usr/local/apache-maven-3.8.4/bin:/usr/local/jdk1.8.0_144/bin:/usr/local/cmake-3.21.5-linux-x86_64/bin:/root/.cargo/bin:$PATH ENV JAVA_HOME /usr/local/jdk1.8.0_144 RUN go env -w GOPROXY=https://goproxy.cn @@ -39,10 +43,8 @@ RUN R CMD javareconf JAVA_HOME=${JAVA_HOME} JAVA=${JAVA_HOME}/bin/java JAVAC=${J RUN echo "install.packages(\"RJDBC\", repos=\"http://cran.us.r-project.org\")"|R --no-save COPY .gitconfig /root/.gitconfig RUN mkdir -p /run/sshd -COPY id_rsa.pub /root/.ssh/id_rsa.pub -COPY id_rsa.pub /root/.ssh/authorized_keys +COPY id_ecdsa.pub /root/.ssh/id_ecdsa.pub +COPY id_ecdsa.pub /root/.ssh/authorized_keys RUN pip3 uninstall -y taostest COPY repository/TDinternal /home/TDinternal -COPY repository/taos-connector-python /home/taos-connector-python -RUN sh -c "cd /home/taos-connector-python; pip3 install ." COPY setup.sh /home/setup.sh diff --git a/tests/parallel_test/container_build.sh b/tests/parallel_test/container_build.sh index 26cabad107..95f7693742 100755 --- a/tests/parallel_test/container_build.sh +++ b/tests/parallel_test/container_build.sh @@ -95,11 +95,13 @@ if [[ -d ${WORKDIR}/debugSan ]] ;then rm -rf ${WORKDIR}/debugSan fi -if [ "$(uname -m)" = "aarch64" ] ;then - CMAKE_BUILD_TYPE="-DCMAKE_BUILD_TYPE=Debug" -else - CMAKE_BUILD_TYPE="-DCMAKE_BUILD_TYPE=Release" -fi +CMAKE_BUILD_TYPE="-DCMAKE_BUILD_TYPE=Release" + +# if [ "$(uname -m)" = "aarch64" ] ;then +# CMAKE_BUILD_TYPE="-DCMAKE_BUILD_TYPE=Debug" +# else +# CMAKE_BUILD_TYPE="-DCMAKE_BUILD_TYPE=Release" +# fi mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugNoSan date From 75543d952c861469019d63bb5b893778c750c794 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Tue, 13 Aug 2024 09:18:29 +0800 Subject: [PATCH 02/13] test:set debug in address sanitizer model --- tests/parallel_test/container_build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/parallel_test/container_build.sh b/tests/parallel_test/container_build.sh index 95f7693742..30690fb335 100755 --- a/tests/parallel_test/container_build.sh +++ b/tests/parallel_test/container_build.sh @@ -83,7 +83,7 @@ docker run \ -v ${REP_REAL_PATH}/community/contrib/xml2/:${REP_DIR}/community/contrib/xml2 \ -v ${REP_REAL_PATH}/community/contrib/zlib/:${REP_DIR}/community/contrib/zlib \ -v ${REP_REAL_PATH}/community/contrib/zstd/:${REP_DIR}/community/contrib/zstd \ - --rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=true -DWEBSOCKET=true -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=0 -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ;make -j 10|| exit 1" + --rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=true -DWEBSOCKET=true -DBUILD_TAOSX=false -DCMAKE_BUILD_TYPE=Release -DJEMALLOC_ENABLED=0 -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ;make -j 10|| exit 1" # -v ${REP_REAL_PATH}/community/contrib/jemalloc/:${REP_DIR}/community/contrib/jemalloc \ if [[ -d ${WORKDIR}/debugNoSan ]] ;then @@ -95,7 +95,7 @@ if [[ -d ${WORKDIR}/debugSan ]] ;then rm -rf ${WORKDIR}/debugSan fi -CMAKE_BUILD_TYPE="-DCMAKE_BUILD_TYPE=Release" +CMAKE_BUILD_TYPE="-DCMAKE_BUILD_TYPE=Debug" # if [ "$(uname -m)" = "aarch64" ] ;then # CMAKE_BUILD_TYPE="-DCMAKE_BUILD_TYPE=Debug" From 933f34bc38aaf2e97cb275f29a2813fa529e8810 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Tue, 13 Aug 2024 15:11:46 +0800 Subject: [PATCH 03/13] test:commit cunit_test of taos-tools in unit-test --- tests/unit-test/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit-test/test.sh b/tests/unit-test/test.sh index 71f5189551..21461bc6a5 100755 --- a/tests/unit-test/test.sh +++ b/tests/unit-test/test.sh @@ -40,7 +40,7 @@ pgrep taosd || taosd >> /dev/null 2>&1 & sleep 10 -ctest -j8 +ctest -E "cunit_test" -j8 ret=$? exit $ret From 8358b9736b96e4824ce5b3e736d2d9e6966cc376 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Tue, 13 Aug 2024 16:52:41 +0800 Subject: [PATCH 04/13] test:add release building tests and modify debug in unit-test --- tests/parallel_test/container_build.sh | 45 ++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/tests/parallel_test/container_build.sh b/tests/parallel_test/container_build.sh index 30690fb335..d99fbafcbd 100755 --- a/tests/parallel_test/container_build.sh +++ b/tests/parallel_test/container_build.sh @@ -83,7 +83,7 @@ docker run \ -v ${REP_REAL_PATH}/community/contrib/xml2/:${REP_DIR}/community/contrib/xml2 \ -v ${REP_REAL_PATH}/community/contrib/zlib/:${REP_DIR}/community/contrib/zlib \ -v ${REP_REAL_PATH}/community/contrib/zstd/:${REP_DIR}/community/contrib/zstd \ - --rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=true -DWEBSOCKET=true -DBUILD_TAOSX=false -DCMAKE_BUILD_TYPE=Release -DJEMALLOC_ENABLED=0 -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ;make -j 10|| exit 1" + --rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=true -DWEBSOCKET=true -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=0 -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ;make -j|| exit 1" # -v ${REP_REAL_PATH}/community/contrib/jemalloc/:${REP_DIR}/community/contrib/jemalloc \ if [[ -d ${WORKDIR}/debugNoSan ]] ;then @@ -94,6 +94,10 @@ if [[ -d ${WORKDIR}/debugSan ]] ;then echo "delete ${WORKDIR}/debugSan" rm -rf ${WORKDIR}/debugSan fi +if [[ -d ${WORKDIR}/debugRelease ]] ;then + echo "delete ${WORKDIR}/debugRelease" + rm -rf ${WORKDIR}/debugRelease +fi CMAKE_BUILD_TYPE="-DCMAKE_BUILD_TYPE=Debug" @@ -135,10 +139,47 @@ docker run \ -v ${REP_REAL_PATH}/community/contrib/xml2/:${REP_DIR}/community/contrib/xml2 \ -v ${REP_REAL_PATH}/community/contrib/zlib/:${REP_DIR}/community/contrib/zlib \ -v ${REP_REAL_PATH}/community/contrib/zstd/:${REP_DIR}/community/contrib/zstd \ - --rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=false -DWEBSOCKET=true -DBUILD_SANITIZER=1 -DTOOLS_SANITIZE=true $CMAKE_BUILD_TYPE -DTOOLS_BUILD_TYPE=Debug -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=0;make -j 10|| exit 1 " + --rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=false -DWEBSOCKET=true -DBUILD_SANITIZER=1 -DTOOLS_SANITIZE=true $CMAKE_BUILD_TYPE -DTOOLS_BUILD_TYPE=Debug -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=0;make -j|| exit 1 " mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugSan +date +docker run \ + -v $REP_MOUNT_PARAM \ + -v /root/.cargo/registry:/root/.cargo/registry \ + -v /root/.cargo/git:/root/.cargo/git \ + -v /root/go/pkg/mod:/root/go/pkg/mod \ + -v /root/.cache/go-build:/root/.cache/go-build \ + -v /root/.cos-local.1:/root/.cos-local.2 \ + -v ${REP_REAL_PATH}/enterprise/contrib/grant-lib:${REP_DIR}/enterprise/contrib/grant-lib \ + -v ${REP_REAL_PATH}/community/tools/taosadapter:${REP_DIR}/community/tools/taosadapter \ + -v ${REP_REAL_PATH}/community/tools/taos-tools:${REP_DIR}/community/tools/taos-tools \ + -v ${REP_REAL_PATH}/community/tools/taosws-rs:${REP_DIR}/community/tools/taosws-rs \ + -v ${REP_REAL_PATH}/community/tools/taosws-rs/target:${REP_DIR}/community/tools/taosws-rs/target \ + -v ${REP_REAL_PATH}/community/contrib/apr/:${REP_DIR}/community/contrib/apr \ + -v ${REP_REAL_PATH}/community/contrib/apr-util/:${REP_DIR}/community/contrib/apr-util \ + -v ${REP_REAL_PATH}/community/contrib/cJson/:${REP_DIR}/community/contrib/cJson \ + -v ${REP_REAL_PATH}/community/contrib/cpp-stub/:${REP_DIR}/community/contrib/cpp-stub \ + -v ${REP_REAL_PATH}/community/contrib/curl/:${REP_DIR}/community/contrib/curl \ + -v ${REP_REAL_PATH}/community/contrib/curl2/:${REP_DIR}/community/contrib/curl2 \ + -v ${REP_REAL_PATH}/community/contrib/geos/:${REP_DIR}/community/contrib/geos \ + -v ${REP_REAL_PATH}/community/contrib/googletest/:${REP_DIR}/community/contrib/googletest \ + -v ${REP_REAL_PATH}/community/contrib/libs3/:${REP_DIR}/community/contrib/libs3 \ + -v ${REP_REAL_PATH}/community/contrib/libuv/:${REP_DIR}/community/contrib/libuv \ + -v ${REP_REAL_PATH}/community/contrib/lz4/:${REP_DIR}/community/contrib/lz4 \ + -v ${REP_REAL_PATH}/community/contrib/lzma2/:${REP_DIR}/community/contrib/lzma2 \ + -v ${REP_REAL_PATH}/community/contrib/mxml/:${REP_DIR}/community/contrib/mxml \ + -v ${REP_REAL_PATH}/community/contrib/openssl/:${REP_DIR}/community/contrib/openssl \ + -v ${REP_REAL_PATH}/community/contrib/pcre2/:${REP_DIR}/community/contrib/pcre2 \ + -v ${REP_REAL_PATH}/community/contrib/xml2/:${REP_DIR}/community/contrib/xml2 \ + -v ${REP_REAL_PATH}/community/contrib/zlib/:${REP_DIR}/community/contrib/zlib \ + -v ${REP_REAL_PATH}/community/contrib/zstd/:${REP_DIR}/community/contrib/zstd \ + --rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=false -DWEBSOCKET=true -DCMAKE_BUILD_TYPE=Release -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=0;make -j || exit 1 " + +mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugRelease + + + ret=$? exit $ret From ae6b08d13731db48b82e251ad1115ab4e649c4f3 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 14 Aug 2024 10:32:49 +0800 Subject: [PATCH 05/13] test:add release building tests and modify debug in unit-test --- tests/parallel_test/container_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/parallel_test/container_build.sh b/tests/parallel_test/container_build.sh index d99fbafcbd..862aef65f4 100755 --- a/tests/parallel_test/container_build.sh +++ b/tests/parallel_test/container_build.sh @@ -139,7 +139,7 @@ docker run \ -v ${REP_REAL_PATH}/community/contrib/xml2/:${REP_DIR}/community/contrib/xml2 \ -v ${REP_REAL_PATH}/community/contrib/zlib/:${REP_DIR}/community/contrib/zlib \ -v ${REP_REAL_PATH}/community/contrib/zstd/:${REP_DIR}/community/contrib/zstd \ - --rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=false -DWEBSOCKET=true -DBUILD_SANITIZER=1 -DTOOLS_SANITIZE=true $CMAKE_BUILD_TYPE -DTOOLS_BUILD_TYPE=Debug -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=0;make -j|| exit 1 " + --rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=false -DWEBSOCKET=true -DBUILD_SANITIZER=1 -DTOOLS_SANITIZE=true -DCMAKE_BUILD_TYPE=RelWithDebInfo -DTOOLS_BUILD_TYPE=Debug -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=0;make -j|| exit 1 " mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugSan From 73265490f0c194023b950714789180e99017a753 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 14 Aug 2024 14:11:21 +0800 Subject: [PATCH 06/13] tetst: test for checking return value --- source/common/src/cos.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/common/src/cos.c b/source/common/src/cos.c index 335c654acd..bc92527108 100644 --- a/source/common/src/cos.c +++ b/source/common/src/cos.c @@ -54,6 +54,8 @@ int32_t s3Begin() { void s3End() { S3_deinitialize(); } + + int32_t s3Init() { TAOS_RETURN(TSDB_CODE_SUCCESS); /*s3Begin();*/ } void s3CleanUp() { /*s3End();*/ From 87f50f01e4049f10b47eba0b960f7802f18dbc9f Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 14 Aug 2024 14:39:24 +0800 Subject: [PATCH 07/13] tetst: test for checking return value --- tests/ci/scan_file_path.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ci/scan_file_path.py b/tests/ci/scan_file_path.py index aff94158b8..ab3c08cc2d 100644 --- a/tests/ci/scan_file_path.py +++ b/tests/ci/scan_file_path.py @@ -189,7 +189,7 @@ if __name__ == "__main__": try: stdout, stderr = command_executor.execute(cmd) #if "error" in stderr: - # print(stderr) + print(stderr) lines = stdout.split("\n") if lines[-2].endswith("matches.") or lines[-2].endswith("match."): match_num = int(lines[-2].split(" ")[0]) From 109418e57a3f299cb0646d1fe85d59ec04f8b2ce Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 14 Aug 2024 15:07:39 +0800 Subject: [PATCH 08/13] tetst: test for checking return value --- tests/ci/scan_file_path.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ci/scan_file_path.py b/tests/ci/scan_file_path.py index ab3c08cc2d..81862363a0 100644 --- a/tests/ci/scan_file_path.py +++ b/tests/ci/scan_file_path.py @@ -122,7 +122,7 @@ def scan_files_path(source_file_path): for file in files: if any(item in root for item in scan_dir_list): file_path = os.path.join(root, file) - if (file_path.endswith(".c") or file_name.endswith(".h") or file_path.endswith(".cpp")) and all(item not in file_path for item in scan_skip_file_list): + if (file_path.endswith(".c") or file_path.endswith(".h") or file_path.endswith(".cpp")) and all(item not in file_path for item in scan_skip_file_list): all_file_path.append(file_path) logger.info("Found %s files" % len(all_file_path)) @@ -184,7 +184,7 @@ if __name__ == "__main__": # os.makedirs(scan_result_path) for file in all_file_path: - cmd = f"clang-query-10 -p {compile_commands_path} {file} -f {clang_scan_rules_path}" + cmd = f"clang-query-16 -p {compile_commands_path} {file} -f {clang_scan_rules_path}" logger.debug(f"cmd:{cmd}") try: stdout, stderr = command_executor.execute(cmd) From ca7b1b21c77adca64032635750a3c9d9426e0fd2 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 14 Aug 2024 15:10:14 +0800 Subject: [PATCH 09/13] test:add release building tests and modify debug in unit-test --- tests/parallel_test/container_build.sh | 66 +++++++++++++------------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/tests/parallel_test/container_build.sh b/tests/parallel_test/container_build.sh index 862aef65f4..923a65ec3a 100755 --- a/tests/parallel_test/container_build.sh +++ b/tests/parallel_test/container_build.sh @@ -99,8 +99,6 @@ if [[ -d ${WORKDIR}/debugRelease ]] ;then rm -rf ${WORKDIR}/debugRelease fi -CMAKE_BUILD_TYPE="-DCMAKE_BUILD_TYPE=Debug" - # if [ "$(uname -m)" = "aarch64" ] ;then # CMAKE_BUILD_TYPE="-DCMAKE_BUILD_TYPE=Debug" # else @@ -144,39 +142,39 @@ docker run \ mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugSan date -docker run \ - -v $REP_MOUNT_PARAM \ - -v /root/.cargo/registry:/root/.cargo/registry \ - -v /root/.cargo/git:/root/.cargo/git \ - -v /root/go/pkg/mod:/root/go/pkg/mod \ - -v /root/.cache/go-build:/root/.cache/go-build \ - -v /root/.cos-local.1:/root/.cos-local.2 \ - -v ${REP_REAL_PATH}/enterprise/contrib/grant-lib:${REP_DIR}/enterprise/contrib/grant-lib \ - -v ${REP_REAL_PATH}/community/tools/taosadapter:${REP_DIR}/community/tools/taosadapter \ - -v ${REP_REAL_PATH}/community/tools/taos-tools:${REP_DIR}/community/tools/taos-tools \ - -v ${REP_REAL_PATH}/community/tools/taosws-rs:${REP_DIR}/community/tools/taosws-rs \ - -v ${REP_REAL_PATH}/community/tools/taosws-rs/target:${REP_DIR}/community/tools/taosws-rs/target \ - -v ${REP_REAL_PATH}/community/contrib/apr/:${REP_DIR}/community/contrib/apr \ - -v ${REP_REAL_PATH}/community/contrib/apr-util/:${REP_DIR}/community/contrib/apr-util \ - -v ${REP_REAL_PATH}/community/contrib/cJson/:${REP_DIR}/community/contrib/cJson \ - -v ${REP_REAL_PATH}/community/contrib/cpp-stub/:${REP_DIR}/community/contrib/cpp-stub \ - -v ${REP_REAL_PATH}/community/contrib/curl/:${REP_DIR}/community/contrib/curl \ - -v ${REP_REAL_PATH}/community/contrib/curl2/:${REP_DIR}/community/contrib/curl2 \ - -v ${REP_REAL_PATH}/community/contrib/geos/:${REP_DIR}/community/contrib/geos \ - -v ${REP_REAL_PATH}/community/contrib/googletest/:${REP_DIR}/community/contrib/googletest \ - -v ${REP_REAL_PATH}/community/contrib/libs3/:${REP_DIR}/community/contrib/libs3 \ - -v ${REP_REAL_PATH}/community/contrib/libuv/:${REP_DIR}/community/contrib/libuv \ - -v ${REP_REAL_PATH}/community/contrib/lz4/:${REP_DIR}/community/contrib/lz4 \ - -v ${REP_REAL_PATH}/community/contrib/lzma2/:${REP_DIR}/community/contrib/lzma2 \ - -v ${REP_REAL_PATH}/community/contrib/mxml/:${REP_DIR}/community/contrib/mxml \ - -v ${REP_REAL_PATH}/community/contrib/openssl/:${REP_DIR}/community/contrib/openssl \ - -v ${REP_REAL_PATH}/community/contrib/pcre2/:${REP_DIR}/community/contrib/pcre2 \ - -v ${REP_REAL_PATH}/community/contrib/xml2/:${REP_DIR}/community/contrib/xml2 \ - -v ${REP_REAL_PATH}/community/contrib/zlib/:${REP_DIR}/community/contrib/zlib \ - -v ${REP_REAL_PATH}/community/contrib/zstd/:${REP_DIR}/community/contrib/zstd \ - --rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=false -DWEBSOCKET=true -DCMAKE_BUILD_TYPE=Release -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=0;make -j || exit 1 " +# docker run \ +# -v $REP_MOUNT_PARAM \ +# -v /root/.cargo/registry:/root/.cargo/registry \ +# -v /root/.cargo/git:/root/.cargo/git \ +# -v /root/go/pkg/mod:/root/go/pkg/mod \ +# -v /root/.cache/go-build:/root/.cache/go-build \ +# -v /root/.cos-local.1:/root/.cos-local.2 \ +# -v ${REP_REAL_PATH}/enterprise/contrib/grant-lib:${REP_DIR}/enterprise/contrib/grant-lib \ +# -v ${REP_REAL_PATH}/community/tools/taosadapter:${REP_DIR}/community/tools/taosadapter \ +# -v ${REP_REAL_PATH}/community/tools/taos-tools:${REP_DIR}/community/tools/taos-tools \ +# -v ${REP_REAL_PATH}/community/tools/taosws-rs:${REP_DIR}/community/tools/taosws-rs \ +# -v ${REP_REAL_PATH}/community/tools/taosws-rs/target:${REP_DIR}/community/tools/taosws-rs/target \ +# -v ${REP_REAL_PATH}/community/contrib/apr/:${REP_DIR}/community/contrib/apr \ +# -v ${REP_REAL_PATH}/community/contrib/apr-util/:${REP_DIR}/community/contrib/apr-util \ +# -v ${REP_REAL_PATH}/community/contrib/cJson/:${REP_DIR}/community/contrib/cJson \ +# -v ${REP_REAL_PATH}/community/contrib/cpp-stub/:${REP_DIR}/community/contrib/cpp-stub \ +# -v ${REP_REAL_PATH}/community/contrib/curl/:${REP_DIR}/community/contrib/curl \ +# -v ${REP_REAL_PATH}/community/contrib/curl2/:${REP_DIR}/community/contrib/curl2 \ +# -v ${REP_REAL_PATH}/community/contrib/geos/:${REP_DIR}/community/contrib/geos \ +# -v ${REP_REAL_PATH}/community/contrib/googletest/:${REP_DIR}/community/contrib/googletest \ +# -v ${REP_REAL_PATH}/community/contrib/libs3/:${REP_DIR}/community/contrib/libs3 \ +# -v ${REP_REAL_PATH}/community/contrib/libuv/:${REP_DIR}/community/contrib/libuv \ +# -v ${REP_REAL_PATH}/community/contrib/lz4/:${REP_DIR}/community/contrib/lz4 \ +# -v ${REP_REAL_PATH}/community/contrib/lzma2/:${REP_DIR}/community/contrib/lzma2 \ +# -v ${REP_REAL_PATH}/community/contrib/mxml/:${REP_DIR}/community/contrib/mxml \ +# -v ${REP_REAL_PATH}/community/contrib/openssl/:${REP_DIR}/community/contrib/openssl \ +# -v ${REP_REAL_PATH}/community/contrib/pcre2/:${REP_DIR}/community/contrib/pcre2 \ +# -v ${REP_REAL_PATH}/community/contrib/xml2/:${REP_DIR}/community/contrib/xml2 \ +# -v ${REP_REAL_PATH}/community/contrib/zlib/:${REP_DIR}/community/contrib/zlib \ +# -v ${REP_REAL_PATH}/community/contrib/zstd/:${REP_DIR}/community/contrib/zstd \ +# --rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=false -DWEBSOCKET=true -DCMAKE_BUILD_TYPE=Release -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=0;make -j || exit 1 " -mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugRelease +# mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugRelease From d1bcc1ddddd1ae093c00afed36bf2baf53292cb0 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 14 Aug 2024 16:25:34 +0800 Subject: [PATCH 10/13] tetst: test for checking return value --- tests/parallel_test/run_scan_container.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/parallel_test/run_scan_container.sh b/tests/parallel_test/run_scan_container.sh index d16d1c3017..9f190f5f13 100755 --- a/tests/parallel_test/run_scan_container.sh +++ b/tests/parallel_test/run_scan_container.sh @@ -79,6 +79,7 @@ scan_scripts="$CONTAINER_TESTDIR/tests/ci/scan_file_path.py" ulimit -c unlimited cat << EOF docker run \ + -v /root/.cos-local.1:/root/.cos-local.2 \ -v $REP_MOUNT_PARAM \ -v $REP_MOUNT_DEBUG \ -v $scan_changefile_temp_path:$docker_can_changefile_temp_path \ @@ -86,6 +87,7 @@ docker run \ --rm --ulimit core=-1 taos_test:v1.0 python3 $scan_scripts -b "${branch_name_id}" -f "${scan_file_name}" -w ${web_server} EOF docker run \ + -v /root/.cos-local.1:/root/.cos-local.2 \ -v $REP_MOUNT_PARAM \ -v $REP_MOUNT_DEBUG \ -v $scan_changefile_temp_path:$docker_can_changefile_temp_path \ From 94891943a98f126669ebe3dbe0330db4d20fd63a Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 14 Aug 2024 17:51:26 +0800 Subject: [PATCH 11/13] test:add release building tests and modify debug in unit-test --- tests/parallel_test/container_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/parallel_test/container_build.sh b/tests/parallel_test/container_build.sh index 923a65ec3a..a386269f85 100755 --- a/tests/parallel_test/container_build.sh +++ b/tests/parallel_test/container_build.sh @@ -137,7 +137,7 @@ docker run \ -v ${REP_REAL_PATH}/community/contrib/xml2/:${REP_DIR}/community/contrib/xml2 \ -v ${REP_REAL_PATH}/community/contrib/zlib/:${REP_DIR}/community/contrib/zlib \ -v ${REP_REAL_PATH}/community/contrib/zstd/:${REP_DIR}/community/contrib/zstd \ - --rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=false -DWEBSOCKET=true -DBUILD_SANITIZER=1 -DTOOLS_SANITIZE=true -DCMAKE_BUILD_TYPE=RelWithDebInfo -DTOOLS_BUILD_TYPE=Debug -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=0;make -j|| exit 1 " + --rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=false -DWEBSOCKET=true -DBUILD_SANITIZER=1 -DTOOLS_SANITIZE=true -DCMAKE_BUILD_TYPE=Debug -DTOOLS_BUILD_TYPE=Debug -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=0;make -j|| exit 1 " mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugSan From 31628e00773b81a1dccdc1552e26858af695d0d6 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 14 Aug 2024 19:02:52 +0800 Subject: [PATCH 12/13] tetst: test for checking return value --- source/common/src/cos.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/source/common/src/cos.c b/source/common/src/cos.c index bc92527108..335c654acd 100644 --- a/source/common/src/cos.c +++ b/source/common/src/cos.c @@ -54,8 +54,6 @@ int32_t s3Begin() { void s3End() { S3_deinitialize(); } - - int32_t s3Init() { TAOS_RETURN(TSDB_CODE_SUCCESS); /*s3Begin();*/ } void s3CleanUp() { /*s3End();*/ From 0294a2d9d6d979b8d4016920c2c1b1616958a98e Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 14 Aug 2024 19:07:10 +0800 Subject: [PATCH 13/13] tetst: test for checking return value --- tests/ci/scan_file_path.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ci/scan_file_path.py b/tests/ci/scan_file_path.py index 81862363a0..2d4e701012 100644 --- a/tests/ci/scan_file_path.py +++ b/tests/ci/scan_file_path.py @@ -134,7 +134,7 @@ def input_files(change_files): for line in file: file_name = line.strip() if any(dir_name in file_name for dir_name in scan_dir_list): - if (file_name.endswith(".c") or line.endswith(".cpp")) and all(dir_name not in file_name for dir_name in scan_skip_file_list): + if (file_name.endswith(".c") or file_name.endswith(".cpp")) and all(dir_name not in file_name for dir_name in scan_skip_file_list): if "enterprise" in file_name: file_name = os.path.join(TD_project_path, file_name) else: