Skip to content

Commit

Permalink
Travis integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Anand Henry committed Dec 12, 2014
1 parent 1e522d9 commit 9d51fb6
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 2 deletions.
17 changes: 17 additions & 0 deletions .travis.yml
@@ -0,0 +1,17 @@
language: go
env:
global:
- MYSQL_FLAVOR=MariaDB
matrix:
- TEST_SUITE=unit_test
- TEST_SUITE=queryservice_test
- TEST_SUITE=integration_test
- TEST_SUITE=java_vtgate_client_test
- TEST_SUITE=unit_test_goveralls
before_install:
- bash -v travis/dependencies.sh
install:
- bash -v bootstrap.sh
script:
- source dev.env
- make $TEST_SUITE
9 changes: 9 additions & 0 deletions Makefile
Expand Up @@ -40,6 +40,11 @@ unit_test_cover:
unit_test_race:
go test -race ./go/...

unit_test_goveralls:
go list -f '{{if len .TestGoFiles}}go test -coverprofile={{.Dir}}/.coverprofile {{.ImportPath}}{{end}}' ./go/... | xargs -i sh -c {}
gover ./go/
goveralls -coverprofile=gover.coverprofile -repotoken $$COVERALLS_TOKEN

queryservice_test:
echo $$(date): Running test/queryservice_test.py...
if [ -e "/usr/bin/memcached" ]; then \
Expand Down Expand Up @@ -116,6 +121,10 @@ site_integration_test:
java_test:
cd java && mvn verify

java_vtgate_client_test:
mvn -f java/gorpc/pom.xml clean install -DskipTests
mvn -f java/vtgate-client/pom.xml clean verify

v3_test:
cd test && ./vtgatev3_test.py

Expand Down
2 changes: 2 additions & 0 deletions README.md
@@ -1,5 +1,7 @@
# Vitess

[![Build Status](https://travis-ci.org/henryanand/vitess.svg?branch=master)](https://travis-ci.org/henryanand/vitess) [![Coverage Status](https://coveralls.io/repos/henryanand/vitess/badge.png?branch=master)](https://coveralls.io/r/henryanand/vitess?branch=master)

Vitess is a set of servers and tools meant to facilitate scaling of MySQL
databases for the web. It's been developed since 2011, and is currently used as
a fundamental component of YouTube's MySQL infrastructure, serving thousands of
Expand Down
5 changes: 5 additions & 0 deletions bootstrap.sh
Expand Up @@ -42,6 +42,11 @@ go get code.google.com/p/go.net/context
go get code.google.com/p/go.tools/cmd/goimports
go get github.com/golang/glog

# Packages for uploading code coverage to coveralls.io
go get code.google.com/p/go.tools/cmd/cover
go get github.com/modocache/gover
go get github.com/mattn/goveralls

ln -snf $VTTOP/config $VTROOT/config
ln -snf $VTTOP/data $VTROOT/data
ln -snf $VTTOP/py $VTROOT/py-vtdb
Expand Down
2 changes: 1 addition & 1 deletion test/topo_flavor/zookeeper.py
Expand Up @@ -27,7 +27,7 @@ def assign_ports(self):

self.zk_port_base = reserve_ports(3)
self.zkocc_port_base = reserve_ports(3)
self.hostname = socket.gethostname()
self.hostname = socket.getfqdn()
self.zk_ports = ':'.join(str(self.zk_port_base + i) for i in range(3))
self.zk_client_port = self.zk_port_base + 2
self.ports_assigned = True
Expand Down
2 changes: 1 addition & 1 deletion test/utils.py
Expand Up @@ -25,7 +25,7 @@

options = None
devnull = open('/dev/null', 'w')
hostname = socket.gethostname()
hostname = socket.getfqdn()

class TestError(Exception):
pass
Expand Down
31 changes: 31 additions & 0 deletions travis/dependencies.sh
@@ -0,0 +1,31 @@
#!/bin/bash
set -e

# Add MariaDB repository
sudo apt-get install python-software-properties
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'deb http://ftp.utexas.edu/mariadb/repo/10.0/ubuntu precise main'
sudo apt-get update

# Remove pre-installed mysql
sudo apt-get purge mysql* mariadb*

# MariaDB
sudo apt-get -f install \
libmysqlclient18=10.0.15+maria-1~precise \
libmariadbclient18=10.0.15+maria-1~precise \
libmariadbclient-dev=10.0.15+maria-1~precise \
mariadb-client-10.0=10.0.15+maria-1~precise \
mariadb-client-core-10.0=10.0.15+maria-1~precise \
mariadb-server-10.0=10.0.15+maria-1~precise \
mariadb-server-core-10.0=10.0.15+maria-1~precise

# Other dependencies
sudo apt-get install time automake libtool memcached python-dev python-mysqldb libssl-dev g++ mercurial git pkg-config bison bc

# Java dependencies
wget https://dl.bintray.com/sbt/debian/sbt-0.13.6.deb
sudo dpkg -i sbt-0.13.6.deb
sudo apt-get install protobuf-compiler maven

set +e

0 comments on commit 9d51fb6

Please sign in to comment.