]>
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 --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" = "types-package" ]; then
44 npm run generate
-types-package 0.0.0
45 npm run tsc
-- --noEmit --esModuleInterop packages
/types
/tests
/test.ts
46 elif [ "$1" = "client" ]; then
49 feedsFiles
=$(findTestFiles ./dist/server/tests/feeds)
50 helperFiles
=$(findTestFiles ./dist/server/tests/helpers)
51 libFiles
=$(findTestFiles ./dist/server/tests/lib)
52 miscFiles
="./dist/server/tests/client.js ./dist/server/tests/misc-endpoints.js"
53 # Not in plugin task, it needs an index.html
54 pluginFiles
="./dist/server/tests/plugins/html-injection.js"
56 MOCHA_PARALLEL
=true runTest
"$1" 2 $feedsFiles $helperFiles $miscFiles $pluginFiles $libFiles
57 elif [ "$1" = "cli-plugin" ]; then
61 pluginsFiles
=$(findTestFiles ./dist/server/tests/plugins html-injection.js)
62 cliFiles
=$(findTestFiles ./dist/server/tests/cli)
64 MOCHA_PARALLEL
=true runTest
"$1" 2 $pluginsFiles
65 runTest
"$1" 1 $cliFiles
66 elif [ "$1" = "api-1" ]; then
69 checkParamFiles
=$(findTestFiles ./dist/server/tests/api/check-params)
70 notificationsFiles
=$(findTestFiles ./dist/server/tests/api/notifications)
71 searchFiles
=$(findTestFiles ./dist/server/tests/api/search)
73 MOCHA_PARALLEL
=true runTest
"$1" 3 $notificationsFiles $searchFiles $checkParamFiles
74 elif [ "$1" = "api-2" ]; then
77 liveFiles
=$(findTestFiles ./dist/server/tests/api/live)
78 serverFiles
=$(findTestFiles ./dist/server/tests/api/server)
79 usersFiles
=$(findTestFiles ./dist/server/tests/api/users)
81 MOCHA_PARALLEL
=true runTest
"$1" 3 $liveFiles $serverFiles $usersFiles
82 elif [ "$1" = "api-3" ]; then
85 videosFiles
=$(findTestFiles ./dist/server/tests/api/videos)
87 MOCHA_PARALLEL
=true runTest
"$1" 3 $videosFiles
88 elif [ "$1" = "api-4" ]; then
91 moderationFiles
=$(findTestFiles ./dist/server/tests/api/moderation)
92 redundancyFiles
=$(findTestFiles ./dist/server/tests/api/redundancy)
93 objectStorageFiles
=$(findTestFiles ./dist/server/tests/api/object-storage)
94 activitypubFiles
=$(findTestFiles ./dist/server/tests/api/activitypub)
96 MOCHA_PARALLEL
=true runTest
"$1" 2 $moderationFiles $redundancyFiles $activitypubFiles $objectStorageFiles
97 elif [ "$1" = "external-plugins" ]; then
100 externalPluginsFiles
=$(findTestFiles ./dist/server/tests/external-plugins)
102 runTest
"$1" 1 $externalPluginsFiles
103 elif [ "$1" = "lint" ]; then
104 npm run eslint
-- --ext .ts
"./server/**/*.ts" "shared/**/*.ts" "scripts/**/*.ts"
105 npm run swagger
-cli -- validate support
/doc
/api
/openapi.yaml