### 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:
### 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:
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