blob: 365eb67f3dc90e6c2f46ec549f049723b8c7fd63 [file] [log] [blame]
shreyas60e9f842016-07-29 19:39:49 +05301dist: trusty
Rushabh Mehta4a7b4ef2017-07-10 23:00:01 +05302
Aditya Hasee0e78fb2019-07-25 13:42:43 +05303language: python
Aditya Hasef397acc2019-05-01 11:31:08 +05304
Aditya Hase50e2d4a2019-07-25 21:36:22 +05305git:
6 depth: 1
7
8cache:
9 - pip
10
Aditya Hase9b24a422019-07-25 21:09:34 +053011addons:
Aditya Hasefb2ec712019-07-25 21:21:19 +053012 hosts: test_site
Aditya Hase9b24a422019-07-25 21:09:34 +053013 mariadb: 10.3
Pratik Vyasf437e862013-12-24 12:17:59 +053014
Aditya Hasee0e78fb2019-07-25 13:42:43 +053015jobs:
16 include:
17 - name: "Python 2.7 Server Side Test"
18 python: 2.7
Aditya Hasefb2ec712019-07-25 21:21:19 +053019 script: bench --site test_site run-tests --app erpnext --coverage
Aditya Hasee0e78fb2019-07-25 13:42:43 +053020
21 - name: "Python 3.6 Server Side Test"
22 python: 3.6
Aditya Hasefb2ec712019-07-25 21:21:19 +053023 script: bench --site test_site run-tests --app erpnext --coverage
Aditya Hasee0e78fb2019-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
Aditya Hase00463572019-07-25 21:51:12 +053029 - bench --site test_site --force restore ~/frappe-bench/20171108_190013_955977f8_database.sql.gz
Aditya Hasefb2ec712019-07-25 21:21:19 +053030 script: bench --site test_site migrate
Aditya Hasee0e78fb2019-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 Hase00463572019-07-25 21:51:12 +053036 - bench --site test_site --force restore ~/frappe-bench/20171108_190013_955977f8_database.sql.gz
Aditya Hasefb2ec712019-07-25 21:21:19 +053037 script: bench --site test_site migrate
Aditya Hasee0e78fb2019-07-25 13:42:43 +053038
Pratik Vyasf437e862013-12-24 12:17:59 +053039install:
Aditya Hase3f6ac2d2019-07-25 21:11:18 +053040 - cd ~
Rushabh Mehtaa77a8a42019-02-26 14:30:00 +053041 - nvm install 10
Aditya Hase3f6ac2d2019-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 Hase23f24d12019-07-25 21:15:30 +053046 - git clone https://github.com/frappe/frappe --branch $TRAVIS_BRANCH --depth 1
Aditya Hasee3128412019-07-25 21:28:15 +053047 - bench init --skip-assets --frappe-path ~/frappe --python $(which python) frappe-bench
Aditya Hase23f24d12019-07-25 21:15:30 +053048
Aditya Hasee2b16e32019-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
Aditya Hase185e2a22019-07-25 21:19:30 +053052 - 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 Mehta4a7b4ef2017-07-10 23:00:01 +053061
Aditya Haseb6906c52019-07-25 22:40:26 +053062 - 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'souza73319642019-11-27 14:53:58 +053066 - sudo apt-get install libcups2-dev
Aditya Haseb6906c52019-07-25 22:40:26 +053067
Pratik Vyas2a47eeb2015-01-01 15:48:04 +053068 - cd ~/frappe-bench
Aditya Hase30628b02019-07-25 21:27:20 +053069
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 Hase903e8782019-07-25 21:23:24 +053075 - bench get-app erpnext $TRAVIS_BUILD_DIR
Aditya Hase60764432019-07-25 21:38:07 +053076 - bench start &
Aditya Hase7c44ada2019-07-25 21:25:53 +053077 - bench --site test_site reinstall --yes
Pratik Vyasf437e862013-12-24 12:17:59 +053078
Aditya Hasef397acc2019-05-01 11:31:08 +053079after_script:
Aditya Hase2fb9e8a2019-07-25 21:10:06 +053080 - pip install python-coveralls
Aditya Hasef397acc2019-05-01 11:31:08 +053081 - coveralls -b apps/erpnext -d ../../sites/.coverage