diff options
author | Chocobozzz <me@florianbigard.com> | 2021-09-02 08:57:59 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-09-02 09:07:42 +0200 |
commit | 12d6b873cd4c5eb8c4fd298885e0c7fa6deb3756 (patch) | |
tree | 1abc21b305242e1d5bacefc99c2352b34396a5ab /support/doc/development | |
parent | 6527eb0ccf823b5eac547c90066d3bd693094b2c (diff) | |
download | PeerTube-12d6b873cd4c5eb8c4fd298885e0c7fa6deb3756.tar.gz PeerTube-12d6b873cd4c5eb8c4fd298885e0c7fa6deb3756.tar.zst PeerTube-12d6b873cd4c5eb8c4fd298885e0c7fa6deb3756.zip |
Improve e2e workflow and add doc
Diffstat (limited to 'support/doc/development')
-rw-r--r-- | support/doc/development/tests.md | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/support/doc/development/tests.md b/support/doc/development/tests.md new file mode 100644 index 000000000..e311d3267 --- /dev/null +++ b/support/doc/development/tests.md | |||
@@ -0,0 +1,72 @@ | |||
1 | # Tests | ||
2 | |||
3 | ## Preparation | ||
4 | |||
5 | Prepare PostgreSQL user so PeerTube can delete/create the test databases: | ||
6 | |||
7 | ``` | ||
8 | $ sudo -u postgres createuser you_username --createdb --superuser | ||
9 | ``` | ||
10 | |||
11 | Prepare databases: | ||
12 | |||
13 | ``` | ||
14 | $ npm run clean:server:test | ||
15 | ``` | ||
16 | |||
17 | Build PeerTube: | ||
18 | |||
19 | ``` | ||
20 | $ npm run build | ||
21 | ``` | ||
22 | |||
23 | ## Server tests | ||
24 | |||
25 | ### Dependencies | ||
26 | |||
27 | Run docker containers needed by some test files: | ||
28 | |||
29 | ``` | ||
30 | $ sudo docker run -p 9444:9000 chocobozzz/s3-ninja | ||
31 | $ sudo docker run -p 10389:10389 chocobozzz/docker-test-openldap | ||
32 | ``` | ||
33 | |||
34 | ### Test | ||
35 | |||
36 | To run all test suites: | ||
37 | |||
38 | ``` | ||
39 | $ npm run test # See scripts/test.sh to run a particular suite | ||
40 | ``` | ||
41 | |||
42 | To run a particular test file: | ||
43 | |||
44 | ``` | ||
45 | TS_NODE_TRANSPILE_ONLY=true mocha -- --timeout 30000 --exit -r ts-node/register -r tsconfig-paths/register --bail server/tests/api/videos/video-transcoder.ts | ||
46 | ``` | ||
47 | |||
48 | ### Configuration | ||
49 | |||
50 | Some env variables can be defined to disable/enable some tests: | ||
51 | |||
52 | * `DISABLE_HTTP_IMPORT_TESTS`: disable import tests (because of youtube that could rate limit your IP) | ||
53 | * `ENABLE_OBJECT_STORAGE_TESTS=true`: enable object storage tests (needs a docker container first) | ||
54 | |||
55 | |||
56 | ## Client E2E tests | ||
57 | |||
58 | ### Local tests | ||
59 | |||
60 | To run tests on local web browsers (comment web browsers you don't have in `client/e2e/wdio.local.conf.ts`): | ||
61 | |||
62 | ``` | ||
63 | $ npm run e2e:local | ||
64 | ``` | ||
65 | |||
66 | ### Browserstack tests | ||
67 | |||
68 | To run tests on browser stack: | ||
69 | |||
70 | ``` | ||
71 | $ BROWSERSTACK_USER=your_user BROWSERSTACK_KEY=your_key npm run e2e:browserstack | ||
72 | ``` | ||