diff options
author | Chocobozzz <me@florianbigard.com> | 2018-04-04 08:57:37 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-04-04 08:57:37 +0200 |
commit | a9ab599e53b6cc9a51dc4ac490edffce706393ed (patch) | |
tree | e608f132072090d5f7e033efade0d4269ef69041 | |
parent | ea20306f871c915a9b25224ae1a00b9484259951 (diff) | |
download | PeerTube-a9ab599e53b6cc9a51dc4ac490edffce706393ed.tar.gz PeerTube-a9ab599e53b6cc9a51dc4ac490edffce706393ed.tar.zst PeerTube-a9ab599e53b6cc9a51dc4ac490edffce706393ed.zip |
Try to improve the contributing guide for tests
-rw-r--r-- | .github/CONTRIBUTING.md | 12 | ||||
-rwxr-xr-x | 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 | |||
105 | 105 | ||
106 | ### Federation | 106 | ### Federation |
107 | 107 | ||
108 | Create the tests database if they do not exist: | 108 | Create a PostgreSQL user **with the same name as your username** in order to avoid using the *postgres* user. |
109 | Then, 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 | ||
114 | Build the application and flush the old tests data: | 116 | 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. | |||
130 | 132 | ||
131 | ### Unit tests | 133 | ### Unit tests |
132 | 134 | ||
133 | Create the tests database if they do not exist: | 135 | Create a PostgreSQL user **with the same name as your username** in order to avoid using the *postgres* user. |
136 | Then, 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 | ||
139 | Build the application and run the unit/integration tests: | 143 | 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 | |||
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 |
12 | done | 12 | done |