Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

129 linhas
4.0 KiB

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