blob: 77d427e5a50ce879ff23087cb92358f507c931f3 [file] [log] [blame]
Aditya Hasee0e78fb2019-07-25 13:42:43 +05301language: python
Suraj Shettydde39c32020-05-14 12:09:36 +05302dist: trusty
Aditya Hasef397acc2019-05-01 11:31:08 +05303
Aditya Hase50e2d4a2019-07-25 21:36:22 +05304git:
5 depth: 1
6
7cache:
8 - pip
9
Aditya Hase9b24a422019-07-25 21:09:34 +053010addons:
Aditya Hasefb2ec712019-07-25 21:21:19 +053011 hosts: test_site
Aditya Hase9b24a422019-07-25 21:09:34 +053012 mariadb: 10.3
Pratik Vyasf437e862013-12-24 12:17:59 +053013
Aditya Hasee0e78fb2019-07-25 13:42:43 +053014jobs:
15 include:
Aditya Hasee0e78fb2019-07-25 13:42:43 +053016 - name: "Python 3.6 Server Side Test"
17 python: 3.6
Aditya Hasefb2ec712019-07-25 21:21:19 +053018 script: bench --site test_site run-tests --app erpnext --coverage
Aditya Hasee0e78fb2019-07-25 13:42:43 +053019
Aditya Hasee0e78fb2019-07-25 13:42:43 +053020 - name: "Python 3.6 Patch Test"
21 python: 3.6
22 before_script:
23 - wget http://build.erpnext.com/20171108_190013_955977f8_database.sql.gz
Aditya Hase00463572019-07-25 21:51:12 +053024 - bench --site test_site --force restore ~/frappe-bench/20171108_190013_955977f8_database.sql.gz
Aditya Hasefb2ec712019-07-25 21:21:19 +053025 script: bench --site test_site migrate
Aditya Hasee0e78fb2019-07-25 13:42:43 +053026
Pratik Vyasf437e862013-12-24 12:17:59 +053027install:
Aditya Hase3f6ac2d2019-07-25 21:11:18 +053028 - cd ~
Rushabh Mehtaa77a8a42019-02-26 14:30:00 +053029 - nvm install 10
Aditya Hase3f6ac2d2019-07-25 21:11:18 +053030
Suraj Shettydde39c32020-05-14 12:09:36 +053031 - pip install frappe-bench
shreyas60e9f842016-07-29 19:39:49 +053032
Aditya Hase23f24d12019-07-25 21:15:30 +053033 - git clone https://github.com/frappe/frappe --branch $TRAVIS_BRANCH --depth 1
Aditya Hasee3128412019-07-25 21:28:15 +053034 - bench init --skip-assets --frappe-path ~/frappe --python $(which python) frappe-bench
Aditya Hase23f24d12019-07-25 21:15:30 +053035
Aditya Hasee2b16e32019-07-25 21:18:05 +053036 - mkdir ~/frappe-bench/sites/test_site
37 - cp -r $TRAVIS_BUILD_DIR/.travis/site_config.json ~/frappe-bench/sites/test_site/
Pratik Vyas86680812014-10-12 19:35:46 +053038
Aditya Hase185e2a22019-07-25 21:19:30 +053039 - mysql -u root -e "SET GLOBAL character_set_server = 'utf8mb4'"
40 - mysql -u root -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'"
41
42 - mysql -u root -e "CREATE DATABASE test_frappe"
43 - mysql -u root -e "CREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe'"
44 - mysql -u root -e "GRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost'"
45
46 - mysql -u root -e "UPDATE mysql.user SET Password=PASSWORD('travis') WHERE User='root'"
47 - mysql -u root -e "FLUSH PRIVILEGES"
Rushabh Mehta4a7b4ef2017-07-10 23:00:01 +053048
Aditya Haseb6906c52019-07-25 22:40:26 +053049 - wget -O /tmp/wkhtmltox.tar.xz https://github.com/frappe/wkhtmltopdf/raw/master/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
50 - tar -xf /tmp/wkhtmltox.tar.xz -C /tmp
51 - sudo mv /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
52 - sudo chmod o+x /usr/local/bin/wkhtmltopdf
Gavin D'souza73319642019-11-27 14:53:58 +053053 - sudo apt-get install libcups2-dev
Aditya Haseb6906c52019-07-25 22:40:26 +053054
Pratik Vyas2a47eeb2015-01-01 15:48:04 +053055 - cd ~/frappe-bench
Aditya Hase30628b02019-07-25 21:27:20 +053056
57 - sed -i 's/watch:/# watch:/g' Procfile
58 - sed -i 's/schedule:/# schedule:/g' Procfile
59 - sed -i 's/socketio:/# socketio:/g' Procfile
60 - sed -i 's/redis_socketio:/# redis_socketio:/g' Procfile
61
Aditya Hase903e8782019-07-25 21:23:24 +053062 - bench get-app erpnext $TRAVIS_BUILD_DIR
Aditya Hase60764432019-07-25 21:38:07 +053063 - bench start &
Aditya Hase7c44ada2019-07-25 21:25:53 +053064 - bench --site test_site reinstall --yes
Pratik Vyasf437e862013-12-24 12:17:59 +053065
Aditya Hasef397acc2019-05-01 11:31:08 +053066after_script:
Mathieu Brunot45ea2bf2020-02-20 08:19:54 +010067 - pip install coverage==4.5.4
Aditya Hase2fb9e8a2019-07-25 21:10:06 +053068 - pip install python-coveralls
Aditya Hasef397acc2019-05-01 11:31:08 +053069 - coveralls -b apps/erpnext -d ../../sites/.coverage