test db and user creation fixed and scripted

This commit is contained in:
zurdi committed 2023-08-03 12:32:45 +02:00
1 parent 53d09ba95e
commit 282d36e9bb
2 files changed
+7 -5

No files matched your search

+3 -5
View File
@@ -79,12 +79,10 @@ npm run dev
### Create the test database
```sh
docker exec -it mariadb mysql -u root -p
# Enter password: <root password>
docker exec -i mariadb mysql -u root -p<root password> < romm_test/setup.sql # for amd images
docker exec -i mariadb mariadb -u root -p<root password> < romm_test/setup.sql # for arm images
CREATE USER 'romm_test'@'localhost' IDENTIFIED BY 'passwd';
CREATE DATABASE romm_test;
GRANT ALL PRIVILEGES ON romm_test.* TO 'romm_test'@'localhost' WITH GRANT OPTION;
pytest
```
Migrations will be run automatically when running the tests.
+4
View File
@@ -0,0 +1,4 @@
CREATE DATABASE romm_test;
CREATE USER 'romm_test'@'%' IDENTIFIED BY 'passwd';
GRANT ALL PRIVILEGES ON romm_test.* TO 'romm_test'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;