2015-07-23 09:59:42 +03:00
|
|
|
# Use container-based infrastructure (see: http://docs.travis-ci.com/user/workers/container-based-infrastructure/).
|
|
|
|
sudo: false
|
2014-10-01 05:59:51 +04:00
|
|
|
language: go
|
2015-01-20 23:07:07 +03:00
|
|
|
go:
|
|
|
|
- 1.4
|
2015-07-23 09:59:42 +03:00
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
# NOTE: When you add a dependency, don't forget to add comment why it's necessary.
|
|
|
|
- automake
|
|
|
|
- libtool
|
|
|
|
- memcached
|
2015-08-23 11:28:44 +03:00
|
|
|
- php5-cli
|
|
|
|
- php5-dev
|
2015-07-23 09:59:42 +03:00
|
|
|
- python-dev
|
|
|
|
- python-mysqldb
|
|
|
|
- python-pip
|
|
|
|
- python-virtualenv
|
|
|
|
- libssl-dev
|
|
|
|
- g++
|
|
|
|
- git
|
|
|
|
- pkg-config
|
|
|
|
# installs libaio1 which is required by MariaDB 10.0 server package
|
|
|
|
- libaio-dev
|
|
|
|
# required by travis script below to measure CPU and memory usage
|
|
|
|
- time
|
|
|
|
# Optional dependency. Without a running syslog daemon, Vitess will keep complaining that it could not log events and spam the logs.
|
|
|
|
- rsyslog
|
2015-07-23 10:25:51 +03:00
|
|
|
# Cache directories of dependencies which are built by bootstrap.sh
|
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
# Cache downloaded and extracted MariaDB 10.0 packages.
|
|
|
|
- $MYSQL_ROOT
|
|
|
|
# Cache bootstrapped dependencies (e.g. protobuf and gRPC).
|
|
|
|
- $HOME/gopath/dist/grpc/.build_finished
|
2015-09-23 22:37:50 +03:00
|
|
|
- $HOME/gopath/dist/grpc/lib
|
2015-07-23 10:25:51 +03:00
|
|
|
- $HOME/gopath/dist/protobuf/.build_finished
|
|
|
|
- $HOME/gopath/dist/protobuf/lib
|
2015-10-02 04:20:27 +03:00
|
|
|
# Required by make proto and subsequently check_make_proto.sh.
|
|
|
|
- $HOME/gopath/dist/protobuf/bin/protoc
|
2015-07-23 10:25:51 +03:00
|
|
|
- $HOME/gopath/dist/py-mock-1.0.1/.build_finished
|
|
|
|
- $HOME/gopath/dist/py-mock-1.0.1/lib/python2.7/site-packages
|
|
|
|
- $HOME/gopath/dist/py-vt-bson-0.3.2/lib/python2.7/site-packages
|
|
|
|
- $HOME/gopath/dist/vt-zookeeper-3.3.5/.build_finished
|
|
|
|
- $HOME/gopath/dist/vt-zookeeper-3.3.5/include
|
|
|
|
- $HOME/gopath/dist/vt-zookeeper-3.3.5/lib
|
|
|
|
# Maven repository for Java dependencies.
|
|
|
|
- $HOME/.m2
|
2015-08-23 11:28:44 +03:00
|
|
|
- $HOME/php
|
2015-07-23 10:25:51 +03:00
|
|
|
before_cache:
|
|
|
|
# Travis CI caching doesn't work with this symlink. Just delete it.
|
|
|
|
- rm $HOME/gopath/bin/zksrv.sh
|
2015-07-24 01:47:32 +03:00
|
|
|
# Delete this file because it keeps changing (having the latest timestamp of an update)
|
|
|
|
# and triggers a lengthy update of the cache (~19 seconds).
|
|
|
|
- rm $HOME/.m2/repository/com/youtube/vitess/gorpc-client/0.0.1-SNAPSHOT/resolver-status.properties
|
2014-10-01 05:59:51 +04:00
|
|
|
env:
|
|
|
|
global:
|
|
|
|
- MYSQL_FLAVOR=MariaDB
|
2015-07-23 10:07:47 +03:00
|
|
|
- MYSQL_ROOT=$HOME/mysql
|
|
|
|
- VT_MYSQL_ROOT=$MYSQL_ROOT/usr
|
2015-07-23 10:09:57 +03:00
|
|
|
# Enable parallel compilation e.g. for gRPC.
|
|
|
|
# (The Travis CI worker is allowed to use up to 2 cores, but as of 07/2015 4 parallel compilations is actually faster.)
|
|
|
|
- MAKEFLAGS=-j4
|
2015-07-23 10:13:29 +03:00
|
|
|
# Run go build and test with -p 4 (i.e. up to 4 packages are compiled/tested in parallel).
|
|
|
|
# As of 07/2015 this value works best in a Travis CI container.
|
|
|
|
- VT_GO_PARALLEL=4
|
2015-08-23 11:28:44 +03:00
|
|
|
- PHP_FLAGS="-d extension=$HOME/php/mongo.so"
|
|
|
|
- PATH="$HOME/php:$PATH"
|
2015-08-24 08:11:48 +03:00
|
|
|
# Add -follow to TEST_FLAGS below to print as the test runs, to diagnose stuck tests.
|
|
|
|
- TEST_FLAGS="-docker=false -timeout=5m -print-log -remote-stats=http://enisoc.com:15123/travis/stats"
|
2014-10-01 05:59:51 +04:00
|
|
|
matrix:
|
2015-07-23 10:32:03 +03:00
|
|
|
# NOTE: Travis CI schedules up to 5 tests simultaneously.
|
|
|
|
# All our tests should be spread out as evenly as possible across these 5 slots.
|
|
|
|
# We should always utilize all 5 slots because the cost of the setup is high (up to one minute).
|
2015-07-23 10:29:23 +03:00
|
|
|
# NOTE: Use "" if you specify a space separated list of multiple targets.
|
2015-08-24 05:51:42 +03:00
|
|
|
- TEST_MATRIX="-shard 0"
|
|
|
|
- TEST_MATRIX="-shard 1"
|
|
|
|
- TEST_MATRIX="-shard 2"
|
|
|
|
- TEST_MATRIX="-shard 3"
|
|
|
|
- TEST_MATRIX="-shard 4"
|
2014-10-01 05:59:51 +04:00
|
|
|
before_install:
|
2015-08-23 11:28:44 +03:00
|
|
|
- travis/download_mariadb.sh
|
|
|
|
- travis/php_init.sh
|
2014-10-01 05:59:51 +04:00
|
|
|
install:
|
2015-08-23 11:28:44 +03:00
|
|
|
- ./bootstrap.sh
|
2015-10-02 04:51:58 +03:00
|
|
|
before_script:
|
2015-10-02 04:07:09 +03:00
|
|
|
# Travis only tests. Run only on the first shard.
|
2015-10-02 04:51:58 +03:00
|
|
|
# Part of "before_script" because in "script" the job would not fail immediately if a command fails.
|
2015-10-02 04:07:09 +03:00
|
|
|
- |
|
|
|
|
if [[ "$TEST_MATRIX" = "-shard 0" ]]; then
|
|
|
|
travis/check_make_proto.sh
|
|
|
|
fi
|
2015-10-02 04:51:58 +03:00
|
|
|
script:
|
|
|
|
- source dev.env
|
|
|
|
# Log GOMAXPROCS (should be 2 as of 07/2015).
|
|
|
|
- go run travis/log_gomaxprocs.go
|
2015-08-24 05:51:42 +03:00
|
|
|
- go run test.go $TEST_FLAGS $TEST_MATRIX
|
2015-07-23 10:18:17 +03:00
|
|
|
after_failure:
|
|
|
|
# In case of errors, output log files to make it easier to debug the error.
|
|
|
|
# List all available files.
|
|
|
|
- ls -alR $HOME/gopath/vtdataroot
|
2015-08-24 05:51:42 +03:00
|
|
|
# Output *.log* and *.stderr files. (Add -keep-data to TEST_FLAGS above or tests will delete their logs.)
|
2015-07-23 10:18:17 +03:00
|
|
|
- find $HOME/gopath/vtdataroot \( -name "*.log*" -or -name "*.stderr" \) -type f -print0 | xargs -0r --verbose --max-args=1 cat
|