Skip to content

Commit

Permalink
fix cases issue
Browse files Browse the repository at this point in the history
  • Loading branch information
liuqiyuan committed Feb 2, 2024
1 parent 6d6743b commit 891b610
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/selfhost_intergration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
build-openmldb:

runs-on: [self-hosted,generic]
if: github.repository == '4paradigm/OpenMLDB' || github.repository == 'lqy222/OpenMLDB'
if: github.repository == '4paradigm/OpenMLDB'
container:
image: ghcr.io/4paradigm/hybridsql:latest
env:
Expand Down Expand Up @@ -345,8 +345,8 @@ jobs:
bash test/steps/format_config.sh $(pwd)/${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux ${{ github.job }} 24001 25000 java hadoop
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/deploy-all.sh
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/start-all.sh
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
bash ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/stop-taskmanagers.sh
HADOOP_CONF_DIR=/mnt/hdd0/denglong/openmldb_runner_work/hadoop ${{ github.job }}/openmldb-${{ env.E_VERSION }}-linux/sbin/stop-taskmanagers.sh
- name: test
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
Expand Down
6 changes: 3 additions & 3 deletions cases/integration_test/expression/test_type.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,9 @@ cases:
columns: ["id int32", "string_c1 string", "string_c2 string", "string_c3 string", "string_c4 string", "string_c5 string",
"string_c6 string", "string_c7 string", "string_c8 string", "string_c9 string", "string_c10 string"]
rows:
- [1, "1", "1", "1", "1", "1.0", "2020-05-22 10:43:40", "2020-05-22", "2020-05-22 10:43:40", "true", "1"]
- [2, "-1", "-1", "-1", "-1", "-1.0", "2020-05-22 10:43:40", "2020-05-22", "2020-05-22 10:43:40", "false", "-1"]
- [3, "-1", "-1", "-1", "-1", "-1.0", NULL, "2020-05-22", "2020-05-22 10:43:40", "false", ""]
- [1, "1", "1", "1", "1", "1", "2020-05-22 10:43:40", "2020-05-22", "2020-05-22 10:43:40", "true", "1"]
- [2, "-1", "-1", "-1", "-1", "-1", "2020-05-22 10:43:40", "2020-05-22", "2020-05-22 10:43:40", "false", "-1"]
- [3, "-1", "-1", "-1", "-1", "-1", NULL, "2020-05-22", "2020-05-22 10:43:40", "false", ""]
- id: 20
desc: cast as date
mode: offline-unsupport,disk-unsupport
Expand Down
31 changes: 31 additions & 0 deletions test/integration-test/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# README

## 参数配置脚本

```
test/format_config.sh {openmldbPath} {jobName} {portFrom} {portTo} {type} {Dependency}
```
配置生成在 out/openmldb_info.yaml

Dependency为hadoop时使用hadoop config

Dependency为ssd时禁止部署在node-1

## 一键运行脚本
```
test/openmldb-integration-test.sh -c {caseXML} -d {deployMode} -j {jarVersion} -l {caseLevel} -s {tableStorageMode} -m {executeMode}
```

### 版本兼容性测试
openmldb包版本设置: test/format_config.sh {openmldbPath}

jar版本设置: test/openmldb-integration-test.sh -j {jarVersion}

### kafka测试
```
test/integration-test/openmldb-test-java/kafka_test.sh
```
环境配置于node-4: kakfa_test(docker)

## 回归测试workflow
hadoop配置文件位于 /mnt/hdd0/denglong/openmldb_runner_work/hadoop
18 changes: 18 additions & 0 deletions test/integration-test/openmldb-test-java/kafka_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#! /bin/bash

apiserver="$(awk -F '"' 'NR==7{print $2}' ../../../out/openmldb_info.yaml)"
zkc="zk=""$(awk -F '"' 'NR==2{print $2}' ../../../out/openmldb_info.yaml)"
zkpath="\&zkPath=""$(awk -F '"' 'NR==3{print $2}' ../../../out/openmldb_info.yaml)"
echo "${zkc}"
echo "${zkpath}"
zk="${zkc}""${zkpath}"

docker exec -it kafka_test /start.sh "${zk}"
sed -i "s#\"bootstrap.servers\":.*#\"bootstrap.servers\":node-4:9092,#" openmldb-ecosystem/src/test/resources/kafka_test_cases.yml
sed -i "s#\"connect.listeners\":.*#\"connect.listeners\":http://node-4:8083,#" openmldb-ecosystem/src/test/resources/kafka_test_cases.yml
sed -i "s#apiserver.address:.*#apiserver.address: "${apiserver}"#" openmldb-ecosystem/src/test/resources/kafka_test_cases.yml

Check warning on line 13 in test/integration-test/openmldb-test-java/kafka_test.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] reported by reviewdog 🐶 The surrounding quotes actually unquote this. Remove or escape them. [SC2027](https://github.com/koalaman/shellcheck/wiki/SC2027) Raw Output: ./test/integration-test/openmldb-test-java/kafka_test.sh:13:52:warning:The surrounding quotes actually unquote this. Remove or escape them. [SC2027](https://github.com/koalaman/shellcheck/wiki/SC2027)

Check warning on line 13 in test/integration-test/openmldb-test-java/kafka_test.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086) Raw Output: ./test/integration-test/openmldb-test-java/kafka_test.sh:13:52:info:Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086)
sed -i "s#kafka_test?.*#kafka_test?"${zk}"\"#" openmldb-ecosystem/src/test/resources/kafka_test_cases.yml

Check warning on line 14 in test/integration-test/openmldb-test-java/kafka_test.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] reported by reviewdog 🐶 The surrounding quotes actually unquote this. Remove or escape them. [SC2027](https://github.com/koalaman/shellcheck/wiki/SC2027) Raw Output: ./test/integration-test/openmldb-test-java/kafka_test.sh:14:37:warning:The surrounding quotes actually unquote this. Remove or escape them. [SC2027](https://github.com/koalaman/shellcheck/wiki/SC2027)

Check warning on line 14 in test/integration-test/openmldb-test-java/kafka_test.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086) Raw Output: ./test/integration-test/openmldb-test-java/kafka_test.sh:14:37:info:Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086)

mvn test -pl openmldb-ecosystem

docker exec -it kafka_test /stop.sh
5 changes: 3 additions & 2 deletions test/steps/openmldb-integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ 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#')
#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}"
mkdir -p ../mvnrepo
export MAVEN_OPTS="-Dmaven.repo.local=$(pwd)/../mvnrepo"
MAVEN_REPO="-Dmaven.repo.local=$(pwd)/../mvnrepo"
export MAVEN_OPTS="${MAVEN_REPO}"
mvn install:install-file -Dfile=openmldb-batch.jar -DartifactId=openmldb-batch -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
Expand Down

0 comments on commit 891b610

Please sign in to comment.