From a9ab599e53b6cc9a51dc4ac490edffce706393ed Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 4 Apr 2018 08:57:37 +0200 Subject: [PATCH] Try to improve the contributing guide for tests --- .github/CONTRIBUTING.md | 12 ++++++++---- scripts/clean/server/test.sh | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 74dad7381..5a484fbbd 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -105,10 +105,12 @@ $ npm run dev ### Federation -Create the tests database if they do not exist: +Create a PostgreSQL user **with the same name as your username** in order to avoid using the *postgres* user. +Then, we can create the databases (if they don't already exist): ``` -$ sudo -u postgres createdb -O peertube peertube_test{1,2,3} +$ sudo -u postgres createuser you_username --createdb +$ createdb -O peertube peertube_test{1,2,3} ``` Build the application and flush the old tests data: @@ -130,10 +132,12 @@ with the `root` as username and `test{1,2,3}` for the password. ### Unit tests -Create the tests database if they do not exist: +Create a PostgreSQL user **with the same name as your username** in order to avoid using the *postgres* user. +Then, we can create the databases (if they don't already exist): ``` -$ sudo -u postgres createdb -O peertube peertube_test{1,2,3} +$ sudo -u postgres createuser you_username --createdb +$ createdb -O peertube peertube_test{1,2,3} ``` Build the application and run the unit/integration tests: diff --git a/scripts/clean/server/test.sh b/scripts/clean/server/test.sh index 7d353e375..303806fe2 100755 --- a/scripts/clean/server/test.sh +++ b/scripts/clean/server/test.sh @@ -7,6 +7,6 @@ for i in $(seq 1 6); do rm -rf "./test$i" rm -f "./config/local-test.json" rm -f "./config/local-test-$i.json" - createdb "peertube_test$i" + createdb -O peertube "peertube_test$i" redis-cli KEYS "q-localhost:900$i*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL done -- 2.41.0