25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

31 satır
1.1 KiB

  1. #!/bin/bash
  2. set -e
  3. setup_mariadb_env() {
  4. mysql -u root -ptravis -e "create database $1"
  5. mysql -u root -ptravis -e "USE mysql; CREATE USER '$1'@'localhost' IDENTIFIED BY '$1'; FLUSH PRIVILEGES; "
  6. mysql -u root -ptravis -e "USE mysql; GRANT ALL PRIVILEGES ON \`$1\`.* TO '$1'@'localhost';"
  7. }
  8. if [[ $DB == 'mariadb' ]]; then
  9. setup_mariadb_env 'test_frappe'
  10. bench --site test_site reinstall --yes
  11. bench --site test_site scheduler disable
  12. bench --site test_site run-tests --coverage
  13. elif [[ $TEST_TYPE == 'ui' ]]; then
  14. setup_mariadb_env 'test_site_ui'
  15. bench --site test_site_ui --force restore ./apps/frappe/test_sites/test_site_ui/test_site_ui-database.sql.gz
  16. bench --site test_site_ui migrate
  17. bench --site test_site_ui scheduler disable
  18. cd apps/frappe && yarn && yarn cypress:run
  19. elif [[ $DB == 'postgres' ]]; then
  20. psql -c "CREATE DATABASE test_frappe;" -U postgres
  21. psql -c "CREATE USER test_frappe WITH PASSWORD 'test_frappe';" -U postgres
  22. bench --site test_site_postgres reinstall --yes
  23. bench --site test_site_postgres scheduler disable
  24. bench --site test_site_postgres run-tests --coverage
  25. fi