]>
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 miscFiles
="./dist/server/tests/client.js ./dist/server/tests/misc-endpoints.js"
51 # Not in plugin task, it needs an index.html
52 pluginFiles
="./dist/server/tests/plugins/html-injection.js"
54 MOCHA_PARALLEL
=true runTest
"$1" 2 $feedsFiles $helperFiles $miscFiles $pluginFiles
55 elif [ "$1" = "cli-plugin" ]; then
59 pluginsFiles
=$(findTestFiles ./dist/server/tests/plugins html-injection.js)
60 cliFiles
=$(findTestFiles ./dist/server/tests/cli)
62 MOCHA_PARALLEL
=true runTest
"$1" 2 $pluginsFiles
63 runTest
"$1" 1 $cliFiles
64 elif [ "$1" = "api-1" ]; then
67 checkParamFiles
=$(findTestFiles ./dist/server/tests/api/check-params)
68 notificationsFiles
=$(findTestFiles ./dist/server/tests/api/notifications)
69 searchFiles
=$(findTestFiles ./dist/server/tests/api/search)
71 MOCHA_PARALLEL
=true runTest
"$1" 3 $notificationsFiles $searchFiles $checkParamFiles
72 elif [ "$1" = "api-2" ]; then
75 liveFiles
=$(findTestFiles ./dist/server/tests/api/live)
76 serverFiles
=$(findTestFiles ./dist/server/tests/api/server)
77 usersFiles
=$(findTestFiles ./dist/server/tests/api/users)
79 MOCHA_PARALLEL
=true runTest
"$1" 3 $serverFiles $usersFiles $liveFiles
80 elif [ "$1" = "api-3" ]; then
83 videosFiles
=$(findTestFiles ./dist/server/tests/api/videos)
85 MOCHA_PARALLEL
=true runTest
"$1" 3 $videosFiles
86 elif [ "$1" = "api-4" ]; then
89 moderationFiles
=$(findTestFiles ./dist/server/tests/api/moderation)
90 redundancyFiles
=$(findTestFiles ./dist/server/tests/api/redundancy)
91 activitypubFiles
=$(findTestFiles ./dist/server/tests/api/activitypub)
93 MOCHA_PARALLEL
=true TS_NODE_FILES
=true runTest
"$1" 2 $moderationFiles $redundancyFiles $activitypubFiles
94 elif [ "$1" = "external-plugins" ]; then
97 externalPluginsFiles
=$(findTestFiles ./dist/server/tests/external-plugins)
99 runTest
"$1" 1 $externalPluginsFiles
100 elif [ "$1" = "lint" ]; then
101 npm run eslint
-- --ext .ts
"./server/**/*.ts" "shared/**/*.ts" "scripts/**/*.ts"
102 npm run swagger
-cli -- validate support
/doc
/api
/openapi.yaml