aboutsummaryrefslogtreecommitdiffhomepage
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/CONTRIBUTING.md57
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
66Don't hesitate to talk about features you want to develop by creating/commenting an issue 66Always talk about features you want to develop by creating/finding and commenting the issue tackling your problem
67before you start working on them :). 67before you start working on it, and inform the community that you begin coding by claiming the issue.
68
69Once you are ready to show your code to ask for feedback, submit a *draft* Pull Request.
70Once you are ready for a code review before merge, submit a Pull Request. In any case, please
71link 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
169Your code contributions must pass the tests before they can be merged. Tests ensure most of the application behaves
170as 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
172PeerTube mainly features backend and plugin tests, found in `server/tests`.
173
174#### Unit tests
164 175
165Create a PostgreSQL user **with the same name as your username** in order to avoid using the *postgres* user. 176Create a PostgreSQL user **with the same name as your username** in order to avoid using the *postgres* user.
177
166Then, we can create the databases (if they don't already exist): 178Then, 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
173Build the application and flush the old tests data: 185Build 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
180This will run 3 nodes: 192If 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
186Then you will get access to the three nodes at `http://localhost:900{1,2,3}` 198Instance configurations are in `config/test-{1,2,3,4,5,6}.yaml`.
187with the `root` as username and `test{1,2,3}` for the password. 199Note that only instance 2 has transcoding enabled.
188
189Instance configurations are in `config/test-{1,2,3}.yaml`.
190 200
191### Unit tests 201#### Testing the federation of PeerTube servers
192 202
193Create a PostgreSQL user **with the same name as your username** in order to avoid using the *postgres* user. 203Create a PostgreSQL user **with the same name as your username** in order to avoid using the *postgres* user.
194
195Then, we can create the databases (if they don't already exist): 204Then, 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
202Build the application and run the unit/integration tests: 211Build 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
209If you just want to run 1 test: 218This 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
215Instance configurations are in `config/test-{1,2,3,4,5,6}.yaml`. 224Then you will get access to the three nodes at `http://localhost:900{1,2,3}`
216Note that only instance 2 has transcoding enabled. 225with the `root` as username and `test{1,2,3}` for the password.
226
227Instance configurations are in `config/test-{1,2,3}.yaml`.
217 228
218### Emails 229### Emails
219 230