blob: a8a0d826145453fc4876773338258eda7e321542 [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"
Aditya Hase3fa112d2019-05-01 11:16:25 +05306 - "3.6"
Pratik Vyasf437e862013-12-24 12:17:59 +05307
Aditya Hasef397acc2019-05-01 11:31:08 +05308env:
Aditya Hase44da7372019-05-01 18:08:44 +05309 - TEST_TYPE="Server Side Test"
10 - TEST_TYPE="Patch Test"
Aditya Hasef397acc2019-05-01 11:31:08 +053011
Pratik Vyasf437e862013-12-24 12:17:59 +053012services:
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
Aditya Hase51eecd02019-06-20 14:07:32 +053019 - 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
Rushabh Mehtaa77a8a42019-02-26 14:30:00 +053023 - nvm install 10
Aditya Hasec7c87a92018-09-07 19:01:17 +053024 - pip install python-coveralls
shreyas60e9f842016-07-29 19:39:49 +053025 - wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
26 - sudo python install.py --develop --user travis --without-bench-setup
27 - sudo pip install -e ~/bench
28
Pratik Vyas2a47eeb2015-01-01 15:48:04 +053029 - rm $TRAVIS_BUILD_DIR/.git/shallow
Anand Doshi6677fd52016-04-07 18:19:56 +053030 - bash $TRAVIS_BUILD_DIR/travis/bench_init.sh
Pratik Vyas2a47eeb2015-01-01 15:48:04 +053031 - cp -r $TRAVIS_BUILD_DIR/test_sites/test_site ~/frappe-bench/sites/
Pratik Vyas86680812014-10-12 19:35:46 +053032
Rushabh Mehta4a7b4ef2017-07-10 23:00:01 +053033before_script:
Rushabh Mehta4a7b4ef2017-07-10 23:00:01 +053034 - mysql -u root -ptravis -e 'create database test_frappe'
35 - echo "USE mysql;\nCREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe';\nFLUSH PRIVILEGES;\n" | mysql -u root -ptravis
36 - echo "USE mysql;\nGRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost';\n" | mysql -u root -ptravis
37
Pratik Vyas2a47eeb2015-01-01 15:48:04 +053038 - cd ~/frappe-bench
39 - bench get-app erpnext $TRAVIS_BUILD_DIR
Pratik Vyas52d36972015-03-31 13:11:32 +053040 - bench use test_site
Sagar Vorac84e3fe2019-01-22 18:16:13 +053041 - bench reinstall --mariadb-root-username root --mariadb-root-password travis --yes
Sagar Voraecf64672019-01-22 17:41:56 +053042 - bench scheduler disable
43 - sed -i 's/9000/9001/g' sites/common_site_config.json
44 - bench start &
45 - sleep 10
Pratik Vyasf437e862013-12-24 12:17:59 +053046
Aditya Hasef397acc2019-05-01 11:31:08 +053047script:
Aditya Hase700711c2019-05-01 18:25:53 +053048 - bash $TRAVIS_BUILD_DIR/travis/run-tests.sh
Aditya Hasef397acc2019-05-01 11:31:08 +053049
50after_script:
51 - coveralls -b apps/erpnext -d ../../sites/.coverage