diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-08-10 12:01:50 +0200 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2020-08-10 12:01:50 +0200 |
commit | a3e6d181996075752b77e0d5a367b62cc45c731b (patch) | |
tree | cb0a10cb6b7932a3be09d225068da43ee1ba7389 /.github | |
parent | fccbbc1a77d6e215eb299b569e9a4e5c79c7b719 (diff) | |
download | PeerTube-a3e6d181996075752b77e0d5a367b62cc45c731b.tar.gz PeerTube-a3e6d181996075752b77e0d5a367b62cc45c731b.tar.zst PeerTube-a3e6d181996075752b77e0d5a367b62cc45c731b.zip |
slightly reword CONTRIBUTING doc
Diffstat (limited to '.github')
-rw-r--r-- | .github/CONTRIBUTING.md | 57 |
1 files changed, 34 insertions, 23 deletions
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 704b22b8b..2af5c236a 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md | |||
@@ -63,8 +63,12 @@ It is not hosted on GitHub but on [Framasoft](https://framasoft.org/)'s own [Git | |||
63 | 63 | ||
64 | ## Develop | 64 | ## Develop |
65 | 65 | ||
66 | Don't hesitate to talk about features you want to develop by creating/commenting an issue | 66 | Always talk about features you want to develop by creating/finding and commenting the issue tackling your problem |
67 | before you start working on them :). | 67 | before you start working on it, and inform the community that you begin coding by claiming the issue. |
68 | |||
69 | Once you are ready to show your code to ask for feedback, submit a *draft* Pull Request. | ||
70 | Once you are ready for a code review before merge, submit a Pull Request. In any case, please | ||
71 | link your PR to the issues it solves by using the GitHub syntax: "fixes #issue_number". | ||
68 | 72 | ||
69 | ### Prerequisites | 73 | ### Prerequisites |
70 | 74 | ||
@@ -160,60 +164,67 @@ and the web server is automatically restarted. | |||
160 | $ npm run dev | 164 | $ npm run dev |
161 | ``` | 165 | ``` |
162 | 166 | ||
163 | ### Testing the federation of PeerTube servers | 167 | ### Testing |
168 | |||
169 | Your code contributions must pass the tests before they can be merged. Tests ensure most of the application behaves | ||
170 | as expected and respect the syntax conventions. They will run upon PR submission as part of our CI, but running them beforehand yourself will get you faster feedback and save CI runner time for others. | ||
171 | |||
172 | PeerTube mainly features backend and plugin tests, found in `server/tests`. | ||
173 | |||
174 | #### Unit tests | ||
164 | 175 | ||
165 | Create a PostgreSQL user **with the same name as your username** in order to avoid using the *postgres* user. | 176 | Create a PostgreSQL user **with the same name as your username** in order to avoid using the *postgres* user. |
177 | |||
166 | Then, we can create the databases (if they don't already exist): | 178 | Then, we can create the databases (if they don't already exist): |
167 | 179 | ||
168 | ``` | 180 | ``` |
169 | $ sudo -u postgres createuser you_username --createdb | 181 | $ sudo -u postgres createuser you_username --createdb --superuser |
170 | $ createdb -O peertube peertube_test{1,2,3} | 182 | $ npm run clean:server:test |
171 | ``` | 183 | ``` |
172 | 184 | ||
173 | Build the application and flush the old tests data: | 185 | Build the application and run the unit/integration tests: |
174 | 186 | ||
175 | ``` | 187 | ``` |
176 | $ npm run build -- --light | 188 | $ npm run build -- --light |
177 | $ npm run clean:server:test | 189 | $ npm test |
178 | ``` | 190 | ``` |
179 | 191 | ||
180 | This will run 3 nodes: | 192 | If you just want to run 1 test (which is what you want to debug a specific test rapidly): |
181 | 193 | ||
182 | ``` | 194 | ``` |
183 | $ npm run play | 195 | $ npm run mocha -- --exit -r ts-node/register -r tsconfig-paths/register --bail server/tests/api/index.ts |
184 | ``` | 196 | ``` |
185 | 197 | ||
186 | Then you will get access to the three nodes at `http://localhost:900{1,2,3}` | 198 | Instance configurations are in `config/test-{1,2,3,4,5,6}.yaml`. |
187 | with the `root` as username and `test{1,2,3}` for the password. | 199 | Note that only instance 2 has transcoding enabled. |
188 | |||
189 | Instance configurations are in `config/test-{1,2,3}.yaml`. | ||
190 | 200 | ||
191 | ### Unit tests | 201 | #### Testing the federation of PeerTube servers |
192 | 202 | ||
193 | Create a PostgreSQL user **with the same name as your username** in order to avoid using the *postgres* user. | 203 | Create a PostgreSQL user **with the same name as your username** in order to avoid using the *postgres* user. |
194 | |||
195 | Then, we can create the databases (if they don't already exist): | 204 | Then, we can create the databases (if they don't already exist): |
196 | 205 | ||
197 | ``` | 206 | ``` |
198 | $ sudo -u postgres createuser you_username --createdb --superuser | 207 | $ sudo -u postgres createuser you_username --createdb |
199 | $ npm run clean:server:test | 208 | $ createdb -O peertube peertube_test{1,2,3} |
200 | ``` | 209 | ``` |
201 | 210 | ||
202 | Build the application and run the unit/integration tests: | 211 | Build the application and flush the old tests data: |
203 | 212 | ||
204 | ``` | 213 | ``` |
205 | $ npm run build -- --light | 214 | $ npm run build -- --light |
206 | $ npm test | 215 | $ npm run clean:server:test |
207 | ``` | 216 | ``` |
208 | 217 | ||
209 | If you just want to run 1 test: | 218 | This will run 3 nodes: |
210 | 219 | ||
211 | ``` | 220 | ``` |
212 | $ npm run mocha -- --exit -r ts-node/register -r tsconfig-paths/register --bail server/tests/api/index.ts | 221 | $ npm run play |
213 | ``` | 222 | ``` |
214 | 223 | ||
215 | Instance configurations are in `config/test-{1,2,3,4,5,6}.yaml`. | 224 | Then you will get access to the three nodes at `http://localhost:900{1,2,3}` |
216 | Note that only instance 2 has transcoding enabled. | 225 | with the `root` as username and `test{1,2,3}` for the password. |
226 | |||
227 | Instance configurations are in `config/test-{1,2,3}.yaml`. | ||
217 | 228 | ||
218 | ### Emails | 229 | ### Emails |
219 | 230 | ||