language: python

python:
  - "2.7"

services:
  - mysql

install:
  - sudo service mysql stop
  - 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.osuosl.org/pub/mariadb/repo/5.5/ubuntu precise main'
  - sudo apt-get update
  - sudo apt-get purge -y mysql-common
  - sudo apt-get install mariadb-server mariadb-common libmariadbclient-dev
  - CFLAGS=-O0 pip install git+https://github.com/frappe/frappe.git@develop &&
  - pip install --editable .

script:
  - cd ./test_sites/
  - frappe --use test_site
  - frappe --reinstall
  - frappe --install_app erpnext --verbose
  - frappe -b
  - frappe --serve_test &
  - frappe --verbose --run_tests --app erpnext

before_script:
  - mysql -e 'create database test_frappe'
  - echo "USE mysql;\nCREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe';\nFLUSH PRIVILEGES;\n" | mysql -u root

language: python

python:
  - "2.7"

services:
  - mysql

install:
  - sudo service mysql stop
  - 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.osuosl.org/pub/mariadb/repo/5.5/ubuntu precise main'
  - sudo apt-get update
  - sudo apt-get purge -y mysql-common
  - sudo apt-get install mariadb-server mariadb-common libmariadbclient-dev
  - CFLAGS=-O0 pip install git+https://github.com/frappe/frappe.git@$TRAVIS_BRANCH &&
  - pip install --editable .

before_script:
  - mysql -e 'create database test_frappe'
  - echo "USE mysql;\nCREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe';\nFLUSH PRIVILEGES;\n" | mysql -u root

script:
  - cd ./test_sites/
  - frappe --use test_site
  - frappe --reinstall
  - frappe --install_app erpnext --verbose
  - frappe -b
  - frappe --serve_test &
  - frappe --verbose --run_tests --app erpnext

Install frappe of targetted branch
Travis: Install frappe of targetted branch

For example:
If pull request is for wip-4.1 branch of erpnext, install frappe with branch as wip-4.1
