From fdff36da22a93fbb7528649332e6c7fd5036eee4 Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Mon, 17 Mar 2025 19:22:28 +0800 Subject: [PATCH 01/21] test:add coverage sh --- .../parallel_test/container_build_coverage.sh | 179 ++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100755 tests/parallel_test/container_build_coverage.sh diff --git a/tests/parallel_test/container_build_coverage.sh b/tests/parallel_test/container_build_coverage.sh new file mode 100755 index 0000000000..aad7bd3190 --- /dev/null +++ b/tests/parallel_test/container_build_coverage.sh @@ -0,0 +1,179 @@ +#!/bin/bash +set -e + +function usage() { + echo "$0" + echo -e "\t -w work dir" + echo -e "\t -e enterprise edition" + echo -e "\t -t make thread count" + echo -e "\t -h help" +} + +ent=0 +while getopts "w:t:eh" opt; do + case $opt in + w) + WORKDIR=$OPTARG + ;; + e) + ent=1 + ;; + t) + THREAD_COUNT=$OPTARG + ;; + h) + usage + exit 0 + ;; + \?) + echo "Invalid option: -$OPTARG" + usage + exit 0 + ;; + esac +done + +if [ -z "$WORKDIR" ]; then + usage + exit 1 +fi +# if [ -z "$THREAD_COUNT" ]; then +# THREAD_COUNT=1 +# fi + +ulimit -c unlimited + +if [ $ent -eq 0 ]; then + REP_DIR=/home/TDengine + REP_REAL_PATH=$WORKDIR/TDengine + REP_MOUNT_PARAM=$REP_REAL_PATH:/home/TDengine +else + REP_DIR=/home/TDinternal + REP_REAL_PATH=$WORKDIR/TDinternal + REP_MOUNT_PARAM=$REP_REAL_PATH:/home/TDinternal + +fi +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/taosws-rs:${REP_DIR}/community/tools/taosws-rs \ + -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/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 "cd $REP_DIR; rm -rf debug; mkdir -p debug; cd debug; cmake .. -DCOVER=true -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=ON -DWEBSOCKET=true -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=OFF -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 + echo "delete ${WORKDIR}/debugNoSan" + rm -rf ${WORKDIR}/debugNoSan +fi +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 + +# 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 +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/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/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 "cd $REP_DIR; rm -rf debug; mkdir -p debug; cd debug; cmake .. -DCOVER=true -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=ON -DWEBSOCKET=true -DBUILD_SANITIZER=1 -DTOOLS_SANITIZE=true -DCMAKE_BUILD_TYPE=Debug -DTOOLS_BUILD_TYPE=Debug -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=OFF; 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=ON -DWEBSOCKET=true -DCMAKE_BUILD_TYPE=Release -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=OFF; make -j || exit 1 " + +# mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugRelease + + + +ret=$? +exit $ret + From 840ab147a863f956e8141fcb6ed653175ed2e68f Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Wed, 19 Mar 2025 19:13:58 +0800 Subject: [PATCH 02/21] test:add cov yml --- .github/workflows/tdengine-test-coverage.yml | 48 ++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/tdengine-test-coverage.yml diff --git a/.github/workflows/tdengine-test-coverage.yml b/.github/workflows/tdengine-test-coverage.yml new file mode 100644 index 0000000000..e235bcd2ff --- /dev/null +++ b/.github/workflows/tdengine-test-coverage.yml @@ -0,0 +1,48 @@ +name: TDengine Test coverage + +on: + pull_request: + branches: + - 'test/cover1' + paths-ignore: + - 'packaging/**' + - 'docs/**' + - 'tools/tdgpt/**' + - 'source/libs/executor/src/forecastoperator.c' + - 'source/libs/executor/src/anomalywindowoperator.c' + - 'include/common/tanalytics.h' + - 'source/common/src/tanalytics.c' + - 'tests/parallel/tdgpt_cases.task' + - 'tests/script/tsim/analytics' + - '**/*.md' + workflow_dispatch: + inputs: + specified_source_branch: + description: 'Enter the source branch name of TDengine' + required: true + type: string + specified_target_branch: + description: 'Enter the target branch name of TDengine' + required: true + type: string + specified_pr_number: + description: 'Enter the PR number of TDengine' + required: true + type: string + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }}-${{ github.event.inputs.specified_target_branch }}-${{ github.event.inputs.specified_pr_number }}-TDengine + cancel-in-progress: true + +env: + WKC: '/var/lib/jenkins/workspace/TDinternal/community' + +jobs: + run-tests-on-linux: + uses: taosdata/.github/.github/workflows/run-coverage-tests-on-linux.yml@test_coverage + if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'}} + with: + tdinternal: false + specified_source_branch: ${{ github.event_name == 'pull_request' && 'unavailable' || github.event.inputs.specified_source_branch }} + specified_target_branch: ${{ github.event_name == 'pull_request' && 'unavailable' || github.event.inputs.specified_target_branch }} + specified_pr_number: ${{ github.event_name == 'pull_request' && 'unavailable' || github.event.inputs.specified_pr_number }} From 1f5012f319e6cd75874f1ff5acf42ea07ad6d5a9 Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Wed, 19 Mar 2025 19:23:22 +0800 Subject: [PATCH 03/21] test:add cov yml --- .github/workflows/tdengine-test-coverage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tdengine-test-coverage.yml b/.github/workflows/tdengine-test-coverage.yml index e235bcd2ff..c4f8c3d880 100644 --- a/.github/workflows/tdengine-test-coverage.yml +++ b/.github/workflows/tdengine-test-coverage.yml @@ -1,6 +1,7 @@ name: TDengine Test coverage on: + push: pull_request: branches: - 'test/cover1' From db6c5a1a8886c1a08d688441fe1921b2e0ac1f30 Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Wed, 19 Mar 2025 19:24:52 +0800 Subject: [PATCH 04/21] test:add cov yml --- .github/workflows/tdengine-test-coverage.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/tdengine-test-coverage.yml b/.github/workflows/tdengine-test-coverage.yml index c4f8c3d880..94437781e4 100644 --- a/.github/workflows/tdengine-test-coverage.yml +++ b/.github/workflows/tdengine-test-coverage.yml @@ -5,17 +5,6 @@ on: pull_request: branches: - 'test/cover1' - paths-ignore: - - 'packaging/**' - - 'docs/**' - - 'tools/tdgpt/**' - - 'source/libs/executor/src/forecastoperator.c' - - 'source/libs/executor/src/anomalywindowoperator.c' - - 'include/common/tanalytics.h' - - 'source/common/src/tanalytics.c' - - 'tests/parallel/tdgpt_cases.task' - - 'tests/script/tsim/analytics' - - '**/*.md' workflow_dispatch: inputs: specified_source_branch: From 95e38a31ac190dd2eaa8ce53263712d539d48018 Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Wed, 19 Mar 2025 19:28:23 +0800 Subject: [PATCH 05/21] test:add cov yml --- .github/workflows/tdengine-test-coverage.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tdengine-test-coverage.yml b/.github/workflows/tdengine-test-coverage.yml index 94437781e4..6c329cb1dd 100644 --- a/.github/workflows/tdengine-test-coverage.yml +++ b/.github/workflows/tdengine-test-coverage.yml @@ -1,7 +1,6 @@ name: TDengine Test coverage on: - push: pull_request: branches: - 'test/cover1' From 6e3d3f50b54a750542bbeaf5fe46b055a40b8d55 Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Thu, 20 Mar 2025 09:54:50 +0800 Subject: [PATCH 06/21] test:alter build sh --- tests/parallel_test/container_build_coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/parallel_test/container_build_coverage.sh b/tests/parallel_test/container_build_coverage.sh index aad7bd3190..5da85451c0 100755 --- a/tests/parallel_test/container_build_coverage.sh +++ b/tests/parallel_test/container_build_coverage.sh @@ -133,7 +133,7 @@ docker run \ -v ${REP_REAL_PATH}/community/contrib/pcre2/:${REP_DIR}/community/contrib/pcre2 \ -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 "cd $REP_DIR; rm -rf debug; mkdir -p debug; cd debug; cmake .. -DCOVER=true -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=ON -DWEBSOCKET=true -DBUILD_SANITIZER=1 -DTOOLS_SANITIZE=true -DCMAKE_BUILD_TYPE=Debug -DTOOLS_BUILD_TYPE=Debug -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=OFF; make -j|| exit 1 " + --rm --ulimit core=-1 taos_test:v1.0 sh -c "cd $REP_DIR; rm -rf debug; mkdir -p debug; cd debug; cmake .. -DCOVER=true -DBUILD_TEST=true -DBUILD_HTTP=false -DBUILD_TOOLS=true -DWEBSOCKET=true -DBUILD_GEOS=true -DBUILD_CONTRIB=true; make -j install|| exit 1 " mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugSan From f635dcd44d4ac88f033c96f865ea880f52497f59 Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Thu, 20 Mar 2025 10:02:08 +0800 Subject: [PATCH 07/21] test:alter build sh --- tests/parallel_test/container_build_coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/parallel_test/container_build_coverage.sh b/tests/parallel_test/container_build_coverage.sh index 5da85451c0..ac9264caa5 100755 --- a/tests/parallel_test/container_build_coverage.sh +++ b/tests/parallel_test/container_build_coverage.sh @@ -133,7 +133,7 @@ docker run \ -v ${REP_REAL_PATH}/community/contrib/pcre2/:${REP_DIR}/community/contrib/pcre2 \ -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 "cd $REP_DIR; rm -rf debug; mkdir -p debug; cd debug; cmake .. -DCOVER=true -DBUILD_TEST=true -DBUILD_HTTP=false -DBUILD_TOOLS=true -DWEBSOCKET=true -DBUILD_GEOS=true -DBUILD_CONTRIB=true; make -j install|| exit 1 " + --rm --ulimit core=-1 taos_test:v1.0 sh -c "cd $REP_DIR; rm -rf debug; mkdir -p debug; cd debug; cmake .. -DCOVER=true -DBUILD_TEST=true -DBUILD_HTTP=false -DBUILD_TOOLS=true -DWEBSOCKET=true -DBUILD_GEOS=true ; make -j install|| exit 1 " mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugSan From 71a5f5af3b7fe51cb4aad7e73e6a28c150bac832 Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Thu, 20 Mar 2025 11:12:21 +0800 Subject: [PATCH 08/21] test:alter build sh --- .../parallel_test/container_build_coverage.sh | 85 +------------------ 1 file changed, 2 insertions(+), 83 deletions(-) diff --git a/tests/parallel_test/container_build_coverage.sh b/tests/parallel_test/container_build_coverage.sh index ac9264caa5..ca83f342b8 100755 --- a/tests/parallel_test/container_build_coverage.sh +++ b/tests/parallel_test/container_build_coverage.sh @@ -37,9 +37,6 @@ if [ -z "$WORKDIR" ]; then usage exit 1 fi -# if [ -z "$THREAD_COUNT" ]; then -# THREAD_COUNT=1 -# fi ulimit -c unlimited @@ -81,97 +78,19 @@ docker run \ -v ${REP_REAL_PATH}/community/contrib/pcre2/:${REP_DIR}/community/contrib/pcre2 \ -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 "cd $REP_DIR; rm -rf debug; mkdir -p debug; cd debug; cmake .. -DCOVER=true -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=ON -DWEBSOCKET=true -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ;make -j|| exit 1" - # -v ${REP_REAL_PATH}/community/contrib/jemalloc/:${REP_DIR}/community/contrib/jemalloc \ + --rm --ulimit core=-1 taos_test:v1.0 sh -c "cd $REP_DIR; rm -rf debug; mkdir -p debug; cd debug; cmake .. -DCOVER=true -DBUILD_TEST=true -DBUILD_HTTP=false -DBUILD_TOOLS=true -DWEBSOCKET=true -DBUILD_GEOS=true ; make -j install|| exit 1" + if [[ -d ${WORKDIR}/debugNoSan ]] ;then echo "delete ${WORKDIR}/debugNoSan" rm -rf ${WORKDIR}/debugNoSan fi -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 -# 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 -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/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/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 "cd $REP_DIR; rm -rf debug; mkdir -p debug; cd debug; cmake .. -DCOVER=true -DBUILD_TEST=true -DBUILD_HTTP=false -DBUILD_TOOLS=true -DWEBSOCKET=true -DBUILD_GEOS=true ; make -j install|| 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=ON -DWEBSOCKET=true -DCMAKE_BUILD_TYPE=Release -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=OFF; make -j || exit 1 " - -# mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugRelease - ret=$? From 13b88e89824eae922cbd90ca18b76246311a9f81 Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Thu, 20 Mar 2025 11:13:26 +0800 Subject: [PATCH 09/21] test:alter build/lib ro --- tests/parallel_test/run_container.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/parallel_test/run_container.sh b/tests/parallel_test/run_container.sh index d13aa327cb..c118a04818 100755 --- a/tests/parallel_test/run_container.sh +++ b/tests/parallel_test/run_container.sh @@ -85,7 +85,7 @@ if [ $ent -ne 0 ]; then SIM_DIR=/home/TDinternal/sim REP_MOUNT_PARAM="$INTERNAL_REPDIR:/home/TDinternal" REP_MOUNT_DEBUG="${REPDIR_DEBUG}:/home/TDinternal/debug/" - REP_MOUNT_LIB="${REPDIR_DEBUG}/build/lib:/home/TDinternal/debug/build/lib:ro" + REP_MOUNT_LIB="${REPDIR_DEBUG}/build/lib:/home/TDinternal/debug/build/lib" else # community edition REPDIR=$WORKDIR/TDengine @@ -94,7 +94,7 @@ else SIM_DIR=/home/TDengine/sim REP_MOUNT_PARAM="$REPDIR:/home/TDengine" REP_MOUNT_DEBUG="${REPDIR_DEBUG}:/home/TDengine/debug/" - REP_MOUNT_LIB="${REPDIR_DEBUG}/build/lib:/home/TDinternal/debug/build/lib:ro" + REP_MOUNT_LIB="${REPDIR_DEBUG}/build/lib:/home/TDinternal/debug/build/lib" fi ulimit -c unlimited From d9d2d52ef18acbc901fdcd9361c6d31bfbbefd82 Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Thu, 20 Mar 2025 13:49:21 +0800 Subject: [PATCH 10/21] test:alter run container sh --- tests/parallel_test/run_container.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/parallel_test/run_container.sh b/tests/parallel_test/run_container.sh index c118a04818..cfddec0dc0 100755 --- a/tests/parallel_test/run_container.sh +++ b/tests/parallel_test/run_container.sh @@ -130,6 +130,7 @@ 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 ${REPDIR_DEBUG}:/home/TDinternal/debug \ --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 From fad7fe4b32555dbb866386f054411fac96437f8a Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Thu, 20 Mar 2025 14:07:36 +0800 Subject: [PATCH 11/21] test:alter run container sh --- tests/parallel_test/run_container.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/parallel_test/run_container.sh b/tests/parallel_test/run_container.sh index cfddec0dc0..c118a04818 100755 --- a/tests/parallel_test/run_container.sh +++ b/tests/parallel_test/run_container.sh @@ -130,7 +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 ${REPDIR_DEBUG}:/home/TDinternal/debug \ --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 From d63cad4b6b3bb23ac00ea66d6fe5d92ada9fb660 Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Fri, 21 Mar 2025 17:18:44 +0800 Subject: [PATCH 12/21] test:add container sh --- tests/parallel_test/run_coverage_container.sh | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 tests/parallel_test/run_coverage_container.sh diff --git a/tests/parallel_test/run_coverage_container.sh b/tests/parallel_test/run_coverage_container.sh new file mode 100755 index 0000000000..539438f962 --- /dev/null +++ b/tests/parallel_test/run_coverage_container.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +function usage() { + echo "$0" + echo -e "\t -d work dir" + echo -e "\t -b branch id" + echo -e "\t -h help" +} + +while getopts "d:b:w:f:h" opt; do + case $opt in + d) + WORKDIR=$OPTARG + ;; + b) + branch_name_id=$OPTARG + ;; + h) + usage + exit 0 + ;; + \?) + echo "Invalid option: -$OPTARG" + usage + exit 0 + ;; + esac +done + +if [ -z "$branch_name_id" ]; then + usage + exit 1 +fi + +if [ -z "$WORKDIR" ]; then + usage + exit 1 +fi + + # enterprise edition +INTERNAL_REPDIR=$WORKDIR/TDinternal +REPDIR_DEBUG=$WORKDIR/debugNoSan/ + +REP_MOUNT_DEBUG="${REPDIR_DEBUG}:/home/TDinternal/debug/" +REP_MOUNT_PARAM="$INTERNAL_REPDIR:/home/TDinternal" + +CONTAINER_TESTDIR=/home/TDinternal/community + + +ulimit -c unlimited + +docker run \ + --name taos_coverage \ + -v $REP_MOUNT_PARAM \ + -v $REP_MOUNT_DEBUG \ + --rm --ulimit core=-1 taos_test:v1.0 sh -c "bash ${CONTAINER_TESTDIR}/tests/run_workflow_coverage.sh -b ${branch_name_id}" + + +ret=$? +exit $ret + From bea43dbb8f9c4dc7a6293e7a5c1b88d403198621 Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Fri, 21 Mar 2025 17:22:14 +0800 Subject: [PATCH 13/21] test:add cov workflow sh --- tests/run_workflow_coverage.sh | 129 +++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100755 tests/run_workflow_coverage.sh diff --git a/tests/run_workflow_coverage.sh b/tests/run_workflow_coverage.sh new file mode 100755 index 0000000000..b83926bec2 --- /dev/null +++ b/tests/run_workflow_coverage.sh @@ -0,0 +1,129 @@ +#!/bin/bash + +# Color setting +RED='\033[0;31m' +GREEN='\033[1;32m' +GREEN_DARK='\033[0;32m' +GREEN_UNDERLINE='\033[4;32m' +NC='\033[0m' + +function print_color() { + local color="$1" + local message="$2" + echo -e "${color}${message}${NC}" +} + +function printHelp() { + echo "Usage: $(basename $0) [options]" + echo + echo "Options:" + echo " -d [Project dir] Project directory (default: outermost project directory)" + echo " e.g., -d /home/TDinternal/community" + echo " -f [Capture gcda dir] Capture gcda directory (default: /debug)" + echo " -b [Coverage branch] Covevrage branch (default:3.0)" + exit 0 +} + +# Find the project/tdengine/build/capture directory +function get_DIR() { + today=`date +"%Y%m%d"` + if [ -z "$PROJECT_DIR" ]; then + CODE_DIR=$(dirname $0) + cd $CODE_DIR + CODE_DIR=$(pwd) + if [[ "$CODE_DIR" == *"/community/"* ]]; then + PROJECT_DIR=$(realpath ../..) + TDENGINE_DIR="$PROJECT_DIR" + BUILD_DIR="$PROJECT_DIR/debug" + CAPTURE_GCDA_DIR="$BUILD_DIR" + else + PROJECT_DIR=$(realpath ..) + TDENGINE_DIR="$PROJECT_DIR" + BUILD_DIR="$PROJECT_DIR/debug" + CAPTURE_GCDA_DIR="$BUILD_DIR" + fi + elif [[ "$PROJECT_DIR" == *"/TDinternal" ]]; then + TDENGINE_DIR="$PROJECT_DIR/community" + BUILD_DIR="$PROJECT_DIR/debug" + CAPTURE_GCDA_DIR="$BUILD_DIR" + elif [[ "$PROJECT_DIR" == *"/TDengine" ]]; then + TDENGINE_DIR="$PROJECT_DIR" + BUILD_DIR="$PROJECT_DIR/debug" + CAPTURE_GCDA_DIR="$BUILD_DIR" + fi +} + +function lcovFunc { + echo "collect data by lcov" + cd $TDENGINE_DIR + + # collect data + lcov -d "$CAPTURE_GCDA_DIR" -capture --rc lcov_branch_coverage=1 --rc genhtml_branch_coverage=1 --no-external -b $TDENGINE_DIR -o coverage.info + + # remove exclude paths '*/taos-tools/*' '*/tools/*' 后面add + lcov --remove coverage.info \ + '*/contrib/*' '*/test/*' '*/packaging/*' '*/taos-tools/deps/*' '*/taosadapter/*' '*/TSZ/*' \ + '*/AccessBridgeCalls.c' '*/ttszip.c' '*/dataInserter.c' '*/tlinearhash.c' '*/tsimplehash.c' '*/tsdbDiskData.c' '/*/enterprise/*' '*/docs/*' '*/sim/*'\ + '*/texpr.c' '*/runUdf.c' '*/schDbg.c' '*/syncIO.c' '*/tdbOs.c' '*/pushServer.c' '*/osLz4.c'\ + '*/tbase64.c' '*/tbuffer.c' '*/tdes.c' '*/texception.c' '*/examples/*' '*/tidpool.c' '*/tmempool.c'\ + '*/clientJniConnector.c' '*/clientTmqConnector.c' '*/version.cc' '*/strftime.c' '*/localtime.c'\ + '*/tthread.c' '*/tversion.c' '*/ctgDbg.c' '*/schDbg.c' '*/qwDbg.c' '*/version.c' '*/tencode.h' \ + '*/shellAuto.c' '*/shellTire.c' '*/shellCommand.c' '*/debug/*' '*/tests/*'\ + '*/tsdbFile.c' '*/tsdbUpgrade.c' '*/tsdbFS.c' '*/tsdbReaderWriter.c' '*/taos-tools/*' '*/tools/*'\ + '*/sql.c' '*/sql.y' '*/smaSnapshot.c' '*/smaCommit.c'\ + --rc lcov_branch_coverage=1 -o coverage.info + + # generate result + echo "generate result" + lcov -l --rc lcov_branch_coverage=1 coverage.info + + sed -i 's/\/home\/TDinternal\/community\/sql.c/\/home\/TDinternal/\community\/source\/libs\/parser\/inc\/sql.c/g' coverage.info + sed -i 's/\/home\/TDinternal\/community\/sql.y/\/home\/TDinternal/\community\/source\/libs\/parser\/inc\/sql.y/g' coverage.info + + # push result to coveralls.io + echo "push result to coveralls.io" + /usr/local/bin/coveralls-lcov -t WOjivt0JCvDfqHDpyBQXtqhYbOGANrrps -b $BRANCH $TDENGINE_DIR/coverage.info +} + + +###################### +# main entry +###################### + +# Initialization parameter +PROJECT_DIR="" +CAPTURE_GCDA_DIR="" +BRANCH="" + +# Parse command line parameters +while getopts "hd:b:f:" arg; do + case $arg in + d) + PROJECT_DIR=$OPTARG + ;; + b) + BRANCH=$OPTARG + ;; + f) + CAPTURE_GCDA_DIR=$OPTARG + ;; + h) + printHelp + ;; + ?) + echo "Usage: ./$(basename $0) -h" + exit 1 + ;; + esac +done + +# Show all parameters +print_color "$GREEN" "Run coverage test on workflow!" +get_DIR +echo "PROJECT_DIR = $PROJECT_DIR" +echo "TDENGINE_DIR = $TDENGINE_DIR" +echo "BUILD_DIR = $BUILD_DIR" +echo "CAPTURE_GCDA_DIR = $CAPTURE_GCDA_DIR" + +lcovFunc +print_color "$GREEN" "End of coverage test on workflow!" From 532d7f676f0edd0a06126b4a8c14fb5dbf76cd59 Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Sun, 23 Mar 2025 11:28:40 +0800 Subject: [PATCH 14/21] test:alter build sh --- tests/parallel_test/container_build_coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/parallel_test/container_build_coverage.sh b/tests/parallel_test/container_build_coverage.sh index ca83f342b8..0cf4691d98 100755 --- a/tests/parallel_test/container_build_coverage.sh +++ b/tests/parallel_test/container_build_coverage.sh @@ -78,7 +78,7 @@ docker run \ -v ${REP_REAL_PATH}/community/contrib/pcre2/:${REP_DIR}/community/contrib/pcre2 \ -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 "cd $REP_DIR; rm -rf debug; mkdir -p debug; cd debug; cmake .. -DCOVER=true -DBUILD_TEST=true -DBUILD_HTTP=false -DBUILD_TOOLS=true -DWEBSOCKET=true -DBUILD_GEOS=true ; make -j install|| exit 1" + --rm --ulimit core=-1 taos_test:v1.0 sh -c "cd $REP_DIR; rm -rf debug; mkdir -p debug; cd debug; cmake .. -DCOVER=true -DBUILD_TEST=true -DBUILD_TOOLS=true -DWEBSOCKET=true -DBUILD_GEOS=true ; make -j install|| exit 1" if [[ -d ${WORKDIR}/debugNoSan ]] ;then From 61efe5747bdcd9a8a7074ec9cfea39e9b11d6db4 Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Sun, 23 Mar 2025 13:19:12 +0800 Subject: [PATCH 15/21] test:alter build sh --- tests/parallel_test/container_build_coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/parallel_test/container_build_coverage.sh b/tests/parallel_test/container_build_coverage.sh index 0cf4691d98..ca83f342b8 100755 --- a/tests/parallel_test/container_build_coverage.sh +++ b/tests/parallel_test/container_build_coverage.sh @@ -78,7 +78,7 @@ docker run \ -v ${REP_REAL_PATH}/community/contrib/pcre2/:${REP_DIR}/community/contrib/pcre2 \ -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 "cd $REP_DIR; rm -rf debug; mkdir -p debug; cd debug; cmake .. -DCOVER=true -DBUILD_TEST=true -DBUILD_TOOLS=true -DWEBSOCKET=true -DBUILD_GEOS=true ; make -j install|| exit 1" + --rm --ulimit core=-1 taos_test:v1.0 sh -c "cd $REP_DIR; rm -rf debug; mkdir -p debug; cd debug; cmake .. -DCOVER=true -DBUILD_TEST=true -DBUILD_HTTP=false -DBUILD_TOOLS=true -DWEBSOCKET=true -DBUILD_GEOS=true ; make -j install|| exit 1" if [[ -d ${WORKDIR}/debugNoSan ]] ;then From eb81dbbfeed9b8a8d3db65821f5b7a5ed1d5f833 Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Sun, 23 Mar 2025 13:27:38 +0800 Subject: [PATCH 16/21] test:add branch 3.0 --- .github/workflows/tdengine-test-coverage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tdengine-test-coverage.yml b/.github/workflows/tdengine-test-coverage.yml index 6c329cb1dd..084450c6dd 100644 --- a/.github/workflows/tdengine-test-coverage.yml +++ b/.github/workflows/tdengine-test-coverage.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - 'test/cover1' + - '3.0' workflow_dispatch: inputs: specified_source_branch: From 288c94d376054a37c4c9500aaf16be2fc8a2c9df Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Mon, 24 Mar 2025 10:20:38 +0800 Subject: [PATCH 17/21] test:alter yml name --- .github/workflows/tdengine-test-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tdengine-test-coverage.yml b/.github/workflows/tdengine-test-coverage.yml index 084450c6dd..f5cfac0fe0 100644 --- a/.github/workflows/tdengine-test-coverage.yml +++ b/.github/workflows/tdengine-test-coverage.yml @@ -1,4 +1,4 @@ -name: TDengine Test coverage +name: TDengine Taosd & Taosc Coverage on: pull_request: From c8a4f561887ef986ae7f5c01907e43b1d01cb94f Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Mon, 24 Mar 2025 15:09:32 +0800 Subject: [PATCH 18/21] test:alter yml work on --- .github/workflows/tdengine-test-coverage.yml | 28 ++++++-------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/.github/workflows/tdengine-test-coverage.yml b/.github/workflows/tdengine-test-coverage.yml index f5cfac0fe0..cb66977e29 100644 --- a/.github/workflows/tdengine-test-coverage.yml +++ b/.github/workflows/tdengine-test-coverage.yml @@ -1,27 +1,17 @@ name: TDengine Taosd & Taosc Coverage on: - pull_request: - branches: - - 'test/cover1' - - '3.0' workflow_dispatch: inputs: - specified_source_branch: - description: 'Enter the source branch name of TDengine' - required: true - type: string - specified_target_branch: - description: 'Enter the target branch name of TDengine' - required: true - type: string - specified_pr_number: - description: 'Enter the PR number of TDengine' + specified_test_branch: + description: 'Enter the test branch name of TDengine' required: true type: string + schedule: + - cron: '30 00 * * *' concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }}-${{ github.event.inputs.specified_target_branch }}-${{ github.event.inputs.specified_pr_number }}-TDengine + group: ${{ github.workflow }}-${{ github.event.inputs.specified_test_branch || '3.0' }}-TDengine cancel-in-progress: true env: @@ -29,10 +19,8 @@ env: jobs: run-tests-on-linux: - uses: taosdata/.github/.github/workflows/run-coverage-tests-on-linux.yml@test_coverage - if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'}} + uses: taosdata/.github/.github/workflows/run-coverage-tests-on-linux.yml@3.0 + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'}} with: tdinternal: false - specified_source_branch: ${{ github.event_name == 'pull_request' && 'unavailable' || github.event.inputs.specified_source_branch }} - specified_target_branch: ${{ github.event_name == 'pull_request' && 'unavailable' || github.event.inputs.specified_target_branch }} - specified_pr_number: ${{ github.event_name == 'pull_request' && 'unavailable' || github.event.inputs.specified_pr_number }} + specified_test_branch: ${{ github.event_name == 'schedule' && 'unavailable' || github.event.inputs.specified_test_branch || '3.0' }} From 2aa63c405a7d9ff3b43ea464d86073fe8094eba7 Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Mon, 24 Mar 2025 15:30:06 +0800 Subject: [PATCH 19/21] test:alter lcov remote path --- tests/run_workflow_coverage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/run_workflow_coverage.sh b/tests/run_workflow_coverage.sh index b83926bec2..01b7730f53 100755 --- a/tests/run_workflow_coverage.sh +++ b/tests/run_workflow_coverage.sh @@ -60,7 +60,7 @@ function lcovFunc { # collect data lcov -d "$CAPTURE_GCDA_DIR" -capture --rc lcov_branch_coverage=1 --rc genhtml_branch_coverage=1 --no-external -b $TDENGINE_DIR -o coverage.info - # remove exclude paths '*/taos-tools/*' '*/tools/*' 后面add + # remove exclude paths lcov --remove coverage.info \ '*/contrib/*' '*/test/*' '*/packaging/*' '*/taos-tools/deps/*' '*/taosadapter/*' '*/TSZ/*' \ '*/AccessBridgeCalls.c' '*/ttszip.c' '*/dataInserter.c' '*/tlinearhash.c' '*/tsimplehash.c' '*/tsdbDiskData.c' '/*/enterprise/*' '*/docs/*' '*/sim/*'\ @@ -69,7 +69,7 @@ function lcovFunc { '*/clientJniConnector.c' '*/clientTmqConnector.c' '*/version.cc' '*/strftime.c' '*/localtime.c'\ '*/tthread.c' '*/tversion.c' '*/ctgDbg.c' '*/schDbg.c' '*/qwDbg.c' '*/version.c' '*/tencode.h' \ '*/shellAuto.c' '*/shellTire.c' '*/shellCommand.c' '*/debug/*' '*/tests/*'\ - '*/tsdbFile.c' '*/tsdbUpgrade.c' '*/tsdbFS.c' '*/tsdbReaderWriter.c' '*/taos-tools/*' '*/tools/*'\ + '*/tsdbFile.c' '*/tsdbUpgrade.c' '*/tsdbFS.c' '*/tsdbReaderWriter.c' \ '*/sql.c' '*/sql.y' '*/smaSnapshot.c' '*/smaCommit.c'\ --rc lcov_branch_coverage=1 -o coverage.info From 2e2983512491b0cb2f0df3bbd7e4db5d4ddf11ee Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Tue, 25 Mar 2025 11:38:31 +0800 Subject: [PATCH 20/21] test:alter cover name --- .github/workflows/tdengine-test-coverage.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tdengine-test-coverage.yml b/.github/workflows/tdengine-test-coverage.yml index cb66977e29..2e636f938b 100644 --- a/.github/workflows/tdengine-test-coverage.yml +++ b/.github/workflows/tdengine-test-coverage.yml @@ -1,4 +1,6 @@ -name: TDengine Taosd & Taosc Coverage +# Coverage test for taosd & taosc + +name: TDengine Coverage on: workflow_dispatch: From 5a191545680a858369dff8f0c1fc124aabf25665 Mon Sep 17 00:00:00 2001 From: WANG Xu Date: Tue, 25 Mar 2025 11:50:21 +0800 Subject: [PATCH 21/21] fix: branch --- .github/workflows/tdengine-test-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tdengine-test-coverage.yml b/.github/workflows/tdengine-test-coverage.yml index 2e636f938b..2ad8cf707a 100644 --- a/.github/workflows/tdengine-test-coverage.yml +++ b/.github/workflows/tdengine-test-coverage.yml @@ -21,7 +21,7 @@ env: jobs: run-tests-on-linux: - uses: taosdata/.github/.github/workflows/run-coverage-tests-on-linux.yml@3.0 + uses: taosdata/.github/.github/workflows/run-coverage-tests-on-linux.yml@main if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'}} with: tdinternal: false