Skip to content

Commit

Permalink
update integration workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
liuqiyuan committed Dec 15, 2023
1 parent 1fab439 commit 5f66db8
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 23 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/selfhost_intergration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/deploy-all.sh
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/start-all.sh
- name: test
run: bash test/steps/openmldb-apiserver-test.sh -j 0.0.0 -d deploy
run: bash test/steps/openmldb-integration-test.sh -j 0.0.0 -d deploy -m apiserver
- name: stop openmldb
if: always()
run: bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/stop-all.sh
Expand All @@ -102,6 +102,7 @@ jobs:
server_port: 995
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
secure: true
subject: OpenMLDB Memory Test
body: OpenMLDB Memory Test Failed
html_body: test/integration-test/openmldb-test-java/openmldb-sdk-test/target/surefire-reports/html/overview.html
Expand Down Expand Up @@ -129,7 +130,7 @@ jobs:
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/deploy-all.sh
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/start-all.sh
- name: test
run: bash test/steps/openmldb-javasdk-integration.sh -j 0.0.0 -c test_cluster.xml -d deploy -l "0" -s "memory"
run: bash test/steps/openmldb-integration-test.sh -j 0.0.0 -c test_cluster.xml -d deploy -l "0" -s "memory"
- name: stop openmldb
if: always()
run: bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/stop-all.sh
Expand All @@ -154,6 +155,7 @@ jobs:
server_port: 995
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
secure: true
subject: OpenMLDB Memory Test
body: OpenMLDB Memory Test Failed
html_body: test/integration-test/openmldb-test-java/openmldb-sdk-test/target/surefire-reports/html/overview.html
Expand Down Expand Up @@ -182,7 +184,7 @@ jobs:
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/deploy-all.sh
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/start-all.sh
- name: test
run: bash test/steps/openmldb-javasdk-integration.sh -j 0.0.0 -c test_cluster.xml -d deploy -l "1,2,3,4,5" -s "memory"
run: bash test/steps/openmldb-integration-test.sh -j 0.0.0 -c test_cluster.xml -d deploy -l "1,2,3,4,5" -s "memory"
- name: stop openmldb
if: always()
run: bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/stop-all.sh
Expand All @@ -207,6 +209,7 @@ jobs:
server_port: 995
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
secure: true
subject: OpenMLDB Memory Test
body: OpenMLDB Memory Test Failed
html_body: test/integration-test/openmldb-test-java/openmldb-sdk-test/target/surefire-reports/html/overview.html
Expand Down Expand Up @@ -236,7 +239,7 @@ jobs:
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/deploy-all.sh
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/start-all.sh
- name: test
run: bash test/steps/openmldb-javasdk-integration.sh -j 0.0.0 -c test_cluster_disk.xml -d deploy -l "0" -s "hdd"
run: bash test/steps/openmldb-integration-test.sh -j 0.0.0 -c test_cluster_disk.xml -d deploy -l "0" -s "hdd"
- name: stop openmldb
if: always()
run: bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/stop-all.sh
Expand All @@ -261,6 +264,7 @@ jobs:
server_port: 995
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
secure: true
subject: OpenMLDB HDD Test
body: OpenMLDB HDD Test Failed
html_body: test/integration-test/openmldb-test-java/openmldb-sdk-test/target/surefire-reports/html/overview.html
Expand Down Expand Up @@ -289,7 +293,7 @@ jobs:
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/deploy-all.sh
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/start-all.sh
- name: test
run: bash test/steps/openmldb-javasdk-integration.sh -j 0.0.0 -c test_cluster_disk.xml -d deploy -l "0" -s "ssd"
run: bash test/steps/openmldb-integration-test.sh -j 0.0.0 -c test_cluster_disk.xml -d deploy -l "0" -s "ssd"
- name: stop openmldb
if: always()
run: bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/stop-all.sh
Expand All @@ -314,6 +318,7 @@ jobs:
server_port: 995
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
secure: true
subject: OpenMLDB SSD Test
body: OpenMLDB SSD Test Failed
html_body: test/integration-test/openmldb-test-java/openmldb-sdk-test/target/surefire-reports/html/overview.html
Expand Down Expand Up @@ -343,7 +348,7 @@ jobs:
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/stop-taskmanager.sh
bash HADOOP_CONF_DIR=/mnt/hdd0/denglong/openmldb_runner_work/hadoop ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/stop-taskmanager.sh
- name: test
run: bash test/steps/openmldb-javasdk-integration.sh -j 0.0.0 -c test_yarn.xml -d deploy -l "0" -s "memory"
run: bash test/steps/openmldb-integration-test.sh -j 0.0.0 -c test_yarn.xml -d deploy -l "0" -s "memory"
- name: stop openmldb
if: always()
run: bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/stop-all.sh
Expand All @@ -368,6 +373,7 @@ jobs:
server_port: 995
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
secure: true
subject: OpenMLDB yarn Test
body: OpenMLDB yarn Test Failed
html_body: test/integration-test/openmldb-test-java/openmldb-sdk-test/target/surefire-reports/html/overview.html
Expand Down Expand Up @@ -419,6 +425,7 @@ jobs:
# with:
# server_address: mail.4paradigm.com
# server_port: 995
# secure: true
# username: ${{ secrets.MAIL_USERNAME }}
# password: ${{ secrets.MAIL_PASSWORD }}
# subject: OpenMLDB yarn Test
Expand Down
19 changes: 4 additions & 15 deletions test/steps/openmldb-apiserver-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#-d 部署模式,有cluster和standalone两种,默认cluster
#-l 测试的case级别,有0,1,2,3,4,5六个级别,默认为0,也可以同时跑多个级别的case,例如:1,2,3,4,5

while getopts ":b:c:d:l:j:" opt
while getopts ":b:c:d:l:" opt
do
case $opt in
b)
Expand All @@ -39,9 +39,6 @@ do
l) echo "参数l的值:$OPTARG"
CASE_LEVEL=$OPTARG
;;
j) echo "参数j的值:$OPTARG"
JAR_VERSION=$OPTARG
;;
?) echo "未知参数"
exit 1
;;
Expand Down Expand Up @@ -75,28 +72,20 @@ source test/steps/read_properties.sh
# 从源码编译
if [[ "${BUILD_MODE}" == "SRC" ]]; then
JAVA_SDK_VERSION=$(more java/pom.xml | grep "<version>.*</version>" | head -1 | sed 's#.*<version>\(.*\)</version>.*#\1#')
sh test/steps/build-java-sdk.sh
fi
echo "JAVA_SDK_VERSION:${JAVA_SDK_VERSION}"
echo "OPENMLDB_SERVER_VERSION:${OPENMLDB_SERVER_VERSION}"
echo "DIFF_VERSIONS:${DIFF_VERSIONS}"
# modify config
sh test/steps/modify_apiserver_config.sh "${CASE_XML}" "${DEPLOY_MODE}" "${JAVA_SDK_VERSION}" "${BUILD_MODE}" "${OPENMLDB_SERVER_VERSION}"
# install command tool
if [[ "${JAR_VERSION}" == "" ]]; then
JAR_VERSION=${JAVA_SDK_VERSION}
else
mvn install:install-file -Dfile=openmldb-common.jar -DartifactId=openmldb-common -DgroupId=com.4paradigm.openmldb -Dversion=${JAR_VERSION} -Dpackaging=jar
mvn install:install-file -Dfile=openmldb-jdbc.jar -DartifactId=openmldb-jdbc -DgroupId=com.4paradigm.openmldb -Dversion=${JAR_VERSION} -Dpackaging=jar
mvn install:install-file -Dfile=openmldb-native.jar -DartifactId=openmldb-native -DgroupId=com.4paradigm.openmldb -Dversion=${JAR_VERSION} -Dpackaging=jar
fi
cd test/test-tool/command-tool || exit
mvn clean install -Dmaven.test.skip=true -Dopenmldb.native.version=${JAR_VERSION} -Dopenmldb.jdbc.version=${JAR_VERSION} -Dopenmldb.batch.version=${JAR_VERSION}
mvn clean install -Dmaven.test.skip=true
cd "${ROOT_DIR}" || exit
# install jar
cd test/integration-test/openmldb-test-java || exit
mvn clean install -Dmaven.test.skip=true -Dopenmldb.native.version=${JAR_VERSION} -Dopenmldb.jdbc.version=${JAR_VERSION} -Dopenmldb.batch.version=${JAR_VERSION}
mvn clean install -Dmaven.test.skip=true
cd "${ROOT_DIR}" || exit
# run case
cd "${ROOT_DIR}"/test/integration-test/openmldb-test-java/openmldb-http-test || exit
mvn clean test -DsuiteXmlFile=test_suite/"${CASE_XML}" -DcaseLevel="${CASE_LEVEL}" -Dopenmldb.native.version=${JAR_VERSION} -Dopenmldb.jdbc.version=${JAR_VERSION} -Dopenmldb.batch.version=${JAR_VERSION}
mvn clean test -DsuiteXmlFile=test_suite/"${CASE_XML}" -DcaseLevel="${CASE_LEVEL}"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
while getopts ":c:d:l:s:j:" opt
while getopts ":c:d:l:s:j:m:" opt
do
case $opt in
c)
Expand All @@ -19,6 +19,9 @@ do
j) echo "参数j的值:$OPTARG"
JAR_VERSION=$OPTARG
;;
m) echo "参数m的值:$OPTARG"
EXECUTE_MODE=$OPTARG
;;
?) echo "未知参数"
exit 1
;;
Expand All @@ -33,6 +36,9 @@ fi
if [[ "${CASE_LEVEL}" == "" ]]; then
CASE_LEVEL="0"
fi
if [[ "${EXECUTE_MODE}" == "" ]]; then
EXECUTE_MODE="javasdk"
fi

JAVA_SDK_VERSION=$(more java/pom.xml | grep "<version>.*</version>" | head -1 | sed 's#.*<version>\(.*\)</version>.*#\1#')
sh test/steps/modify_java_sdk_config.sh "${CASE_XML}" "${DEPLOY_MODE}" "${JAR_VERSION}" "" "${JAR_VERSION}" "${JAR_VERSION}" "${TABLE_STORAGE_MODE}"
Expand All @@ -44,4 +50,8 @@ mvn install:install-file -Dfile=openmldb-native.jar -DartifactId=openmldb-native

mvn clean install -B -Dmaven.test.skip=true -f test/test-tool/command-tool/pom.xml
mvn clean install -B -Dmaven.test.skip=true -f test/integration-test/openmldb-test-java/pom.xml -Dopenmldb.native.version=${JAR_VERSION} -Dopenmldb.jdbc.version=${JAR_VERSION} -Dopenmldb.batch.version=${JAR_VERSION}
mvn clean test -B -e -U -DsuiteXmlFile=test_suite/"${CASE_XML}" -f test/integration-test/openmldb-test-java/openmldb-sdk-test/pom.xml -DcaseLevel="${CASE_LEVEL}" -Dopenmldb.native.version=${JAR_VERSION} -Dopenmldb.jdbc.version=${JAR_VERSION} -Dopenmldb.batch.version=${JAR_VERSION}
if [[ "${EXECUTE_MODE}" == "javasdk" ]]; then

Check failure on line 53 in test/steps/openmldb-integration-test.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] reported by reviewdog 🐶 Couldn't find 'fi' for this 'if'. [SC1046](https://github.com/koalaman/shellcheck/wiki/SC1046) Raw Output: ./test/steps/openmldb-integration-test.sh:53:1:error:Couldn't find 'fi' for this 'if'. [SC1046](https://github.com/koalaman/shellcheck/wiki/SC1046)

Check failure on line 53 in test/steps/openmldb-integration-test.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] reported by reviewdog 🐶 Couldn't parse this if expression. Fix to allow more checks. [SC1073](https://github.com/koalaman/shellcheck/wiki/SC1073) Raw Output: ./test/steps/openmldb-integration-test.sh:53:1:error:Couldn't parse this if expression. Fix to allow more checks. [SC1073](https://github.com/koalaman/shellcheck/wiki/SC1073)
mvn clean test -B -e -U -DsuiteXmlFile=test_suite/"${CASE_XML}" -f test/integration-test/openmldb-test-java/openmldb-sdk-test/pom.xml -DcaseLevel="${CASE_LEVEL}" -Dopenmldb.native.version=${JAR_VERSION} -Dopenmldb.jdbc.version=${JAR_VERSION} -Dopenmldb.batch.version=${JAR_VERSION}
else if [[ "${EXECUTE_MODE}" == "apiserver" ]]; then

Check failure on line 55 in test/steps/openmldb-integration-test.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] reported by reviewdog 🐶 Use 'elif' instead of 'else if' (or put 'if' on new line if nesting). [SC1075](https://github.com/koalaman/shellcheck/wiki/SC1075) Raw Output: ./test/steps/openmldb-integration-test.sh:55:1:error:Use 'elif' instead of 'else if' (or put 'if' on new line if nesting). [SC1075](https://github.com/koalaman/shellcheck/wiki/SC1075)
mvn clean test -B -e -U -DsuiteXmlFile=test_suite/"${CASE_XML}" -f test/integration-test/openmldb-test-java/openmldb-http-test/pom.xml -DcaseLevel="${CASE_LEVEL}" -Dopenmldb.native.version=${JAR_VERSION} -Dopenmldb.jdbc.version=${JAR_VERSION} -Dopenmldb.batch.version=${JAR_VERSION}
fi

0 comments on commit 5f66db8

Please sign in to comment.