blob: 74ed7b7cc994b042a35381c3177e937f12116202 [file] [log] [blame]
Pratik Vyascc9bc952014-02-06 14:59:05 +05301language: python
shreyas60e9f842016-07-29 19:39:49 +05302dist: trusty
Rushabh Mehta4a7b4ef2017-07-10 23:00:01 +05303
Pratik Vyasf437e862013-12-24 12:17:59 +05304python:
5 - "2.7"
Achilles Rasquinha2ec5b5e2018-05-24 04:46:12 -05006 - "3.6"
7
8 matrix:
9 - allow_failures:
10 - python: "3.6"
Pratik Vyasf437e862013-12-24 12:17:59 +053011
12services:
13 - mysql
14
15install:
Ameya Shenoy4674b172018-01-11 15:12:29 +053016 # fix mongodb travis error
17 - sudo rm /etc/apt/sources.list.d/mongodb*.list
Rushabh Mehta26538252017-07-28 11:37:45 +053018 - pip install flake8==3.3.0
19 - flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
Rushabh Mehta4a7b4ef2017-07-10 23:00:01 +053020 - sudo rm /etc/apt/sources.list.d/docker.list
Ameya Shenoyf5f8a1f2018-04-30 11:10:39 +053021 - sudo apt-get install hhvm && rm -rf /home/travis/.kiex/
shreyas60e9f842016-07-29 19:39:49 +053022 - sudo apt-get purge -y mysql-common mysql-server mysql-client
Makarand Bauskar0b8f9202017-06-01 18:56:39 +053023 - nvm install v7.10.0
shreyas60e9f842016-07-29 19:39:49 +053024 - wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
25 - sudo python install.py --develop --user travis --without-bench-setup
26 - sudo pip install -e ~/bench
27
Pratik Vyas2a47eeb2015-01-01 15:48:04 +053028 - rm $TRAVIS_BUILD_DIR/.git/shallow
Anand Doshi6677fd52016-04-07 18:19:56 +053029 - bash $TRAVIS_BUILD_DIR/travis/bench_init.sh
Pratik Vyas2a47eeb2015-01-01 15:48:04 +053030 - cp -r $TRAVIS_BUILD_DIR/test_sites/test_site ~/frappe-bench/sites/
Pratik Vyas86680812014-10-12 19:35:46 +053031
Rushabh Mehta4a7b4ef2017-07-10 23:00:01 +053032before_script:
Rushabh Mehta4a7b4ef2017-07-10 23:00:01 +053033 - mysql -u root -ptravis -e 'create database test_frappe'
34 - echo "USE mysql;\nCREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe';\nFLUSH PRIVILEGES;\n" | mysql -u root -ptravis
35 - echo "USE mysql;\nGRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost';\n" | mysql -u root -ptravis
36
Pratik Vyas2a47eeb2015-01-01 15:48:04 +053037 - cd ~/frappe-bench
38 - bench get-app erpnext $TRAVIS_BUILD_DIR
Pratik Vyas52d36972015-03-31 13:11:32 +053039 - bench use test_site
Rushabh Mehtacc887902016-07-24 22:45:09 +053040 - bench reinstall --yes
Anand Doshid726ce52015-08-17 15:13:58 +053041 - bench build
Rushabh Mehta4a7b4ef2017-07-10 23:00:01 +053042 - bench scheduler disable
Ameya Shenoybb7c5ac2018-05-02 17:32:39 +053043 - sed -i 's/9000/9001/g' sites/common_site_config.json
Anand Doshid726ce52015-08-17 15:13:58 +053044 - bench start &
Anand Doshi1b6c3f12015-05-28 21:46:40 -040045 - sleep 10
Pratik Vyasf437e862013-12-24 12:17:59 +053046
Vishal Dhayagude52ac4832017-09-13 15:18:41 +053047jobs:
48 include:
49 - stage: test
50 script:
51 - set -e
52 - bench run-tests
Vishal Dhayagudec4c2c562017-09-21 12:07:56 +053053 env: Server Side Test
Vishal Dhayagude52ac4832017-09-13 15:18:41 +053054 - # stage
55 script:
Saurabha8823ea2017-11-09 17:07:43 +053056 - wget http://build.erpnext.com/20171108_190013_955977f8_database.sql.gz
57 - bench --force restore ~/frappe-bench/20171108_190013_955977f8_database.sql.gz --mariadb-root-password travis
58 - bench migrate
59 env: Patch Testing