aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/ci.sh
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-12-10 16:06:09 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-12-14 09:11:27 +0100
commit17ae86e9128c090b02494dd1ba10bdc41cd86936 (patch)
treebd1e621f86230ac5bee11e783269a9cc7b43e207 /scripts/ci.sh
parente0783718079c1fcb6554ea20e762cfb0592de5b0 (diff)
downloadPeerTube-17ae86e9128c090b02494dd1ba10bdc41cd86936.tar.gz
PeerTube-17ae86e9128c090b02494dd1ba10bdc41cd86936.tar.zst
PeerTube-17ae86e9128c090b02494dd1ba10bdc41cd86936.zip
Display job log in ci
Diffstat (limited to 'scripts/ci.sh')
-rwxr-xr-xscripts/ci.sh26
1 files changed, 18 insertions, 8 deletions
diff --git a/scripts/ci.sh b/scripts/ci.sh
index c6f5b8e77..84254cbc0 100755
--- a/scripts/ci.sh
+++ b/scripts/ci.sh
@@ -14,15 +14,25 @@ jobs=2
14 14
15runTest () { 15runTest () {
16 retries=3 16 retries=3
17
18 jobname=$1
19 shift
20
17 jobs=$1 21 jobs=$1
18 shift 22 shift
23
19 files=$@ 24 files=$@
20 25
21 echo $files 26 echo $files
22 27
23 parallel -t -j $jobs --retries $retries \ 28 joblog="$jobname-ci.log"
29
30 parallel -t -j $jobs --retries $retries --joblog "$joblog" \
24 npm run mocha -- -c --timeout 30000 --exit --require ts-node/register --require tsconfig-paths/register --bail \ 31 npm run mocha -- -c --timeout 30000 --exit --require ts-node/register --require tsconfig-paths/register --bail \
25 ::: $files 32 ::: $files
33
34 cat "$joblog"
35 rm "$joblog"
26} 36}
27 37
28findTestFiles () { 38findTestFiles () {
@@ -37,14 +47,14 @@ if [ "$1" = "misc" ]; then
37 pluginsFiles=$(findTestFiles server/tests/plugins) 47 pluginsFiles=$(findTestFiles server/tests/plugins)
38 miscFiles="server/tests/client.ts server/tests/misc-endpoints.ts" 48 miscFiles="server/tests/client.ts server/tests/misc-endpoints.ts"
39 49
40 TS_NODE_FILES=true runTest 1 $feedsFiles $helperFiles $pluginsFiles $miscFiles 50 TS_NODE_FILES=true runTest "$1" 1 $feedsFiles $helperFiles $pluginsFiles $miscFiles
41elif [ "$1" = "cli" ]; then 51elif [ "$1" = "cli" ]; then
42 npm run build:server 52 npm run build:server
43 npm run setup:cli 53 npm run setup:cli
44 54
45 cliFiles=$(findTestFiles server/tests/cli) 55 cliFiles=$(findTestFiles server/tests/cli)
46 56
47 runTest 1 $cliFiles 57 runTest "$1" 1 $cliFiles
48elif [ "$1" = "api-1" ]; then 58elif [ "$1" = "api-1" ]; then
49 npm run build:server 59 npm run build:server
50 60
@@ -52,7 +62,7 @@ elif [ "$1" = "api-1" ]; then
52 notificationsFiles=$(findTestFiles server/tests/api/notifications) 62 notificationsFiles=$(findTestFiles server/tests/api/notifications)
53 searchFiles=$(findTestFiles server/tests/api/search) 63 searchFiles=$(findTestFiles server/tests/api/search)
54 64
55 MOCHA_PARALLEL=true runTest 3 $notificationsFiles $searchFiles $checkParamFiles 65 MOCHA_PARALLEL=true runTest "$1" 3 $notificationsFiles $searchFiles $checkParamFiles
56elif [ "$1" = "api-2" ]; then 66elif [ "$1" = "api-2" ]; then
57 npm run build:server 67 npm run build:server
58 68
@@ -60,13 +70,13 @@ elif [ "$1" = "api-2" ]; then
60 usersFiles=$(findTestFiles server/tests/api/users) 70 usersFiles=$(findTestFiles server/tests/api/users)
61 liveFiles=$(findTestFiles server/tests/api/live) 71 liveFiles=$(findTestFiles server/tests/api/live)
62 72
63 MOCHA_PARALLEL=true runTest 3 $serverFiles $usersFiles $liveFiles 73 MOCHA_PARALLEL=true runTest "$1" 3 $serverFiles $usersFiles $liveFiles
64elif [ "$1" = "api-3" ]; then 74elif [ "$1" = "api-3" ]; then
65 npm run build:server 75 npm run build:server
66 76
67 videosFiles=$(findTestFiles server/tests/api/videos) 77 videosFiles=$(findTestFiles server/tests/api/videos)
68 78
69 MOCHA_PARALLEL=true runTest 3 $videosFiles 79 MOCHA_PARALLEL=true runTest "$1" 3 $videosFiles
70elif [ "$1" = "api-4" ]; then 80elif [ "$1" = "api-4" ]; then
71 npm run build:server 81 npm run build:server
72 82
@@ -74,13 +84,13 @@ elif [ "$1" = "api-4" ]; then
74 redundancyFiles=$(findTestFiles server/tests/api/redundancy) 84 redundancyFiles=$(findTestFiles server/tests/api/redundancy)
75 activitypubFiles=$(findTestFiles server/tests/api/activitypub) 85 activitypubFiles=$(findTestFiles server/tests/api/activitypub)
76 86
77 MOCHA_PARALLEL=true TS_NODE_FILES=true runTest 2 $activitypubFiles $redundancyFiles $activitypubFiles 87 MOCHA_PARALLEL=true TS_NODE_FILES=true runTest "$1" 2 $activitypubFiles $redundancyFiles $activitypubFiles
78elif [ "$1" = "external-plugins" ]; then 88elif [ "$1" = "external-plugins" ]; then
79 npm run build:server 89 npm run build:server
80 90
81 externalPluginsFiles=$(findTestFiles server/tests/external-plugins) 91 externalPluginsFiles=$(findTestFiles server/tests/external-plugins)
82 92
83 runTest 1 $externalPluginsFiles 93 runTest "$1" 1 $externalPluginsFiles
84elif [ "$1" = "lint" ]; then 94elif [ "$1" = "lint" ]; then
85 npm run eslint -- --ext .ts "server/**/*.ts" "shared/**/*.ts" "scripts/**/*.ts" 95 npm run eslint -- --ext .ts "server/**/*.ts" "shared/**/*.ts" "scripts/**/*.ts"
86 npm run swagger-cli -- validate support/doc/api/openapi.yaml 96 npm run swagger-cli -- validate support/doc/api/openapi.yaml