shreyas | 60e9f84 | 2016-07-29 19:39:49 +0530 | [diff] [blame] | 1 | dist: trusty |
Rushabh Mehta | 4a7b4ef | 2017-07-10 23:00:01 +0530 | [diff] [blame] | 2 | |
Aditya Hase | e0e78fb | 2019-07-25 13:42:43 +0530 | [diff] [blame] | 3 | language: python |
Aditya Hase | f397acc | 2019-05-01 11:31:08 +0530 | [diff] [blame] | 4 | |
Aditya Hase | 50e2d4a | 2019-07-25 21:36:22 +0530 | [diff] [blame] | 5 | git: |
| 6 | depth: 1 |
| 7 | |
| 8 | cache: |
| 9 | - pip |
| 10 | |
Aditya Hase | 9b24a42 | 2019-07-25 21:09:34 +0530 | [diff] [blame] | 11 | addons: |
Aditya Hase | fb2ec71 | 2019-07-25 21:21:19 +0530 | [diff] [blame] | 12 | hosts: test_site |
Aditya Hase | 9b24a42 | 2019-07-25 21:09:34 +0530 | [diff] [blame] | 13 | mariadb: 10.3 |
Pratik Vyas | f437e86 | 2013-12-24 12:17:59 +0530 | [diff] [blame] | 14 | |
Aditya Hase | e0e78fb | 2019-07-25 13:42:43 +0530 | [diff] [blame] | 15 | jobs: |
| 16 | include: |
| 17 | - name: "Python 2.7 Server Side Test" |
| 18 | python: 2.7 |
Aditya Hase | fb2ec71 | 2019-07-25 21:21:19 +0530 | [diff] [blame] | 19 | script: bench --site test_site run-tests --app erpnext --coverage |
Aditya Hase | e0e78fb | 2019-07-25 13:42:43 +0530 | [diff] [blame] | 20 | |
| 21 | - name: "Python 3.6 Server Side Test" |
| 22 | python: 3.6 |
Aditya Hase | fb2ec71 | 2019-07-25 21:21:19 +0530 | [diff] [blame] | 23 | script: bench --site test_site run-tests --app erpnext --coverage |
Aditya Hase | e0e78fb | 2019-07-25 13:42:43 +0530 | [diff] [blame] | 24 | |
| 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 |
Aditya Hase | 0046357 | 2019-07-25 21:51:12 +0530 | [diff] [blame] | 29 | - bench --site test_site --force restore ~/frappe-bench/20171108_190013_955977f8_database.sql.gz |
Aditya Hase | fb2ec71 | 2019-07-25 21:21:19 +0530 | [diff] [blame] | 30 | script: bench --site test_site migrate |
Aditya Hase | e0e78fb | 2019-07-25 13:42:43 +0530 | [diff] [blame] | 31 | |
| 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 Hase | 0046357 | 2019-07-25 21:51:12 +0530 | [diff] [blame] | 36 | - bench --site test_site --force restore ~/frappe-bench/20171108_190013_955977f8_database.sql.gz |
Aditya Hase | fb2ec71 | 2019-07-25 21:21:19 +0530 | [diff] [blame] | 37 | script: bench --site test_site migrate |
Aditya Hase | e0e78fb | 2019-07-25 13:42:43 +0530 | [diff] [blame] | 38 | |
Pratik Vyas | f437e86 | 2013-12-24 12:17:59 +0530 | [diff] [blame] | 39 | install: |
Aditya Hase | 3f6ac2d | 2019-07-25 21:11:18 +0530 | [diff] [blame] | 40 | - cd ~ |
Rushabh Mehta | a77a8a4 | 2019-02-26 14:30:00 +0530 | [diff] [blame] | 41 | - nvm install 10 |
Aditya Hase | 3f6ac2d | 2019-07-25 21:11:18 +0530 | [diff] [blame] | 42 | |
| 43 | - git clone https://github.com/frappe/bench --depth 1 |
| 44 | - pip install -e ./bench |
shreyas | 60e9f84 | 2016-07-29 19:39:49 +0530 | [diff] [blame] | 45 | |
Aditya Hase | 23f24d1 | 2019-07-25 21:15:30 +0530 | [diff] [blame] | 46 | - git clone https://github.com/frappe/frappe --branch $TRAVIS_BRANCH --depth 1 |
Aditya Hase | e312841 | 2019-07-25 21:28:15 +0530 | [diff] [blame] | 47 | - bench init --skip-assets --frappe-path ~/frappe --python $(which python) frappe-bench |
Aditya Hase | 23f24d1 | 2019-07-25 21:15:30 +0530 | [diff] [blame] | 48 | |
Aditya Hase | e2b16e3 | 2019-07-25 21:18:05 +0530 | [diff] [blame] | 49 | - mkdir ~/frappe-bench/sites/test_site |
| 50 | - cp -r $TRAVIS_BUILD_DIR/.travis/site_config.json ~/frappe-bench/sites/test_site/ |
Pratik Vyas | 8668081 | 2014-10-12 19:35:46 +0530 | [diff] [blame] | 51 | |
Aditya Hase | 185e2a2 | 2019-07-25 21:19:30 +0530 | [diff] [blame] | 52 | - mysql -u root -e "SET GLOBAL character_set_server = 'utf8mb4'" |
| 53 | - mysql -u root -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'" |
| 54 | |
| 55 | - mysql -u root -e "CREATE DATABASE test_frappe" |
| 56 | - mysql -u root -e "CREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe'" |
| 57 | - mysql -u root -e "GRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost'" |
| 58 | |
| 59 | - mysql -u root -e "UPDATE mysql.user SET Password=PASSWORD('travis') WHERE User='root'" |
| 60 | - mysql -u root -e "FLUSH PRIVILEGES" |
Rushabh Mehta | 4a7b4ef | 2017-07-10 23:00:01 +0530 | [diff] [blame] | 61 | |
Aditya Hase | b6906c5 | 2019-07-25 22:40:26 +0530 | [diff] [blame] | 62 | - wget -O /tmp/wkhtmltox.tar.xz https://github.com/frappe/wkhtmltopdf/raw/master/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz |
| 63 | - tar -xf /tmp/wkhtmltox.tar.xz -C /tmp |
| 64 | - sudo mv /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf |
| 65 | - sudo chmod o+x /usr/local/bin/wkhtmltopdf |
Gavin D'souza | 7331964 | 2019-11-27 14:53:58 +0530 | [diff] [blame] | 66 | - sudo apt-get install libcups2-dev |
Aditya Hase | b6906c5 | 2019-07-25 22:40:26 +0530 | [diff] [blame] | 67 | |
Pratik Vyas | 2a47eeb | 2015-01-01 15:48:04 +0530 | [diff] [blame] | 68 | - cd ~/frappe-bench |
Aditya Hase | 30628b0 | 2019-07-25 21:27:20 +0530 | [diff] [blame] | 69 | |
| 70 | - sed -i 's/watch:/# watch:/g' Procfile |
| 71 | - sed -i 's/schedule:/# schedule:/g' Procfile |
| 72 | - sed -i 's/socketio:/# socketio:/g' Procfile |
| 73 | - sed -i 's/redis_socketio:/# redis_socketio:/g' Procfile |
| 74 | |
Aditya Hase | 903e878 | 2019-07-25 21:23:24 +0530 | [diff] [blame] | 75 | - bench get-app erpnext $TRAVIS_BUILD_DIR |
Aditya Hase | 6076443 | 2019-07-25 21:38:07 +0530 | [diff] [blame] | 76 | - bench start & |
Aditya Hase | 7c44ada | 2019-07-25 21:25:53 +0530 | [diff] [blame] | 77 | - bench --site test_site reinstall --yes |
Pratik Vyas | f437e86 | 2013-12-24 12:17:59 +0530 | [diff] [blame] | 78 | |
Aditya Hase | f397acc | 2019-05-01 11:31:08 +0530 | [diff] [blame] | 79 | after_script: |
Aditya Hase | 2fb9e8a | 2019-07-25 21:10:06 +0530 | [diff] [blame] | 80 | - pip install python-coveralls |
Aditya Hase | f397acc | 2019-05-01 11:31:08 +0530 | [diff] [blame] | 81 | - coveralls -b apps/erpnext -d ../../sites/.coverage |