diff --git a/.travis.yml b/.travis.yml index bdc7205d49..4987437da4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,17 +17,16 @@ env: before_install: # - psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE evennia TO evennia;" - - psql -U postgres -c "CREATE DATABASE evennia;" - - psql -U postgres -c "CREATE USER evennia WITH PASSWORD 'password';" - - psql -U postgres -c "ALTER USER evennia CREATEDB;" - - mysql -u root -e "CREATE DATABASE evennia CHARACTER SET utf8mb4;" - - mysql -u root -e "CREATE USER 'evennia'@'localhost' IDENTIFIED BY 'password';" - - mysql -u root -e "GRANT ALL ON *.* TO 'evennia'@'localhost' IDENTIFIED BY 'password';" + - if [[ $TESTING_DB == postgresql ]]; psql -U postgres -c "CREATE DATABASE evennia;" fi + - if [[ $TESTING_DB == postgresql ]]; psql -U postgres -c "CREATE USER evennia WITH PASSWORD 'password';" fi + - if [[ $TESTING_DB == postgresql ]]; psql -U postgres -c "ALTER USER evennia CREATEDB;" fi + - if [[ $TESTING_DB == mysql ]]; then mysql -u root -e "CREATE DATABASE evennia CHARACTER SET utf8mb4;" fi + - if [[ $TESTING_DB == mysql ]]; then mysql -u root -e "CREATE USER 'evennia'@'localhost' IDENTIFIED BY 'password';" fi + - if [[ $TESTING_DB == mysql ]]; mysql -u root -e "GRANT ALL ON *.* TO 'evennia'@'localhost' IDENTIFIED BY 'password';" fi install: - - pip install psycopg2-binary - - pip install mysqlclient - - pip install PyMySQL + - if [[ $TESTING_DB == postgresql ]]; pip install psycopg2-binary fi + - if [[ $TESTING_DB == mysql ]]; pip install mysqlclient fi - pip install coveralls - pip install -e . diff --git a/.travis/my.conf b/.travis/my.conf new file mode 100644 index 0000000000..51b810ecc7 --- /dev/null +++ b/.travis/my.conf @@ -0,0 +1 @@ +init_connect='SET collation_connection = utf8_general_ci; SET NAMES utf8;' diff --git a/.travis/mysql_settings.py b/.travis/mysql_settings.py index 79e709af71..b58dbcd52a 100644 --- a/.travis/mysql_settings.py +++ b/.travis/mysql_settings.py @@ -47,12 +47,12 @@ DATABASES = { 'HOST': 'localhost', 'PORT': '', # use default port 'OPTIONS': { - 'init_command': 'SET collation_connection = utf8_general_ci' + 'read_default_file': '.travis/my.conf' }, 'TEST': { 'NAME': 'default', 'OPTIONS': { - 'init_command': 'SET collation_connection = utf8_general_ci' + 'read_default_file': '.travis/my.conf' } } }