Skip to content

Commit

Permalink
Merge branch 'main' into PR-coverage-moc
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosyrain authored Nov 22, 2024
2 parents 46ef0ab + dbe135a commit 6f8d883
Show file tree
Hide file tree
Showing 19 changed files with 67,612 additions and 75 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,44 @@ on:
S3BUCKET:
description: "S3BUCKET For Test"
required: true
EE_DB_ADDR:
description: "matrixone cloud host"
required: true
EE_DB_PORT:
description: "matrixone cloud port"
required: true
EE_DB_USER:
description: "matrixone cloud user"
required: true
EE_DB_PASSWORD:
description: "matrixone cloud password"
required: true
EE_DB_DB:
description: "matrixone cloud db"
required: true



jobs:
ut-linux-x86:
environment: ci
runs-on: ubuntu-22.04
name: UT Test on Ubuntu/x86
steps:
- name: Parse Time for moc
id: time
run: |
export TZ='Asia/Shanghai'
#utcTime="2024-11-15T08:33:52Z"
action_time=${{ github.event.pull_request.head.repo.pushed_at }}
ACTION_TIME=$(date -d "${action_time}" '+%Y-%m-%d %H:%M:%S')
# 获取格式化的日期时间字符串
time=$(date '+%Y-%m-%d %H:%M:%S')
echo "ACTION_TIME=${ACTION_TIME}" >> $GITHUB_OUTPUT
echo "START_TIME=${time}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
with:
fetch-depth: "3"
Expand All @@ -45,6 +76,7 @@ jobs:
# set ut workdir
echo "UT_WORKDIR=${{ github.workspace }}" >> $GITHUB_ENV
- name: Unit Testing
id: ut
run: |
cd $GITHUB_WORKSPACE && make clean && make config
make ut UT_PARALLEL=6 UT_TIMEOUT=40
Expand All @@ -67,6 +99,7 @@ jobs:
cd $GITHUB_WORKSPACE;
find ./ut-report -name no-test.txt -exec cat {} \+;
- name: Print Failed Packages and Tests
id: failed
if: ${{ always() }}
continue-on-error: true
run: |
Expand All @@ -75,14 +108,33 @@ jobs:
exit 0;
fi
find ./ut-report/failed -name result.txt -exec cat {} \;
fail_ut_cases=''
files=($(find ./ut-report/failed | grep -v result.txt))
for file in "${files[@]}"; do
if [ -d "$file" ]; then
continue
fi
echo "============================================"
cat "${file}";
fail_ut_cases=${fail_ut_cases}$(basename "${file}")','
done
echo "steps.ut.conclusion: ${{ steps.ut.conclusion }}"
echo "FAIL_UT_CASES=${fail_ut_cases}"
echo "FAIL_UT_CASES=${fail_ut_cases}" >> $GITHUB_OUTPUT
- name: Insert Failed UT Cases to MOC
if: ${{ failure() }}
uses: matrixorigin/CI/actions/fail-ut-case@main
with:
action_time: ${{ steps.time.outputs.ACTION_TIME }}
ut_cases: ${{ steps.failed.outputs.FAIL_UT_CASES }}
pr_link: ${{ github.event.pull_request.html_url }}
job_time: ${{ steps.time.outputs.START_TIME }}
mo_host: ${{ secrets.EE_DB_ADDR }}
mo_port: ${{ secrets.EE_DB_PORT }}
mo_user: ${{ secrets.EE_DB_USER }}
mo_password: ${{ secrets.EE_DB_PASSWORD }}
mo_database: ${{ secrets.EE_DB_DB }}
- name: Print the Top 10 Time-Consuming Tests
if: ${{ always() }}
continue-on-error: true
Expand Down
85 changes: 85 additions & 0 deletions .github/workflows/e2e-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ jobs:

- name: Print run attempt
run: echo "run attempt is ${{ github.run_attempt }}"

- name: Print Disk Usage Before Container Start
if: ${{ always() }}
run: |
set +e;
sudo df -h /*;
echo "===========================================";
sudo du -hs /var/lib/docker;
echo "===========================================";
sudo docker system df -v;
- name: docker compose launch-multi-cn
timeout-minutes: 10
Expand Down Expand Up @@ -55,6 +65,23 @@ jobs:
done
docker ps
- name: Print Disk Usage After Container Start
if: ${{ always() }}
run: |
set +e;
sudo df -h /*;
echo "===========================================";
sudo du -hs /var/lib/docker;
echo "===========================================";
sudo docker system df -v;
- name: Clean Docker Image Build Cache
if: ${{ always() }}
run: |
sudo docker builder prune -f -a;
echo "===========================================";
sudo docker system df -v;
- name: Clone test-tool repository
# Node.js 12 actions are deprecated.
# For more information see:
Expand All @@ -69,6 +96,10 @@ jobs:
- name: Set up Go And Java
uses: matrixorigin/CI/actions/setup-env@main

- name: Update BVT SQL Timeout
run: |
cd $GITHUB_WORKSPACE/mo-tester
sed -i "s/socketTimeout:.*/socketTimeout: 300000/g" mo.yml
- name: Start BVT Test
id: bvt_on_pr_version
run: |
Expand All @@ -81,6 +112,16 @@ jobs:
./run.sh -n -g -o -p $GITHUB_WORKSPACE/test/distributed/cases -s /test/distributed/resources -e pessimistic_transaction 2>&1
- name: Print Disk Usage Before Container Shutdown
if: ${{ always() }}
run: |
set +e;
sudo df -h /*;
echo "===========================================";
sudo du -hs /var/lib/docker;
echo "===========================================";
sudo docker system df -v;
- name: export log
if: ${{ failure() || cancelled()}}
run: |
Expand Down Expand Up @@ -127,6 +168,16 @@ jobs:
- name: Print run attempt
run: echo "run attempt is ${{ github.run_attempt }}"

- name: Print Disk Usage Before Container Start
if: ${{ always() }}
run: |
set +e;
sudo df -h /*;
echo "===========================================";
sudo du -hs /var/lib/docker;
echo "===========================================";
sudo docker system df -v;
- name: docker compose launch-multi-cn
timeout-minutes: 10
run: |
Expand All @@ -149,6 +200,24 @@ jobs:
sleep 1
done
docker ps
- name: Print Disk Usage After Container Start
if: ${{ always() }}
run: |
set +e;
sudo df -h /*;
echo "===========================================";
sudo du -hs /var/lib/docker;
echo "===========================================";
sudo docker system df -v;
- name: Clean Docker Image Build Cache
if: ${{ always() }}
run: |
sudo docker builder prune -f -a;
echo "===========================================";
sudo docker system df -v;
- name: Clone test-tool repository
uses: actions/checkout@v4
with:
Expand All @@ -159,6 +228,11 @@ jobs:
- name: Set up Go And Java
uses: matrixorigin/CI/actions/setup-env@main

- name: Update BVT SQL Timeout
run: |
cd $GITHUB_WORKSPACE/mo-tester
sed -i "s/socketTimeout:.*/socketTimeout: 300000/g" mo.yml
- name: Start BVT Test
id: bvt_on_pr_version
run: |
Expand All @@ -170,6 +244,17 @@ jobs:
echo "============================="
./run.sh -n -g -o -p $GITHUB_WORKSPACE/test/distributed/cases -s /test/distributed/resources -e optimistic 2>&1
- name: Print Disk Usage Before Container Shutdown
if: ${{ always() }}
run: |
set +e;
sudo df -h /*;
echo "===========================================";
sudo du -hs /var/lib/docker;
echo "===========================================";
sudo docker system df -v;
- name: export log
if: ${{ failure() || cancelled()}}
run: |
Expand Down
30 changes: 29 additions & 1 deletion .github/workflows/e2e-standalone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
echo "" >> ./etc/launch/cn.toml
echo '[cn.txn]' >> ./etc/launch/cn.toml
echo 'mode = "Optimistic"' >> ./etc/launch/cn.toml
echo " enable-leak-check = 1" >> ./etc/launch/cn.toml
echo ' max-active-ages = "2m"'>> ./etc/launch/cn.toml
echo "" >> ./etc/launch/tn.toml
echo '[tn.txn]' >> ./etc/launch/tn.toml
echo 'mode = "Optimistic"' >> ./etc/launch/tn.toml
Expand All @@ -45,6 +47,10 @@ jobs:
repository: matrixorigin/mo-tester
path: ./mo-tester
ref: main
- name: Update BVT SQL Timeout
run: |
cd $GITHUB_WORKSPACE/mo-tester
sed -i "s/socketTimeout:.*/socketTimeout: 300000/g" mo.yml
- name: Start BVT Test
id: bvt_on_pr_version
run: |
Expand Down Expand Up @@ -145,6 +151,14 @@ jobs:
run: |
sudo bash -c 'echo -e "127.0.0.1\tcn0" >> /etc/hosts;';
sudo bash -c 'echo -e "127.0.0.1\tcn1" >> /etc/hosts;';
- name: Add cn.txn
run: |
cd $GITHUB_WORKSPACE/head
echo "" >> ./etc/launch-dynamic-with-proxy/cn.toml.base
echo "" >> ./etc/launch-dynamic-with-proxy/cn.toml.base
echo "[cn.txn]" >> ./etc/launch-dynamic-with-proxy/cn.toml.base
echo " enable-leak-check = 1" >> ./etc/launch-dynamic-with-proxy/cn.toml.base
echo ' max-active-ages = "2m"'>> ./etc/launch-dynamic-with-proxy/cn.toml.base
- name: Start MO
run: |
sudo cat /etc/hosts | grep '127.0.0.1';
Expand All @@ -156,6 +170,10 @@ jobs:
repository: matrixorigin/mo-tester
path: ./mo-tester
ref: main
- name: Update BVT SQL Timeout
run: |
cd $GITHUB_WORKSPACE/mo-tester
sed -i "s/socketTimeout:.*/socketTimeout: 300000/g" mo.yml
- name: Start BVT Test
id: bvt_on_pr_version
run: |
Expand Down Expand Up @@ -219,6 +237,13 @@ jobs:
cd $GITHUB_WORKSPACE/head && make clean && make build
git rev-parse --short HEAD
- name: Add cn.txn
run: |
cd $GITHUB_WORKSPACE/head
echo "[cn.txn]" >> ./etc/launch/cn.toml
echo " enable-leak-check = 1" >> ./etc/launch/cn.toml
echo ' max-active-ages = "2m"'>> ./etc/launch/cn.toml
- name: echo config
run: |
cd $GITHUB_WORKSPACE/head
Expand All @@ -236,7 +261,10 @@ jobs:
repository: matrixorigin/mo-tester
path: ./mo-tester
ref: main

- name: Update BVT SQL Timeout
run: |
cd $GITHUB_WORKSPACE/mo-tester
sed -i "s/socketTimeout:.*/socketTimeout: 300000/g" mo.yml
- name: Start BVT Test
id: bvt_on_pr_version
run: |
Expand Down
Loading

0 comments on commit 6f8d883

Please sign in to comment.