]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - scripts/ci.sh
6 echo "Need test suite argument."
23 joblog
="$jobname-ci.log"
25 parallel
-j $jobs --retries $retries \
26 "echo Trying {} >> $joblog; npm run mocha -- -c --timeout 30000 --exit --require ./dist/server/tests/register.js --bail {}" \
29 cat "$joblog" | uniq -c
34 exception
="-not -name index.js"
36 if [ ! -z ${2+x} ]; then
37 exception
="$exception -not -name $2"
40 find $1 -type f
-name "*.js" $exception | xargs echo
43 if [ "$1" = "client" ]; then
46 feedsFiles
=$(findTestFiles ./dist/server/tests/feeds)
47 helperFiles
=$(findTestFiles ./dist/server/tests/helpers)
48 libFiles
=$(findTestFiles ./dist/server/tests/lib)
49 miscFiles
="./dist/server/tests/client.js ./dist/server/tests/misc-endpoints.js"
50 # Not in plugin task, it needs an index.html
51 pluginFiles
="./dist/server/tests/plugins/html-injection.js"
53 MOCHA_PARALLEL
=true runTest
"$1" 2 $feedsFiles $helperFiles $miscFiles $pluginFiles $libFiles
54 elif [ "$1" = "cli-plugin" ]; then
58 pluginsFiles
=$(findTestFiles ./dist/server/tests/plugins html-injection.js)
59 cliFiles
=$(findTestFiles ./dist/server/tests/cli)
61 MOCHA_PARALLEL
=true runTest
"$1" 2 $pluginsFiles
62 runTest
"$1" 1 $cliFiles
63 elif [ "$1" = "api-1" ]; then
66 checkParamFiles
=$(findTestFiles ./dist/server/tests/api/check-params)
67 notificationsFiles
=$(findTestFiles ./dist/server/tests/api/notifications)
68 searchFiles
=$(findTestFiles ./dist/server/tests/api/search)
70 MOCHA_PARALLEL
=true runTest
"$1" 3 $notificationsFiles $searchFiles $checkParamFiles
71 elif [ "$1" = "api-2" ]; then
74 liveFiles
=$(findTestFiles ./dist/server/tests/api/live)
75 serverFiles
=$(findTestFiles ./dist/server/tests/api/server)
76 usersFiles
=$(findTestFiles ./dist/server/tests/api/users)
78 MOCHA_PARALLEL
=true runTest
"$1" 3 $liveFiles $serverFiles $usersFiles
79 elif [ "$1" = "api-3" ]; then
82 videosFiles
=$(findTestFiles ./dist/server/tests/api/videos)
84 MOCHA_PARALLEL
=true runTest
"$1" 3 $videosFiles
85 elif [ "$1" = "api-4" ]; then
88 moderationFiles
=$(findTestFiles ./dist/server/tests/api/moderation)
89 redundancyFiles
=$(findTestFiles ./dist/server/tests/api/redundancy)
90 objectStorageFiles
=$(findTestFiles ./dist/server/tests/api/object-storage)
91 activitypubFiles
=$(findTestFiles ./dist/server/tests/api/activitypub)
93 MOCHA_PARALLEL
=true runTest
"$1" 2 $moderationFiles $redundancyFiles $activitypubFiles $objectStorageFiles
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