]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - scripts/ci.sh
6 echo "Need test suite argument."
10 killall
-q peertube
|| true
28 joblog
="$jobname-ci.log"
30 parallel
-j $jobs --retries $retries \
31 "echo Trying {} >> $joblog; npm run mocha -- -c --timeout 30000 --exit --require ts-node/register --require tsconfig-paths/register --bail {}" \
34 cat "$joblog" | uniq -c
39 find $1 -type f
-name "*.ts" | grep -v "/index.ts" | xargs echo
42 if [ "$1" = "misc" ]; then
45 feedsFiles
=$(findTestFiles server/tests/feeds)
46 helperFiles
=$(findTestFiles server/tests/helpers)
47 pluginsFiles
=$(findTestFiles server/tests/plugins)
48 miscFiles
="server/tests/client.ts server/tests/misc-endpoints.ts"
50 TS_NODE_FILES
=true runTest
"$1" 1 $feedsFiles $helperFiles $pluginsFiles $miscFiles
51 elif [ "$1" = "cli" ]; then
55 cliFiles
=$(findTestFiles server/tests/cli)
57 runTest
"$1" 1 $cliFiles
58 elif [ "$1" = "api-1" ]; then
61 checkParamFiles
=$(findTestFiles server/tests/api/check-params)
62 notificationsFiles
=$(findTestFiles server/tests/api/notifications)
63 searchFiles
=$(findTestFiles server/tests/api/search)
65 MOCHA_PARALLEL
=true runTest
"$1" 3 $notificationsFiles $searchFiles $checkParamFiles
66 elif [ "$1" = "api-2" ]; then
69 serverFiles
=$(findTestFiles server/tests/api/server)
70 usersFiles
=$(findTestFiles server/tests/api/users)
71 liveFiles
=$(findTestFiles server/tests/api/live)
73 MOCHA_PARALLEL
=true runTest
"$1" 3 $serverFiles $usersFiles $liveFiles
74 elif [ "$1" = "api-3" ]; then
77 videosFiles
=$(findTestFiles server/tests/api/videos)
79 MOCHA_PARALLEL
=true runTest
"$1" 3 $videosFiles
80 elif [ "$1" = "api-4" ]; then
83 activitypubFiles
=$(findTestFiles server/tests/api/moderation)
84 redundancyFiles
=$(findTestFiles server/tests/api/redundancy)
85 activitypubFiles
=$(findTestFiles server/tests/api/activitypub)
87 MOCHA_PARALLEL
=true TS_NODE_FILES
=true runTest
"$1" 2 $activitypubFiles $redundancyFiles $activitypubFiles
88 elif [ "$1" = "external-plugins" ]; then
91 externalPluginsFiles
=$(findTestFiles server/tests/external-plugins)
93 runTest
"$1" 1 $externalPluginsFiles
94 elif [ "$1" = "lint" ]; then
95 npm run eslint
-- --ext .ts
"server/**/*.ts" "shared/**/*.ts" "scripts/**/*.ts"
96 npm run swagger
-cli -- validate support
/doc
/api
/openapi.yaml