forked from juicedata/juicefs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
97 lines (97 loc) · 5.71 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
os: linux
dist: xenial
language: go
cache:
directories:
- $HOME/gopath/pkg/mod/
- $HOME/.m2/
- $HOME/.tiup/components/
services:
- mysql
- postgresql
- docker
env:
- MINIO_TEST_BUCKET=127.0.0.1:9000/testbucket MINIO_ACCESS_KEY=testUser MINIO_SECRET_KEY=testUserPassword DISPLAY_PROGRESSBAR=false HDFS_ADDR=localhost:8020 SFTP_HOST=localhost:2222:/upload/ SFTP_USER=root SFTP_PASS=password WEBDAV_TEST_BUCKET=127.0.0.1:9007 TIKV_ADDR=127.0.0.1 REDIS_ADDR=redis://127.0.0.1:6379/13
go:
- "1.17"
branches:
only:
- main
- /^release-.*$/
addons:
apt:
packages:
- g++-multilib
- libacl1-dev
- redis-server
- attr
- lsof
- gcc-mingw-w64 # for windows
before_install:
- source ./check-changed.sh
- if [ $SKIP_TEST == true ]; then exit 0; fi
install: true
before_script:
- export GO111MODULE=on
- sudo mysql -e "create database dev;"
- psql -c 'create database test;' -U postgres
- if [ -f "/home/travis/.m2/minio.tar" ];then docker load </home/travis/.m2/minio.tar; fi
- if [ -f "/home/travis/.m2/sftp.tar" ];then docker load </home/travis/.m2/sftp.tar; fi
- if [ ! -f "/home/travis/.m2/install.sh" ];then wget -O /home/travis/.m2/install.sh https://tiup-mirrors.pingcap.com/install.sh; fi
- if [ ! -f "/home/travis/.m2/rclone-v1.57.0-linux-amd64.zip" ];then wget -O /home/travis/.m2/rclone-v1.57.0-linux-amd64.zip --no-check-certificate https://downloads.rclone.org/v1.57.0/rclone-v1.57.0-linux-amd64.zip && unzip /home/travis/.m2/rclone-v1.57.0-linux-amd64.zip -d /home/travis/.m2; fi
- if [ ! -f "/home/travis/.m2/litmus-0.13.tar.g" ];then wget -O /home/travis/.m2/litmus-0.13.tar.gz http://www.webdav.org/neon/litmus/litmus-0.13.tar.gz; tar -zxvf /home/travis/.m2/litmus-0.13.tar.gz -C /home/travis/.m2;cd /home/travis/.m2/litmus-0.13;./configure;make;cd -; fi
- if [ ! -f "/home/travis/.m2/etcd-v3.5.2-linux-amd64.tar.gz" ];then wget -O /home/travis/.m2/etcd-v3.5.2-linux-amd64.tar.gz https://github.com/etcd-io/etcd/releases/download/v3.5.2/etcd-v3.5.2-linux-amd64.tar.gz; tar -zxf /home/travis/.m2/etcd-v3.5.2-linux-amd64.tar.gz -C /home/travis/.m2; fi
- docker images
- sh /home/travis/.m2/install.sh && source ~/.bash_profile && nohup tiup playground --mode tikv-slim >> output.log 2>&1 &
- docker run -d -p 9000:9000 -p 9001:9001 -e "MINIO_ROOT_USER=testUser" -e "MINIO_ROOT_PASSWORD=testUserPassword" quay.io/minio/minio:RELEASE.2022-01-25T19-56-04Z server /data --console-address ":9001"
- go install github.com/minio/[email protected] && mc config host add local http://127.0.0.1:9000 testUser testUserPassword && mc mb local/testbucket
- nohup /home/travis/.m2/rclone-v1.57.0-linux-amd64/rclone serve webdav local --addr 127.0.0.1:9007 >> rclone.log 2>&1 &
- # nohup /home/travis/.m2/etcd-v3.5.2-linux-amd64/etcd --unsafe-no-fsync --listen-client-urls http://127.0.0.1:2389 --advertise-client-urls http://127.0.0.1:2389 &
- sudo chmod 777 /usr/local/maven-3.6.3/conf/settings.xml
- sudo sed -i "s?</settings>?<localRepository>/home/travis/.m2/repository</localRepository></settings>?" /usr/local/maven-3.6.3/conf/settings.xml
- docker run -d --name sftp -p 2222:22 juicedata/ci-sftp
- make
- sudo make -C fstests setup
- chmod +x travis-setup-hdfs.sh
- ./travis-setup-hdfs.sh
- for i in {2222,3306,5432,8020,9000,9007,2379} ; do echo "lsof port:"$i;sudo lsof -i :$i;if [ $? != 0 ];then sleep 5; else continue; fi;sudo lsof -i :$i; if [ $? != 0 ];then echo "service not ready, port:"$i; exit 1;fi; done
- sudo lsof -i :2379;if [ $? != 0 ];then echo "tikv is not ready";cat output.log;exit 1; fi
script:
- sudo chmod 777 /var/jfsCache
- make test
- cat cov1.out >> coverage.txt
- cat cov2.out >> coverage.txt
- cd /jfs
- git clone https://github.com/danjacques/gofslock.git
- cd gofslock && git checkout cc7f001fe0e7df1710adc8f0cd9e9d6d21fdb3a9
- go test -v ./fslock/...
- stat /jfs/
- pyenv global 3.7.1
- export PATH="/opt/python/3.7.1/bin:$PATH"
- git clone https://github.com/iustin/pyxattr.git
- cd pyxattr
- pip3 install pytest
- pip3 install pyxattr
- TEST_DIR=/jfs/ python3 -m pytest tests
- cd /home/travis/gopath/src/github.com/juicedata/juicefs
- sudo DURATION=10 make -C fstests all
- make -C fstests flock
- make -C sdk/java/libjfs
- cd sdk/java
- sudo `which mvn` compile -B --quiet || sudo `which mvn` compile -B --quiet
- sudo chmod 777 /jfs/tmp
- sudo `which mvn` test -B
- sudo `which mvn` package -B -Dmaven.test.skip=true --quiet || sudo `which mvn` package -B -Dmaven.test.skip=true --quiet
- cd ../../
- sudo ./juicefs umount /jfs || sudo lsof /jfs && sudo ./juicefs umount --force /jfs || true
- sudo ./juicefs gc localhost
- sudo ./juicefs fsck localhost
- if [ ! -f "/home/travis/.m2/minio.tar" ];then docker save -o /home/travis/.m2/minio.tar quay.io/minio/minio; fi
- if [ ! -f "/home/travis/.m2/sftp.tar" ];then docker save -o /home/travis/.m2/sftp.tar juicedata/ci-sftp; fi
after_failure:
- sudo tail -n 100 /var/log/syslog
after_success:
- bash <(curl -s https://codecov.io/bash)
notifications:
slack:
secure: VD92Vium23tdNvXyb1cQTI/4/JGXecXY3t2YHjpzfrIWc8RzGxYN28275g6a8gL+AEURDcsLPUxr243tHSqAyQmHhM4JHrX+eXTshqOKcikSzU6kYQTZE6B1vigp1bgn68ExdM9jFMnue4MmsN/tsGsZ5t8eM0lFERdActZaDoR1c5DJ1WMjAUKzUhihGV+10QHI8nZwh+G3zM9SmSfh6obFk3QN0zKCMJEyC8z9UPS3MQspwt23MySYIVHU0beu0PkcZHnXbXNNG3P27e349f8uChhJSwnLVS5G0zFVrxO3rWVTlEAU1ksUeGFPP883v3XwDrFxIT1WOujH7uKwEV/QT3d+8+mmL8yFr1gnU4Gl3hApRzepsvr/IIQjaGtC7HHIqv4gvP/FJB9r5VDH4al4pSbAtMfWYwspmfiPI5mADpmUqW0Anwt9gnTQ5NxPVVo5txyG9LSwseYQ/P2Tx3h8w/kPvW0sPqX/qIxxwnZLVzRbdOGfUlNfmwEmBqWPGkJIEsYto8BEpw932p6ytijElTj+3ISo8hn2L1Lm+vCbsWRWTVyjNL5lqfBCNdsh7JHBUgcBdm1lQ2kKogWtAPtY5DxqLMto9vyVCIoM+gCE1VWZHTjazaFbhLsIg7j2qvwZs97VGQ3Wr/FfqVh3/3mUJNj6X0CWRBpWJRQwVDA=