You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

113 line
3.7 KiB

  1. language: python
  2. dist: trusty
  3. addons:
  4. hosts:
  5. - test_site
  6. - test_site_producer
  7. mariadb: 10.3
  8. postgresql: 9.5
  9. git:
  10. depth: 1
  11. cache:
  12. - pip
  13. - npm
  14. - yarn
  15. matrix:
  16. include:
  17. - name: "Python 3.6 MariaDB"
  18. python: 3.6
  19. env: DB=mariadb TYPE=server
  20. script: bench --site test_site run-tests --coverage
  21. - name: "Python 3.6 PostgreSQL"
  22. python: 3.6
  23. env: DB=postgres TYPE=server
  24. script: bench --site test_site run-tests --coverage
  25. - name: "Cypress"
  26. python: 3.6
  27. env: DB=mariadb TYPE=ui
  28. before_script:
  29. - bench --site test_site execute frappe.utils.install.complete_setup_wizard
  30. - bench --site test_site_producer execute frappe.utils.install.complete_setup_wizard
  31. script: bench --site test_site run-ui-tests frappe --headless
  32. - name: "Python 2.7 MariaDB"
  33. python: 2.7
  34. env: DB=mariadb TYPE=server
  35. script: bench --site test_site run-tests --coverage
  36. before_install:
  37. # install wkhtmltopdf
  38. - wget -O /tmp/wkhtmltox.tar.xz https://github.com/frappe/wkhtmltopdf/raw/master/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
  39. - tar -xf /tmp/wkhtmltox.tar.xz -C /tmp
  40. - sudo mv /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
  41. - sudo chmod o+x /usr/local/bin/wkhtmltopdf
  42. # install cups
  43. - sudo apt-get install libcups2-dev
  44. install:
  45. - cd ~
  46. - source ./.nvm/nvm.sh
  47. - nvm install v8.10.0
  48. - git clone https://github.com/frappe/bench --depth 1
  49. - pip install -e ./bench
  50. - bench init frappe-bench --skip-assets --python $(which python) --frappe-path $TRAVIS_BUILD_DIR
  51. - mkdir ~/frappe-bench/sites/test_site
  52. - cp $TRAVIS_BUILD_DIR/.travis/consumer_db/$DB.json ~/frappe-bench/sites/test_site/site_config.json
  53. - mkdir ~/frappe-bench/sites/test_site_producer
  54. - cp $TRAVIS_BUILD_DIR/.travis/producer_db/$DB.json ~/frappe-bench/sites/test_site_producer/site_config.json
  55. - if [ $DB == "mariadb" ];then
  56. mysql -u root -e "SET GLOBAL character_set_server = 'utf8mb4'";
  57. mysql -u root -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'";
  58. mysql -u root -e "CREATE DATABASE test_frappe_consumer";
  59. mysql -u root -e "CREATE USER 'test_frappe_consumer'@'localhost' IDENTIFIED BY 'test_frappe_consumer'";
  60. mysql -u root -e "GRANT ALL PRIVILEGES ON \`test_frappe_consumer\`.* TO 'test_frappe_consumer'@'localhost'";
  61. mysql -u root -e "CREATE DATABASE test_frappe_producer";
  62. mysql -u root -e "CREATE USER 'test_frappe_producer'@'localhost' IDENTIFIED BY 'test_frappe_producer'";
  63. mysql -u root -e "GRANT ALL PRIVILEGES ON \`test_frappe_producer\`.* TO 'test_frappe_producer'@'localhost'";
  64. mysql -u root -e "UPDATE mysql.user SET Password=PASSWORD('travis') WHERE User='root'";
  65. mysql -u root -e "FLUSH PRIVILEGES";
  66. fi
  67. - if [ $DB == "postgres" ];then
  68. psql -c "CREATE DATABASE test_frappe_consumer" -U postgres;
  69. psql -c "CREATE USER test_frappe_consumer WITH PASSWORD 'test_frappe'" -U postgres;
  70. psql -c "CREATE DATABASE test_frappe_producer" -U postgres;
  71. psql -c "CREATE USER test_frappe_producer WITH PASSWORD 'test_frappe'" -U postgres;
  72. fi
  73. - cd ./frappe-bench
  74. - sed -i 's/watch:/# watch:/g' Procfile
  75. - sed -i 's/schedule:/# schedule:/g' Procfile
  76. - if [ $TYPE == "server" ]; then sed -i 's/socketio:/# socketio:/g' Procfile; fi
  77. - if [ $TYPE == "server" ]; then sed -i 's/redis_socketio:/# redis_socketio:/g' Procfile; fi
  78. - if [ $TYPE == "ui" ]; then bench setup requirements --node; fi
  79. - bench start &
  80. - bench --site test_site reinstall --yes
  81. - bench --site test_site_producer reinstall --yes
  82. - bench build --app frappe
  83. after_script:
  84. - pip install coverage==4.5.4
  85. - pip install python-coveralls
  86. - coveralls -b apps/frappe -d ../../sites/.coverage