Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 
 

130 Zeilen
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. script: bench --site test_site run-ui-tests frappe --headless
  39. before_install:
  40. # do we really want to run travis?
  41. - |
  42. python ./.travis/roulette.py
  43. if [[ $? != 2 ]];then
  44. exit;
  45. fi
  46. # install wkhtmltopdf
  47. - wget -O /tmp/wkhtmltox.tar.xz https://github.com/frappe/wkhtmltopdf/raw/master/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
  48. - tar -xf /tmp/wkhtmltox.tar.xz -C /tmp
  49. - sudo mv /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
  50. - sudo chmod o+x /usr/local/bin/wkhtmltopdf
  51. # install cups
  52. - sudo apt-get install libcups2-dev
  53. install:
  54. - cd ~
  55. - source ./.nvm/nvm.sh
  56. - nvm install 12
  57. - pip install frappe-bench
  58. - bench init frappe-bench --skip-assets --python $(which python) --frappe-path $TRAVIS_BUILD_DIR
  59. - mkdir ~/frappe-bench/sites/test_site
  60. - cp $TRAVIS_BUILD_DIR/.travis/consumer_db/$DB.json ~/frappe-bench/sites/test_site/site_config.json
  61. - if [ $TYPE == "server" ]; then
  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. fi
  65. - if [ $DB == "mariadb" ];then
  66. mysql -u root -e "SET GLOBAL character_set_server = 'utf8mb4'";
  67. mysql -u root -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'";
  68. mysql -u root -e "CREATE DATABASE test_frappe_consumer";
  69. mysql -u root -e "CREATE USER 'test_frappe_consumer'@'localhost' IDENTIFIED BY 'test_frappe_consumer'";
  70. mysql -u root -e "GRANT ALL PRIVILEGES ON \`test_frappe_consumer\`.* TO 'test_frappe_consumer'@'localhost'";
  71. mysql -u root -e "CREATE DATABASE test_frappe_producer";
  72. mysql -u root -e "CREATE USER 'test_frappe_producer'@'localhost' IDENTIFIED BY 'test_frappe_producer'";
  73. mysql -u root -e "GRANT ALL PRIVILEGES ON \`test_frappe_producer\`.* TO 'test_frappe_producer'@'localhost'";
  74. mysql -u root -e "UPDATE mysql.user SET Password=PASSWORD('travis') WHERE User='root'";
  75. mysql -u root -e "FLUSH PRIVILEGES";
  76. fi
  77. - if [ $DB == "postgres" ];then
  78. psql -c "CREATE DATABASE test_frappe_consumer" -U postgres;
  79. psql -c "CREATE USER test_frappe_consumer WITH PASSWORD 'test_frappe'" -U postgres;
  80. psql -c "CREATE DATABASE test_frappe_producer" -U postgres;
  81. psql -c "CREATE USER test_frappe_producer WITH PASSWORD 'test_frappe'" -U postgres;
  82. fi
  83. - cd ./frappe-bench
  84. - sed -i 's/^watch:/# watch:/g' Procfile
  85. - sed -i 's/^schedule:/# schedule:/g' Procfile
  86. - if [ $TYPE == "server" ]; then sed -i 's/^socketio:/# socketio:/g' Procfile; fi
  87. - if [ $TYPE == "server" ]; then sed -i 's/^redis_socketio:/# redis_socketio:/g' Procfile; fi
  88. - if [ $TYPE == "ui" ]; then bench setup requirements --node; fi
  89. # install node-sass which is required for website theme test
  90. - cd ./apps/frappe
  91. - yarn add node-sass@4.13.1
  92. - cd ../..
  93. - bench start &
  94. - bench --site test_site reinstall --yes
  95. - if [ $TYPE == "server" ]; then bench --site test_site_producer reinstall --yes; fi
  96. - bench build --app frappe
  97. after_script:
  98. - pip install coverage==4.5.4
  99. - pip install python-coveralls
  100. - coveralls -b apps/frappe -d ../../sites/.coverage