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 | 9b24a42 | 2019-07-25 21:09:34 +0530 | [diff] [blame] | 5 | addons: |
Aditya Hase | fb2ec71 | 2019-07-25 21:21:19 +0530 | [diff] [blame] | 6 | hosts: test_site |
Aditya Hase | 9b24a42 | 2019-07-25 21:09:34 +0530 | [diff] [blame] | 7 | mariadb: 10.3 |
Pratik Vyas | f437e86 | 2013-12-24 12:17:59 +0530 | [diff] [blame] | 8 | |
Aditya Hase | e0e78fb | 2019-07-25 13:42:43 +0530 | [diff] [blame] | 9 | jobs: |
| 10 | include: |
| 11 | - name: "Python 2.7 Server Side Test" |
| 12 | python: 2.7 |
Aditya Hase | fb2ec71 | 2019-07-25 21:21:19 +0530 | [diff] [blame] | 13 | script: bench --site test_site run-tests --app erpnext --coverage |
Aditya Hase | e0e78fb | 2019-07-25 13:42:43 +0530 | [diff] [blame] | 14 | |
| 15 | - name: "Python 3.6 Server Side Test" |
| 16 | python: 3.6 |
Aditya Hase | fb2ec71 | 2019-07-25 21:21:19 +0530 | [diff] [blame] | 17 | script: bench --site test_site run-tests --app erpnext --coverage |
Aditya Hase | e0e78fb | 2019-07-25 13:42:43 +0530 | [diff] [blame] | 18 | |
| 19 | - name: "Python 2.7 Patch Test" |
| 20 | python: 2.7 |
| 21 | before_script: |
| 22 | - wget http://build.erpnext.com/20171108_190013_955977f8_database.sql.gz |
| 23 | - bench --force restore ~/frappe-bench/20171108_190013_955977f8_database.sql.gz --mariadb-root-password travis |
Aditya Hase | fb2ec71 | 2019-07-25 21:21:19 +0530 | [diff] [blame] | 24 | script: bench --site test_site migrate |
Aditya Hase | e0e78fb | 2019-07-25 13:42:43 +0530 | [diff] [blame] | 25 | |
| 26 | - name: "Python 3.6 Patch Test" |
| 27 | python: 3.6 |
| 28 | before_script: |
| 29 | - wget http://build.erpnext.com/20171108_190013_955977f8_database.sql.gz |
Aditya Hase | fb2ec71 | 2019-07-25 21:21:19 +0530 | [diff] [blame] | 30 | - bench --site test_site --force restore ~/frappe-bench/20171108_190013_955977f8_database.sql.gz --mariadb-root-password travis |
| 31 | script: bench --site test_site migrate |
Aditya Hase | e0e78fb | 2019-07-25 13:42:43 +0530 | [diff] [blame] | 32 | |
Pratik Vyas | f437e86 | 2013-12-24 12:17:59 +0530 | [diff] [blame] | 33 | install: |
Aditya Hase | 3f6ac2d | 2019-07-25 21:11:18 +0530 | [diff] [blame] | 34 | - cd ~ |
Rushabh Mehta | a77a8a4 | 2019-02-26 14:30:00 +0530 | [diff] [blame] | 35 | - nvm install 10 |
Aditya Hase | 3f6ac2d | 2019-07-25 21:11:18 +0530 | [diff] [blame] | 36 | |
| 37 | - git clone https://github.com/frappe/bench --depth 1 |
| 38 | - pip install -e ./bench |
shreyas | 60e9f84 | 2016-07-29 19:39:49 +0530 | [diff] [blame] | 39 | |
Aditya Hase | 23f24d1 | 2019-07-25 21:15:30 +0530 | [diff] [blame] | 40 | - git clone https://github.com/frappe/frappe --branch $TRAVIS_BRANCH --depth 1 |
| 41 | - bench init --frappe-path ~/frappe --python $(which python) frappe-bench |
| 42 | |
Aditya Hase | e2b16e3 | 2019-07-25 21:18:05 +0530 | [diff] [blame] | 43 | - mkdir ~/frappe-bench/sites/test_site |
| 44 | - 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] | 45 | |
Rushabh Mehta | 4a7b4ef | 2017-07-10 23:00:01 +0530 | [diff] [blame] | 46 | before_script: |
Aditya Hase | 185e2a2 | 2019-07-25 21:19:30 +0530 | [diff] [blame] | 47 | - mysql -u root -e "SET GLOBAL character_set_server = 'utf8mb4'" |
| 48 | - mysql -u root -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'" |
| 49 | |
| 50 | - mysql -u root -e "CREATE DATABASE test_frappe" |
| 51 | - mysql -u root -e "CREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe'" |
| 52 | - mysql -u root -e "GRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost'" |
| 53 | |
| 54 | - mysql -u root -e "UPDATE mysql.user SET Password=PASSWORD('travis') WHERE User='root'" |
| 55 | - mysql -u root -e "FLUSH PRIVILEGES" |
Rushabh Mehta | 4a7b4ef | 2017-07-10 23:00:01 +0530 | [diff] [blame] | 56 | |
Pratik Vyas | 2a47eeb | 2015-01-01 15:48:04 +0530 | [diff] [blame] | 57 | - cd ~/frappe-bench |
Sagar Vora | ecf6467 | 2019-01-22 17:41:56 +0530 | [diff] [blame] | 58 | - sed -i 's/9000/9001/g' sites/common_site_config.json |
| 59 | - bench start & |
Aditya Hase | 903e878 | 2019-07-25 21:23:24 +0530 | [diff] [blame] | 60 | - bench get-app erpnext $TRAVIS_BUILD_DIR |
Aditya Hase | 7c44ada | 2019-07-25 21:25:53 +0530 | [diff] [blame^] | 61 | - bench --site test_site reinstall --yes |
Pratik Vyas | f437e86 | 2013-12-24 12:17:59 +0530 | [diff] [blame] | 62 | |
Aditya Hase | f397acc | 2019-05-01 11:31:08 +0530 | [diff] [blame] | 63 | after_script: |
Aditya Hase | 2fb9e8a | 2019-07-25 21:10:06 +0530 | [diff] [blame] | 64 | - pip install python-coveralls |
Aditya Hase | f397acc | 2019-05-01 11:31:08 +0530 | [diff] [blame] | 65 | - coveralls -b apps/erpnext -d ../../sites/.coverage |