]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - .github/CONTRIBUTING.md
Prevent compat issue with old username
[github/Chocobozzz/PeerTube.git] / .github / CONTRIBUTING.md
index 47129ea74eca2914f791d6740a666b84d5483ce8..b95ca367e651bb9f18a525b817501dad606411ef 100644 (file)
@@ -7,7 +7,6 @@ Interested in contributing? Awesome!
 <!-- START doctoc generated TOC please keep comment here to allow auto update -->
 <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
 
-
 - [Translate](#translate)
 - [Give your feedback](#give-your-feedback)
 - [Write documentation](#write-documentation)
@@ -20,7 +19,7 @@ Interested in contributing? Awesome!
   - [Client and server side](#client-and-server-side)
   - [RTL layout](#rtl-layout)
   - [Testing](#testing)
-    - [Unit tests](#unit-tests)
+    - [Unit/integration tests](#unitintegration-tests)
     - [Testing the federation of PeerTube servers](#testing-the-federation-of-peertube-servers)
   - [Emails](#emails)
 - [Plugins & Themes](#plugins--themes)
@@ -127,7 +126,7 @@ You can get a complete PeerTube development setup with Gitpod, a free one-click
 
 ### Server side
 
-You can find a documentation of the server code/architecture [here](https://docs.joinpeertube.org/#/contribute-architecture?id=server-code).
+You can find a documentation of the server code/architecture [here](https://docs.joinpeertube.org/contribute-architecture?id=server-code).
 
 To develop on the server-side:
 
@@ -142,7 +141,7 @@ restart.
 ### Client side
 
 You can find a documentation of the client code/architecture
-[here](https://docs.joinpeertube.org/#/contribute-architecture?id=client-code).
+[here](https://docs.joinpeertube.org/contribute-architecture?id=client-code).
 
 
 To develop on the client side:
@@ -175,43 +174,12 @@ $ npm run dev -- --ar-locale
 
 ### Testing
 
+#### Unit/integration tests
+
 Your code contributions must pass the tests before they can be merged. Tests ensure most of the application behaves
 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.
 
-PeerTube mainly features backend and plugin tests, found in `server/tests`.
-
-#### Unit tests
-
-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 createuser you_username --createdb --superuser
-$ npm run clean:server:test
-```
-
-Build the application and run the unit/integration tests:
-
-```
-$ npm run build -- --light
-$ npm test
-```
-
-If you just want to run 1 test (which is what you want to debug a specific test rapidly):
-
-```
-$ TS_NODE_FILES=true npm run mocha -- --exit -r ts-node/register -r tsconfig-paths/register --bail server/tests/api/videos/single-server.ts
-```
-
-While testing, you might want to display a server's logs:
-
-```
-NODE_APP_INSTANCE=1 NODE_ENV=test npm run parse-log -- --level debug | less +GF
-```
-
-Instance configurations are in `config/test-{1,2,3,4,5,6}.yaml`.
-Note that only instance 2 has transcoding enabled.
+See the [dedicated documentation](/support/doc/development/tests.md) to run tests locally.
 
 #### Testing the federation of PeerTube servers
 
@@ -248,8 +216,20 @@ Instance configurations are in `config/test-{1,2,3}.yaml`.
 To test emails with PeerTube:
 
  * Run [mailslurper](http://mailslurper.com/)
- * Run PeerTube using mailslurper SMTP port: `NODE_CONFIG='{ "smtp": { "hostname": "localhost", "port": 2500, "tls": false } }' NODE_ENV=test npm start`
+ * Run PeerTube using mailslurper SMTP port: `NODE_CONFIG='{ "smtp": { "hostname": "localhost", "port": 2500, "tls": false } }' NODE_ENV=dev node dist/server`
+
+### Environment variables
+
+PeerTube can be configured using environment variables.
+See the list on https://docs.joinpeertube.org/maintain-configuration?id=environment-variables
+
+Additionally to these ones, we provide some environment for dev/test purpose:
+
+ * `PRODUCTION_CONSTANTS=true`: in `NODE_ENV=dev` or `NODE_ENV=test` PeerTube customizes some constants. To prevent this behaviour, you can set `PRODUCTION_CONSTANTS` env to
+ `true`
+ * `PEERTUBE_LOCAL_CONFIG`: directory to find the local configuration file (used by web admin)
+ * `NODE_DB_LOG=false`: disable SQL request logging
 
 ## Plugins & Themes
 
-See the dedicated documentation: https://docs.joinpeertube.org/#/contribute-plugins
+See the dedicated documentation: https://docs.joinpeertube.org/contribute-plugins