Skip to content
Permalink
Browse files

Refactor travis tests

  • Loading branch information...
jochenklar committed Sep 5, 2019
1 parent 303c414 commit ddebbd11d7f6267e9431aa769efab80aee934756
@@ -1,13 +1,14 @@
language: python
cache: pip
dist: bionic

python:
- 3.5
- 3.6
- 3.7

addons:
mariadb: '10.1'
postgresql: '9.6'
postgresql: '10'

env:
- DB=mysql
@@ -20,27 +21,20 @@ before_install:
install:
- pip install --upgrade pip setuptools wheel
- pip install -e .
- pip install mysqlclient psycopg2-binary coveralls
- pip install mysqlclient
- pip install psycopg2-binary
- pip install coveralls

before_script:
- sh -c "cp testing/config/settings/$DB.py testing/config/settings/local.py; fi"
- mkdir testing/log testing/download
- mysql -e "CREATE USER daiquiri_app@localhost IDENTIFIED BY 'daiquiri_app';"
- mysql -e "CREATE USER daiquiri_data@localhost IDENTIFIED BY 'daiquiri_data';"
- mysql -e "GRANT ALL PRIVILEGES ON test_daiquiri_app.* TO daiquiri_app@localhost;"
- mysql < testing/sql/mysql.sql
- psql -U postgres -c "CREATE USER daiquiri_app WITH PASSWORD 'daiquiri_app';"
- psql -U postgres -c "CREATE USER daiquiri_data WITH PASSWORD 'daiquiri_data';"
- psql -U postgres -c "CREATE DATABASE test_daiquiri_app OWNER daiquiri_app;"
- psql -U postgres -c "CREATE DATABASE test_daiquiri_data OWNER daiquiri_data;"
- psql -U postgres -c "CREATE DATABASE test_daiquiri_tap OWNER daiquiri_data;"
- psql -U postgres -c "CREATE DATABASE test_daiquiri_oai OWNER daiquiri_data;"
- psql -U postgres -c "CREATE SCHEMA TAP_SCHEMA AUTHORIZATION daiquiri_data;" test_daiquiri_tap
- psql -U postgres -c "CREATE SCHEMA OAI AUTHORIZATION daiquiri_data;" test_daiquiri_oai
- psql -U postgres -f testing/sql/postgres.sql test_daiquiri_data
- mysql < testing/sql/mysql/test.sql
- mysql < testing/sql/mysql/data.sql
- psql -U postgres -f testing/sql/postgres/test.sql
- psql -U postgres -f testing/sql/postgres/data.sql test_daiquiri_data

script:
- coverage run testing/runtests.py -k
- coverage run testing/runtests.py

after_success:
- coveralls
@@ -23,22 +23,22 @@
},
'tap': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'TAP_SCHEMA',
'NAME': 'tap_schema',
'USER': 'daiquiri_data',
'PASSWORD': 'daiquiri_data',
'HOST': '127.0.0.1',
'TEST': {
'NAME': 'test_daiquiri_tap',
'NAME': 'test_tap_schema',
},
},
'oai': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'OAI',
'NAME': 'oai_schema',
'USER': 'daiquiri_data',
'PASSWORD': 'daiquiri_data',
'HOST': '127.0.0.1',
'TEST': {
'NAME': 'test_daiquiri_oai',
'NAME': 'test_oai_schema',
},
},
}
@@ -1,8 +1,5 @@
-- drop and create databases

DROP DATABASE IF EXISTS `daiquiri_data`;
CREATE DATABASE `daiquiri_data`;

DROP DATABASE IF EXISTS `daiquiri_archive`;
CREATE DATABASE `daiquiri_archive`;

@@ -69,17 +66,6 @@ GRANT SELECT ON `daiquiri_data_test`.* TO 'daiquiri_data'@'localhost';
GRANT SELECT ON `daiquiri_data_obs`.* TO 'daiquiri_data'@'localhost';
GRANT SELECT ON `daiquiri_data_sim`.* TO 'daiquiri_data'@'localhost';

GRANT ALL PRIVILEGES ON `daiquiri_data`.* TO 'daiquiri_data'@'localhost';

GRANT ALL PRIVILEGES ON `TAP_SCHEMA`.* TO 'daiquiri_data'@'localhost';
GRANT ALL PRIVILEGES ON `test_TAP_SCHEMA`.* TO 'daiquiri_data'@'localhost';

GRANT ALL PRIVILEGES ON `TAP_UPLOAD`.* TO 'daiquiri_data'@'localhost';
GRANT ALL PRIVILEGES ON `test_TAP_UPLOAD`.* TO 'daiquiri_data'@'localhost';

GRANT ALL PRIVILEGES ON `OAI`.* TO 'daiquiri_data'@'localhost';
GRANT ALL PRIVILEGES ON `test_OAI`.* TO 'daiquiri_data'@'localhost';

GRANT ALL PRIVILEGES ON `daiquiri_user_%`.* TO 'daiquiri_data'@'localhost';

-- insert data
@@ -0,0 +1,18 @@
CREATE USER IF NOT EXISTS 'daiquiri_app'@'localhost' identified by 'daiquiri_app';
CREATE USER IF NOT EXISTS 'daiquiri_data'@'localhost' identified by 'daiquiri_data';

DROP DATABASE IF EXISTS `test_daiquiri_app`;
CREATE DATABASE `test_daiquiri_app` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL PRIVILEGES ON `test_daiquiri_app`.* to 'daiquiri_app'@'localhost';

DROP DATABASE IF EXISTS `test_daiquiri_data`;
CREATE DATABASE `test_daiquiri_data` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL PRIVILEGES ON `test_daiquiri_data`.* to 'daiquiri_data'@'localhost';

DROP DATABASE IF EXISTS `test_tap_schema`;
CREATE DATABASE `test_tap_schema` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL PRIVILEGES ON `test_tap_schema`.* to 'daiquiri_data'@'localhost';

DROP DATABASE IF EXISTS `test_oai_schema`;
CREATE DATABASE `test_oai_schema` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL PRIVILEGES ON `test_oai_schema`.* to 'daiquiri_data'@'localhost';
File renamed without changes.
@@ -0,0 +1,14 @@
CREATE USER daiquiri_app WITH PASSWORD 'daiquiri_app';
CREATE USER daiquiri_data WITH PASSWORD 'daiquiri_data';

DROP DATABASE IF EXISTS test_daiquiri_app;
CREATE DATABASE test_daiquiri_app WITH OWNER daiquiri_app;

DROP DATABASE IF EXISTS test_daiquiri_data;
CREATE DATABASE test_daiquiri_data;

DROP DATABASE IF EXISTS test_daiquiri_tap;
CREATE DATABASE test_daiquiri_tap WITH OWNER daiquiri_data;

DROP DATABASE IF EXISTS test_daiquiri_oai;
CREATE DATABASE test_daiquiri_oai WITH OWNER daiquiri_data;

0 comments on commit ddebbd1

Please sign in to comment.
You can’t perform that action at this time.