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.
 
 
 
 
 
 

111 lines
3.6 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. chrome: stable
  10. git:
  11. depth: 1
  12. cache:
  13. pip: true
  14. npm: true
  15. yarn: true
  16. directories:
  17. # we also need to cache folder with Cypress binary
  18. # https://docs.cypress.io/guides/guides/continuous-integration.html#Caching
  19. - ~/.cache
  20. matrix:
  21. include:
  22. - name: "Python 3.6 MariaDB"
  23. python: 3.6
  24. env: DB=mariadb TYPE=server
  25. script: bench --site test_site run-tests --coverage
  26. - name: "Python 3.6 PostgreSQL"
  27. python: 3.6
  28. env: DB=postgres TYPE=server
  29. script: bench --site test_site run-tests --coverage
  30. - name: "Cypress"
  31. python: 3.6
  32. env: DB=mariadb TYPE=ui
  33. before_script:
  34. - bench --site test_site execute frappe.utils.install.complete_setup_wizard
  35. - bench --site test_site_producer execute frappe.utils.install.complete_setup_wizard
  36. script: bench --site test_site run-ui-tests frappe --headless
  37. before_install:
  38. # install wkhtmltopdf
  39. - wget -O /tmp/wkhtmltox.tar.xz https://github.com/frappe/wkhtmltopdf/raw/master/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
  40. - tar -xf /tmp/wkhtmltox.tar.xz -C /tmp
  41. - sudo mv /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
  42. - sudo chmod o+x /usr/local/bin/wkhtmltopdf
  43. # install cups
  44. - sudo apt-get install libcups2-dev
  45. install:
  46. - cd ~
  47. - source ./.nvm/nvm.sh
  48. - nvm install 12
  49. - pip install frappe-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. - bench setup requirements --node
  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