Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: test non-x86 #496

Merged
merged 8 commits into from
Nov 29, 2022
2 changes: 1 addition & 1 deletion .github/workflows/3.0-non-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
apt install -y cmake build-essential git libjansson-dev libsnappy-dev liblzma-dev libz-dev pkg-config libssl-dev > /dev/null

echo "clone TDengine 3.0 on ${{ steps.setup.outputs.uname }}"
git clone --branch feat/sangshuduo/TD-16450-taosdump-for-windows --depth 1 https://github.com/taosdata/TDengine > /dev/null || exit 1
git clone --branch 3.0 --depth 1 https://github.com/taosdata/TDengine > /dev/null || exit 1

echo "build TDengine 3.0 on ${{ steps.setup.outputs.uname }}"
cd TDengine || exit 1
Expand Down
217 changes: 217 additions & 0 deletions .github/workflows/3.0-taosBenchmark-debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
name: Ubuntu (3.0 taosbenchmark debug)

on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

env:
TOOLS_BUILD_TYPE: Debug
PR_NUMBER: ${{ github.event.number }}

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Step that prints name of pull request's base branch
run: |
echo "Pull request's base branch is: ${BASE_BRANCH}"
echo "Pull request's branch is: ${GITHUB_REF##*/}"
echo "Pull request's head ref is: ${GITHUB_HEAD_REF}"
env:
BASE_BRANCH: ${{ github.base_ref }}
if: github.event_name == 'pull_request'

- uses: actions/checkout@v3
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v23.2

- name: List all changed files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done

- name: Get specific changed files
id: changed-files-specific
uses: tj-actions/changed-files@v23.2
with:
files: |
src/bench*
src/CMakeLists.txt
inc/*
tests/taosbenchmark/*
tests/taosbenchmark/ws/*
packaging/tools/*
.github/workflows/3.0-taosBenchmark-debug.yml

- name: Run step if any of the listed files above change
if: steps.changed-files-specific.outputs.any_changed == 'true'
run: |
echo "One or more files listed above has changed."

- name: Checkout TDengine 3.0
uses: actions/checkout@v2
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: '3.0'

- name: Change time zone
if: |
(steps.changed-files-specific.outputs.any_changed == 'true'
&& github.event_name == 'pull_request')
|| github.event_name == 'push'
run: |
sudo timedatectl set-timezone Asia/Shanghai
sudo date

- name: Set up Go
if: |
(steps.changed-files-specific.outputs.any_changed == 'true'
&& github.event_name == 'pull_request')
|| github.event_name == 'push'
uses: actions/setup-go@v3
with:
go-version: 1.14

- name: Set up Rust
if: |
(steps.changed-files-specific.outputs.any_changed == 'true'
&& github.event_name == 'pull_request')
|| github.event_name == 'push'
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- uses: actions/cache@v3
id: cache-rust
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ steps.setup-rust.outputs.rustc_hash }}

- name: Build & Install TDengine
if: |
(steps.changed-files-specific.outputs.any_changed == 'true'
&& github.event_name == 'pull_request')
|| github.event_name == 'push'
run: |
cd TDengine && mkdir debug && cd debug && cmake .. -DBUILD_HTTP=false -DWEBSOCKET=true > /dev/null && make -j8 > /dev/null && sudo make install > /dev/null && cd .. && rm -rf debug
if [[ ! -f /usr/local/taos/bin/taosd ]] || [[ ! -f /usr/local/taos/bin/taosadapter ]]
then
echo "TDengine build failure"
exit 1
fi

- name: Install packages for build taos-tools
if:
(steps.changed-files-specific.outputs.any_changed == 'true'
&& github.event_name == 'pull_request')
|| github.event_name == 'push'
run: |
sudo apt update > /dev/null
sudo apt install lzma-dev liblzma-dev libjansson-dev libz-dev libsnappy-dev pkg-config expect -y > /dev/null

- name: Checkout taos-tools to PR number
if:
(steps.changed-files-specific.outputs.any_changed == 'true'
&& github.event_name == 'pull_request')
run: |
git fetch origin +refs/pull/${{env.PR_NUMBER}}/merge
git checkout -qf FETCH_HEAD

- name: Build taos-tools
if: |
(steps.changed-files-specific.outputs.any_changed == 'true'
&& github.event_name == 'pull_request')
|| github.event_name == 'push'
run: |
mkdir debug ||:
cd debug
cmake .. -DTOOLS_BUILD_TYPE=Debug -DTOOLS_SANITIZE=true -DWEBSOCKET=true > /dev/null && make -j8 > /dev/null && sudo make install > /dev/null
if [[ ! -f /usr/local/taos/bin/taosdump ]] || [[ ! -f /usr/local/taos/bin/taosBenchmark ]]
then
echo "taos-tools build failure"
exit 1
fi

- name: Install python packages
if: |
(steps.changed-files-specific.outputs.any_changed == 'true'
&& github.event_name == 'pull_request')
|| github.event_name == 'push'
run: |
pip3 install numpy fabric2 psutil pandas faker toml > /dev/null 2>&1
pip3 install git+https://github.com/taosdata/taos-connector-python > /dev/null

- name: Test
if:
(steps.changed-files-specific.outputs.any_changed == 'true'
&& github.event_name == 'pull_request')
|| github.event_name == 'push'
run: |
cd tests

if find taosbenchmark -name "*.py"|grep -q .;
then
for i in `find taosbenchmark -name "*.py"|grep -Ev "websocket|taosdemo|kill-slow-query"|sort`; do printf $i && python3 ./test.py -f $i > /dev/null && echo -e " \033[32m taosbenchmark-release-test/$i success! \033[0m"|| echo -e " \033[31m taosbenchmark-release-test/$i failed! \033[0m" | tee -a ~/taosbenchmark-release-failed.txt; done
fi

- name: Test WebSocket
if:
(steps.changed-files-specific.outputs.any_changed == 'true'
&& github.event_name == 'pull_request')
|| github.event_name == 'push'
run: |
#cd tests

#if find taosbenchmark/ws -name "*.py"|grep -q .;
#then
# for i in `find taosbenchmark/ws -name "*.py"`; do printf $i && python3 ./test.py -f $i > /dev/null && echo -e " \033[32m benchmark-ws-test:$i success! \033[0m"|| echo -e " \033[31m benchmark-ws-test:$i failed! \033[0m" | tee -a ~/benchmark-ws-failed.txt; done
#fi

- name: Test taosdemo query
if:
(steps.changed-files-specific.outputs.any_changed == 'true'
&& github.event_name == 'pull_request')
|| github.event_name == 'push'
run: |
cd tests

if find taosbenchmark -name "taosdemo*.py"|grep -q .;
then
for i in `find taosbenchmark -name "taosdemo*.py"`; do printf $i && python3 ./test.py -f $i && echo -e "\033[32m $i success! \033[0m"|| echo -e "\033[31m $i failed! \033[0m" | tee -a ~/taosbenchmark-release-failed.txt; done
fi

- name: 'Upload taosd logs'
uses: actions/upload-artifact@v3
with:
name: log-v3-taosd
path: /var/log/taos/
retention-days: 2

- name: Check Test Result
if:
(steps.changed-files-specific.outputs.any_changed == 'true'
&& github.event_name == 'pull_request')
|| github.event_name == 'push'
run: |
if [ -f ~/taosbenchmark-release-failed.txt ];then
cat ~/taosbenchmark-release-failed.txt
exit 1
fi

if [ -f ~/benchmark-ws-failed.txt ];then
cat ~/benchmark-ws-failed.txt
exit 1
fi
2 changes: 2 additions & 0 deletions .github/workflows/3.0-taosBenchmark-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ jobs:
with:
files: |
src/bench*
src/CMakeLists.txt
inc/*
tests/taosbenchmark/*
tests/taosbenchmark/ws/*
packaging/tools/*
.github/workflows/3.0-taosBenchmark-release.yml
Expand Down