]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - scripts/ci.sh
6 echo "Need test suite argument."
24 joblog
="$jobname-ci.log"
26 parallel
-j $jobs --retries $retries \
27 "echo Trying {} >> $joblog; npm run mocha -- -c --timeout 30000 --exit --bail {}" \
30 cat "$joblog" | sort | uniq -c
35 exception
="-not -name index.js"
37 if [ ! -z ${2+x} ]; then
38 exception
="$exception -not -name $2"
41 find $1 -type f
-name "*.js" $exception | xargs echo
44 if [ "$1" = "types-package" ]; then
45 npm run generate
-types-package 0.0.0
46 npm run tsc
-- --noEmit --esModuleInterop packages
/types
/tests
/test.ts
47 elif [ "$1" = "client" ]; then
50 feedsFiles
=$(findTestFiles ./dist/server/tests/feeds)
51 helperFiles
=$(findTestFiles ./dist/server/tests/helpers)
52 libFiles
=$(findTestFiles ./dist/server/tests/lib)
53 miscFiles
="./dist/server/tests/client.js ./dist/server/tests/misc-endpoints.js"
54 # Not in their own task, they need an index.html
55 pluginFiles
="./dist/server/tests/plugins/html-injection.js ./dist/server/tests/api/server/plugins.js"
57 MOCHA_PARALLEL
=true runTest
"$1" $((2*$speedFactor)) $feedsFiles $helperFiles $miscFiles $pluginFiles $libFiles
58 elif [ "$1" = "cli-plugin" ]; then
62 pluginsFiles
=$(findTestFiles ./dist/server/tests/plugins html-injection.js)
63 cliFiles
=$(findTestFiles ./dist/server/tests/cli)
65 MOCHA_PARALLEL
=true runTest
"$1" $((2*$speedFactor)) $pluginsFiles
66 runTest
"$1" 1 $cliFiles
67 elif [ "$1" = "api-1" ]; then
70 checkParamFiles
=$(findTestFiles ./dist/server/tests/api/check-params)
71 notificationsFiles
=$(findTestFiles ./dist/server/tests/api/notifications)
72 searchFiles
=$(findTestFiles ./dist/server/tests/api/search)
74 MOCHA_PARALLEL
=true runTest
"$1" $((3*$speedFactor)) $notificationsFiles $searchFiles $checkParamFiles
75 elif [ "$1" = "api-2" ]; then
78 liveFiles
=$(findTestFiles ./dist/server/tests/api/live)
79 serverFiles
=$(findTestFiles ./dist/server/tests/api/server plugins.js)
80 usersFiles
=$(findTestFiles ./dist/server/tests/api/users)
82 MOCHA_PARALLEL
=true runTest
"$1" $((3*$speedFactor)) $liveFiles $serverFiles $usersFiles
83 elif [ "$1" = "api-3" ]; then
86 videosFiles
=$(findTestFiles ./dist/server/tests/api/videos)
87 viewsFiles
=$(findTestFiles ./dist/server/tests/api/views)
89 MOCHA_PARALLEL
=true runTest
"$1" $((3*$speedFactor)) $viewsFiles $videosFiles
90 elif [ "$1" = "api-4" ]; then
93 moderationFiles
=$(findTestFiles ./dist/server/tests/api/moderation)
94 redundancyFiles
=$(findTestFiles ./dist/server/tests/api/redundancy)
95 objectStorageFiles
=$(findTestFiles ./dist/server/tests/api/object-storage)
96 activitypubFiles
=$(findTestFiles ./dist/server/tests/api/activitypub)
98 MOCHA_PARALLEL
=true runTest
"$1" $((2*$speedFactor)) $moderationFiles $redundancyFiles $activitypubFiles $objectStorageFiles
99 elif [ "$1" = "api-5" ]; then
102 transcodingFiles
=$(findTestFiles ./dist/server/tests/api/transcoding)
104 MOCHA_PARALLEL
=true runTest
"$1" $((2*$speedFactor)) $transcodingFiles
105 elif [ "$1" = "external-plugins" ]; then
108 externalPluginsFiles
=$(findTestFiles ./dist/server/tests/external-plugins)
110 runTest
"$1" 1 $externalPluginsFiles
111 elif [ "$1" = "lint" ]; then
112 npm run eslint
-- --ext .ts
"./server/**/*.ts" "shared/**/*.ts" "scripts/**/*.ts"
113 npm run swagger
-cli -- validate support
/doc
/api
/openapi.yaml