110 lines
3.4 KiB
YAML
110 lines
3.4 KiB
YAML
language: python
|
|
dist: trusty
|
|
|
|
addons:
|
|
hosts:
|
|
- test_site
|
|
mariadb: 10.3
|
|
postgresql: 9.5
|
|
|
|
git:
|
|
depth: 1
|
|
|
|
cache:
|
|
- pip
|
|
- npm
|
|
- yarn
|
|
|
|
matrix:
|
|
include:
|
|
- name: "Python 3.6 MariaDB"
|
|
python: 3.6
|
|
env: DB=mariadb TYPE=server
|
|
script: bench --site test_site run-tests --coverage
|
|
|
|
- name: "Python 3.6 MariaDB XML Report"
|
|
python: 3.6
|
|
env: DB=mariadb TYPE=server
|
|
script: bench --site test_site run-tests --coverage --junit-xml-output frappe_unit_tests.xml
|
|
|
|
- name: "Python 3.6 PostgreSQL"
|
|
python: 3.6
|
|
env: DB=postgres TYPE=server
|
|
script: bench --site test_site run-tests --coverage
|
|
|
|
- name: "Python 3.6 PostgreSQL XML Report"
|
|
python: 3.6
|
|
env: DB=postgres TYPE=server
|
|
script: bench --site test_site run-tests --coverage --junit-xml-output frappe_unit_tests.xml
|
|
|
|
- name: "Cypress"
|
|
python: 3.6
|
|
env: DB=mariadb TYPE=ui
|
|
before_script: bench --site test_site execute frappe.utils.install.complete_setup_wizard
|
|
script: bench --site test_site run-ui-tests frappe --headless
|
|
|
|
- name: "Python 2.7 MariaDB"
|
|
python: 2.7
|
|
env: DB=mariadb TYPE=server
|
|
script: bench --site test_site run-tests --coverage
|
|
|
|
- name: "Python 2.7 MariaDB XML Report"
|
|
python: 2.7
|
|
env: DB=mariadb TYPE=server
|
|
script: bench --site test_site run-tests --coverage --junit-xml-output frappe_unit_tests.xml
|
|
|
|
before_install:
|
|
# install wkhtmltopdf
|
|
- wget -O /tmp/wkhtmltox.tar.xz https://github.com/frappe/wkhtmltopdf/raw/master/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
|
|
- tar -xf /tmp/wkhtmltox.tar.xz -C /tmp
|
|
- sudo mv /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
|
|
- sudo chmod o+x /usr/local/bin/wkhtmltopdf
|
|
|
|
# install cups
|
|
- sudo apt-get install libcups2-dev
|
|
|
|
install:
|
|
- cd ~
|
|
- source ./.nvm/nvm.sh
|
|
- nvm install v8.10.0
|
|
|
|
- git clone https://github.com/frappe/bench --depth 1
|
|
- pip install -e ./bench
|
|
|
|
- bench init frappe-bench --skip-assets --python $(which python) --frappe-path $TRAVIS_BUILD_DIR
|
|
|
|
- mkdir ~/frappe-bench/sites/test_site
|
|
- cp $TRAVIS_BUILD_DIR/.travis/$DB.json ~/frappe-bench/sites/test_site/site_config.json
|
|
|
|
- if [ $DB == "mariadb" ];then
|
|
mysql -u root -e "SET GLOBAL character_set_server = 'utf8mb4'";
|
|
mysql -u root -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'";
|
|
mysql -u root -e "CREATE DATABASE test_frappe";
|
|
mysql -u root -e "CREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe'";
|
|
mysql -u root -e "GRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost'";
|
|
mysql -u root -e "UPDATE mysql.user SET Password=PASSWORD('travis') WHERE User='root'";
|
|
mysql -u root -e "FLUSH PRIVILEGES";
|
|
fi
|
|
|
|
- if [ $DB == "postgres" ];then
|
|
psql -c "CREATE DATABASE test_frappe" -U postgres;
|
|
psql -c "CREATE USER test_frappe WITH PASSWORD 'test_frappe'" -U postgres;
|
|
fi
|
|
|
|
- cd ./frappe-bench
|
|
|
|
- sed -i 's/watch:/# watch:/g' Procfile
|
|
- sed -i 's/schedule:/# schedule:/g' Procfile
|
|
|
|
- if [ $TYPE == "server" ]; then sed -i 's/socketio:/# socketio:/g' Procfile; fi
|
|
- if [ $TYPE == "server" ]; then sed -i 's/redis_socketio:/# redis_socketio:/g' Procfile; fi
|
|
|
|
- if [ $TYPE == "ui" ]; then bench setup requirements --node; fi
|
|
|
|
- bench start &
|
|
- bench --site test_site reinstall --yes
|
|
- bench build --app frappe
|
|
|
|
after_script:
|
|
- pip install python-coveralls
|
|
- coveralls -b apps/frappe -d ../../sites/.coverage
|