blob: 2f7637372e606b3334c9b09b829139fa68462b68 [file] [log] [blame]
shreyas60e9f842016-07-29 19:39:49 +05301dist: trusty
Rushabh Mehta4a7b4ef2017-07-10 23:00:01 +05302
Aditya Hase7204bcb2019-07-25 13:42:43 +05303language: python
Aditya Hasef397acc2019-05-01 11:31:08 +05304
Aditya Hase5542af92019-07-25 21:36:22 +05305git:
6 depth: 1
7
8cache:
9 - pip
10
Aditya Hase828699f2019-07-25 21:09:34 +053011addons:
Aditya Hase6f025e72019-07-25 21:21:19 +053012 hosts: test_site
Aditya Hase828699f2019-07-25 21:09:34 +053013 mariadb: 10.3
Pratik Vyasf437e862013-12-24 12:17:59 +053014
Aditya Hase7204bcb2019-07-25 13:42:43 +053015jobs:
16 include:
17 - name: "Python 2.7 Server Side Test"
18 python: 2.7
Aditya Hase6f025e72019-07-25 21:21:19 +053019 script: bench --site test_site run-tests --app erpnext --coverage
Aditya Hase7204bcb2019-07-25 13:42:43 +053020
21 - name: "Python 3.6 Server Side Test"
22 python: 3.6
Aditya Hase6f025e72019-07-25 21:21:19 +053023 script: bench --site test_site run-tests --app erpnext --coverage
Aditya Hase7204bcb2019-07-25 13:42:43 +053024
25 - name: "Python 2.7 Patch Test"
26 python: 2.7
27 before_script:
28 - wget http://build.erpnext.com/20171108_190013_955977f8_database.sql.gz
29 - bench --force restore ~/frappe-bench/20171108_190013_955977f8_database.sql.gz --mariadb-root-password travis
Aditya Hase6f025e72019-07-25 21:21:19 +053030 script: bench --site test_site migrate
Aditya Hase7204bcb2019-07-25 13:42:43 +053031
32 - name: "Python 3.6 Patch Test"
33 python: 3.6
34 before_script:
35 - wget http://build.erpnext.com/20171108_190013_955977f8_database.sql.gz
Aditya Hase6f025e72019-07-25 21:21:19 +053036 - bench --site test_site --force restore ~/frappe-bench/20171108_190013_955977f8_database.sql.gz --mariadb-root-password travis
37 script: bench --site test_site migrate
Aditya Hase7204bcb2019-07-25 13:42:43 +053038
Pratik Vyasf437e862013-12-24 12:17:59 +053039install:
Aditya Hase306a4102019-07-25 21:11:18 +053040 - cd ~
Rushabh Mehtaa77a8a42019-02-26 14:30:00 +053041 - nvm install 10
Aditya Hase306a4102019-07-25 21:11:18 +053042
43 - git clone https://github.com/frappe/bench --depth 1
44 - pip install -e ./bench
shreyas60e9f842016-07-29 19:39:49 +053045
Aditya Haseac185982019-07-25 21:15:30 +053046 - git clone https://github.com/frappe/frappe --branch $TRAVIS_BRANCH --depth 1
Aditya Hase1de45872019-07-25 21:28:15 +053047 - bench init --skip-assets --frappe-path ~/frappe --python $(which python) frappe-bench
Aditya Haseac185982019-07-25 21:15:30 +053048
Aditya Hase06ca6f72019-07-25 21:18:05 +053049 - mkdir ~/frappe-bench/sites/test_site
50 - cp -r $TRAVIS_BUILD_DIR/.travis/site_config.json ~/frappe-bench/sites/test_site/
Pratik Vyas86680812014-10-12 19:35:46 +053051
Rushabh Mehta4a7b4ef2017-07-10 23:00:01 +053052before_script:
Aditya Hase80050222019-07-25 21:19:30 +053053 - mysql -u root -e "SET GLOBAL character_set_server = 'utf8mb4'"
54 - mysql -u root -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'"
55
56 - mysql -u root -e "CREATE DATABASE test_frappe"
57 - mysql -u root -e "CREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe'"
58 - mysql -u root -e "GRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost'"
59
60 - mysql -u root -e "UPDATE mysql.user SET Password=PASSWORD('travis') WHERE User='root'"
61 - mysql -u root -e "FLUSH PRIVILEGES"
Rushabh Mehta4a7b4ef2017-07-10 23:00:01 +053062
Pratik Vyas2a47eeb2015-01-01 15:48:04 +053063 - cd ~/frappe-bench
Aditya Hase13919442019-07-25 21:27:20 +053064
65 - sed -i 's/watch:/# watch:/g' Procfile
66 - sed -i 's/schedule:/# schedule:/g' Procfile
67 - sed -i 's/socketio:/# socketio:/g' Procfile
68 - sed -i 's/redis_socketio:/# redis_socketio:/g' Procfile
69
Aditya Hase97ad6352019-07-25 21:23:24 +053070 - bench get-app erpnext $TRAVIS_BUILD_DIR
Aditya Hase4b680172019-07-25 21:38:07 +053071 - bench start &
Aditya Hase54399662019-07-25 21:25:53 +053072 - bench --site test_site reinstall --yes
Pratik Vyasf437e862013-12-24 12:17:59 +053073
Aditya Hasef397acc2019-05-01 11:31:08 +053074after_script:
Aditya Hasec49d4542019-07-25 21:10:06 +053075 - pip install python-coveralls
Aditya Hasef397acc2019-05-01 11:31:08 +053076 - coveralls -b apps/erpnext -d ../../sites/.coverage