]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - scripts/ci.sh
6 echo "Need test suite argument."
10 killall
-q peertube
|| true
25 joblog
="$jobname-ci.log"
27 parallel
-j $jobs --retries $retries \
28 "echo Trying {} >> $joblog; npm run mocha -- -c --timeout 30000 --exit --require ./dist/server/tests/register.js --bail {}" \
31 cat "$joblog" | uniq -c
36 exception
="-not -name index.js"
38 if [ ! -z ${2+x} ]; then
39 exception
="$exception -not -name $2"
42 find $1 -type f
-name "*.js" $exception | xargs echo
45 if [ "$1" = "client" ]; then
48 feedsFiles
=$(findTestFiles ./dist/server/tests/feeds)
49 helperFiles
=$(findTestFiles ./dist/server/tests/helpers)
50 libFiles
=$(findTestFiles ./dist/server/tests/lib)
51 miscFiles
="./dist/server/tests/client.js ./dist/server/tests/misc-endpoints.js"
52 # Not in plugin task, it needs an index.html
53 pluginFiles
="./dist/server/tests/plugins/html-injection.js"
55 MOCHA_PARALLEL
=true runTest
"$1" 2 $feedsFiles $helperFiles $miscFiles $pluginFiles $libFiles
56 elif [ "$1" = "cli-plugin" ]; then
60 pluginsFiles
=$(findTestFiles ./dist/server/tests/plugins html-injection.js)
61 cliFiles
=$(findTestFiles ./dist/server/tests/cli)
63 MOCHA_PARALLEL
=true runTest
"$1" 2 $pluginsFiles
64 runTest
"$1" 1 $cliFiles
65 elif [ "$1" = "api-1" ]; then
68 checkParamFiles
=$(findTestFiles ./dist/server/tests/api/check-params)
69 notificationsFiles
=$(findTestFiles ./dist/server/tests/api/notifications)
70 searchFiles
=$(findTestFiles ./dist/server/tests/api/search)
72 MOCHA_PARALLEL
=true runTest
"$1" 3 $notificationsFiles $searchFiles $checkParamFiles
73 elif [ "$1" = "api-2" ]; then
76 liveFiles
=$(findTestFiles ./dist/server/tests/api/live)
77 serverFiles
=$(findTestFiles ./dist/server/tests/api/server)
78 usersFiles
=$(findTestFiles ./dist/server/tests/api/users)
80 MOCHA_PARALLEL
=true runTest
"$1" 3 $liveFiles $serverFiles $usersFiles
81 elif [ "$1" = "api-3" ]; then
84 videosFiles
=$(findTestFiles ./dist/server/tests/api/videos)
86 MOCHA_PARALLEL
=true runTest
"$1" 3 $videosFiles
87 elif [ "$1" = "api-4" ]; then
90 moderationFiles
=$(findTestFiles ./dist/server/tests/api/moderation)
91 redundancyFiles
=$(findTestFiles ./dist/server/tests/api/redundancy)
92 objectStorageFiles
=$(findTestFiles ./dist/server/tests/api/object-storage)
93 activitypubFiles
=$(findTestFiles ./dist/server/tests/api/activitypub)
95 MOCHA_PARALLEL
=true TS_NODE_FILES
=true runTest
"$1" 2 $moderationFiles $redundancyFiles $activitypubFiles $objectStorageFiles
96 elif [ "$1" = "external-plugins" ]; then
99 externalPluginsFiles
=$(findTestFiles ./dist/server/tests/external-plugins)
101 runTest
"$1" 1 $externalPluginsFiles
102 elif [ "$1" = "lint" ]; then
103 npm run eslint
-- --ext .ts
"./server/**/*.ts" "shared/**/*.ts" "scripts/**/*.ts"
104 npm run swagger
-cli -- validate support
/doc
/api
/openapi.yaml