diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 44e86910..724664ec 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -44,13 +44,11 @@ jobs: - name: Prepare MySQL database run: | sudo systemctl start mysql.service - mysql --user=root --password=root < testing/sql/mysql/test.sql - cat ../daiquiri/testing/sql/mysql/data/* | mysql --user=root --password=root + mysql --user=root --password=root < testing/sql/mysql/setup.sql - name: Prepare PostgreSQL database run: | - psql postgresql://postgres:postgres_password@localhost:5432 -f testing/sql/postgres/test.sql - cat ../daiquiri/testing/sql/postgres/data/* | psql postgresql://postgres:postgres_password@localhost:5432/test_daiquiri_data + psql postgresql://postgres:postgres_password@localhost:5432 -f testing/sql/postgres/setup.sql psql postgresql://postgres:postgres_password@localhost:5432/test_daiquiri_data -c 'VACUUM ANALYSE;' - name: Run tests diff --git a/testing/sql/mysql/setup.sql b/testing/sql/mysql/setup.sql index b5446236..dcfe7731 100644 --- a/testing/sql/mysql/setup.sql +++ b/testing/sql/mysql/setup.sql @@ -18,8 +18,8 @@ CREATE DATABASE `test_oai_schema` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ GRANT ALL PRIVILEGES ON `test_oai_schema`.* to 'daiquiri_data'@'localhost'; use test_daiquiri_data; -source testing/sql/mysql/archive.sql; -source testing/sql/mysql/obs.sql; -source testing/sql/mysql/sim.sql; -source testing/sql/mysql/test.sql; -source testing/sql/mysql/user.sql; +source testing/sql/mysql/data/archive.sql; +source testing/sql/mysql/data/obs.sql; +source testing/sql/mysql/data/sim.sql; +source testing/sql/mysql/data/test.sql; +source testing/sql/mysql/data/user.sql; diff --git a/testing/sql/postgres/setup.sql b/testing/sql/postgres/setup.sql index 33f122f9..a1e359d2 100644 --- a/testing/sql/postgres/setup.sql +++ b/testing/sql/postgres/setup.sql @@ -14,8 +14,8 @@ DROP DATABASE IF EXISTS test_daiquiri_oai; CREATE DATABASE test_daiquiri_oai WITH OWNER daiquiri_data; \c test_daiquiri_data; -\i testing/sql/postgres/archive.sql -\i testing/sql/postgres/obs.sql -\i testing/sql/postgres/sim.sql -\i testing/sql/postgres/test.sql -\i testing/sql/postgres/user.sql +\i testing/sql/postgres/data/archive.sql +\i testing/sql/postgres/data/obs.sql +\i testing/sql/postgres/data/sim.sql +\i testing/sql/postgres/data/test.sql +\i testing/sql/postgres/data/user.sql