Skip to content

Commit

Permalink
CI: run test with beta version (#5590)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoucheng361 authored Jan 21, 2025
1 parent 1660905 commit 66a5a87
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 32 deletions.
46 changes: 15 additions & 31 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ inputs:
description: 'build target: juicefs, juicefs.fdb etc'
required: true
default: 'juicefs'
useBeta:
description: 'use beta version of juicefs to skip build'
required: true
type: boolean
default: false
beta:
description: 'beta version for the following test'
required: false
runs:
using: "composite"
steps:
Expand Down Expand Up @@ -43,29 +41,15 @@ runs:
- name: Build linux target
shell: bash
run: |
if ${{ inputs.useBeta }}; then
echo "try use beta version of juicefs"
if wget -q https://juicefs-pub.oss-cn-hangzhou.aliyuncs.com/${{inputs.target}}; then
[ "${{inputs.target}}" != "juicefs" ] && mv ${{inputs.target}} juicefs
sudo chmod +x juicefs
version=$(./juicefs version)
date1=$( echo $version | grep -oP '\d{4}-\d{2}-\d{2}')
date2=$(date +%Y-%m-%d)
if [ "$date1" == "$date2" ]; then
echo beta version is up to date, $version, use it to skip build
exit 0
else
echo beta version is out of date, $version, remove it and build
rm -f juicefs
fi
fi
fi
echo "start to build ${{inputs.target}}"
make ${{inputs.target}}.cover
if ${{ inputs.useBeta }}; then
echo "upload beta version"
curl --upload-file ${{inputs.target}} https://juicefs-pub.oss-cn-hangzhou.aliyuncs.com/
echo "upload beta version succeed"
fi
[ "${{inputs.target}}" != "juicefs" ] && mv ${{inputs.target}} juicefs
echo "build ${{inputs.target}} succeed"
if [[ -n "${{ inputs.beta }}" ]]; then
echo "use beta version of juicefs: ${{inputs.beta}}"
wget -q https://juicefs-com-static.oss-cn-shanghai.aliyuncs.com/juicefs_beta/${{inputs.beta}} -O juicefs
chmod +x juicefs
./juicefs version
else
echo "start to build ${{inputs.target}}"
make ${{inputs.target}}.cover
[ "${{inputs.target}}" != "juicefs" ] && mv ${{inputs.target}} juicefs
./juicefs version
echo "build ${{inputs.target}} succeed"
fi
6 changes: 5 additions & 1 deletion .github/scripts/sync/sync_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,19 @@ test_sync_without_mount_point2(){
./mc cp -r data myminio/data

# (./mc rb myminio/data1 > /dev/null 2>&1 --force || true) && ./mc mb myminio/data1
set -o pipefail
sudo -u juicedata meta_url=$META_URL ./juicefs sync -v minio://minioadmin:[email protected]:9000/data/ jfs://meta_url/ \
--manager-addr 172.20.0.1:8081 --worker [email protected],[email protected] \
--list-threads 10 --list-depth 5\
2>&1 | tee sync.log
set +o pipefail
check_sync_log $file_count
set -o pipefail
sudo -u juicedata meta_url=$META_URL ./juicefs sync -v minio://minioadmin:[email protected]:9000/data/ jfs://meta_url/ \
--manager-addr 172.20.0.1:8081 --worker [email protected],[email protected] \
--list-threads 10 --list-depth 5 --check-all \
2>&1 | tee sync.log
set +o pipefail
./juicefs mount -d $META_URL /jfs
diff data/ /jfs/data/
./mc rm -r --force myminio/data
Expand Down Expand Up @@ -120,7 +124,7 @@ skip_test_sync_between_oss(){
}

check_sync_log(){
grep "<FATAL>" sync.log && exit 1 || true
grep "panic:\|<FATAL>" sync.log && echo "panic or fatal in sync.log" && exit 1 || true
file_count=$1
if tail -1 sync.log | grep -q "close session"; then
file_copied=$(tail -n 3 sync.log | head -n 1 | sed 's/.*copied: \([0-9]*\).*/\1/' )
Expand Down

0 comments on commit 66a5a87

Please sign in to comment.