aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-04-04 08:57:37 +0200
committerChocobozzz <me@florianbigard.com>2018-04-04 08:57:37 +0200
commita9ab599e53b6cc9a51dc4ac490edffce706393ed (patch)
treee608f132072090d5f7e033efade0d4269ef69041
parentea20306f871c915a9b25224ae1a00b9484259951 (diff)
downloadPeerTube-a9ab599e53b6cc9a51dc4ac490edffce706393ed.tar.gz
PeerTube-a9ab599e53b6cc9a51dc4ac490edffce706393ed.tar.zst
PeerTube-a9ab599e53b6cc9a51dc4ac490edffce706393ed.zip
Try to improve the contributing guide for tests
-rw-r--r--.github/CONTRIBUTING.md12
-rwxr-xr-xscripts/clean/server/test.sh2
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
105 105
106### Federation 106### Federation
107 107
108Create the tests database if they do not exist: 108Create a PostgreSQL user **with the same name as your username** in order to avoid using the *postgres* user.
109Then, we can create the databases (if they don't already exist):
109 110
110``` 111```
111$ sudo -u postgres createdb -O peertube peertube_test{1,2,3} 112$ sudo -u postgres createuser you_username --createdb
113$ createdb -O peertube peertube_test{1,2,3}
112``` 114```
113 115
114Build the application and flush the old tests data: 116Build 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.
130 132
131### Unit tests 133### Unit tests
132 134
133Create the tests database if they do not exist: 135Create a PostgreSQL user **with the same name as your username** in order to avoid using the *postgres* user.
136Then, we can create the databases (if they don't already exist):
134 137
135``` 138```
136$ sudo -u postgres createdb -O peertube peertube_test{1,2,3} 139$ sudo -u postgres createuser you_username --createdb
140$ createdb -O peertube peertube_test{1,2,3}
137``` 141```
138 142
139Build the application and run the unit/integration tests: 143Build 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
7 rm -rf "./test$i" 7 rm -rf "./test$i"
8 rm -f "./config/local-test.json" 8 rm -f "./config/local-test.json"
9 rm -f "./config/local-test-$i.json" 9 rm -f "./config/local-test-$i.json"
10 createdb "peertube_test$i" 10 createdb -O peertube "peertube_test$i"
11 redis-cli KEYS "q-localhost:900$i*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL 11 redis-cli KEYS "q-localhost:900$i*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL
12done 12done