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.
 
 
 
 
 
 

37 line
1.4 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 setup-help
  12. bench setup-global-help --root_password travis
  13. bench --site test_site scheduler disable
  14. bench --site test_site run-tests --coverage
  15. elif [[ $TEST_TYPE == 'ui' ]]; then
  16. setup_mariadb_env 'test_site_ui'
  17. bench --site test_site_ui --force restore ./apps/frappe/test_sites/test_site_ui/20181116_225029-test_site_ui-database.sql.gz
  18. bench --site test_site_ui migrate
  19. bench --site test_site_ui setup-help
  20. bench setup-global-help --root_password travis
  21. bench --site test_site_ui scheduler disable
  22. cd apps/frappe && yarn && yarn cypress:run
  23. elif [[ $DB == 'postgres' ]]; then
  24. psql -c "CREATE DATABASE test_frappe;" -U postgres
  25. psql -c "CREATE USER test_frappe WITH PASSWORD 'test_frappe';" -U postgres
  26. bench --site test_site_postgres reinstall --yes
  27. bench --site test_site_postgres setup-help
  28. bench setup-global-help --db_type=postgres --root_password travis
  29. bench --site test_site_postgres scheduler disable
  30. bench --site test_site_postgres run-tests --coverage
  31. fi