]>
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
60 mkdir -p "./client/dist/en-US/"
61 cp "./client/src/index.html" "./client/dist/en-US/index.html"
66 pluginsFiles
=$(findTestFiles ./dist/server/tests/plugins html-injection.js)
67 cliFiles
=$(findTestFiles ./dist/server/tests/cli)
69 MOCHA_PARALLEL
=true runTest
"$1" $((2*$speedFactor)) $pluginsFiles
70 runTest
"$1" 1 $cliFiles
71 elif [ "$1" = "api-1" ]; then
74 checkParamFiles
=$(findTestFiles ./dist/server/tests/api/check-params)
75 notificationsFiles
=$(findTestFiles ./dist/server/tests/api/notifications)
76 searchFiles
=$(findTestFiles ./dist/server/tests/api/search)
78 MOCHA_PARALLEL
=true runTest
"$1" $((3*$speedFactor)) $notificationsFiles $searchFiles $checkParamFiles
79 elif [ "$1" = "api-2" ]; then
82 liveFiles
=$(findTestFiles ./dist/server/tests/api/live)
83 serverFiles
=$(findTestFiles ./dist/server/tests/api/server plugins.js)
84 usersFiles
=$(findTestFiles ./dist/server/tests/api/users)
86 MOCHA_PARALLEL
=true runTest
"$1" $((3*$speedFactor)) $liveFiles $serverFiles $usersFiles
87 elif [ "$1" = "api-3" ]; then
90 videosFiles
=$(findTestFiles ./dist/server/tests/api/videos)
91 viewsFiles
=$(findTestFiles ./dist/server/tests/api/views)
93 MOCHA_PARALLEL
=true runTest
"$1" $((3*$speedFactor)) $viewsFiles $videosFiles
94 elif [ "$1" = "api-4" ]; then
97 moderationFiles
=$(findTestFiles ./dist/server/tests/api/moderation)
98 redundancyFiles
=$(findTestFiles ./dist/server/tests/api/redundancy)
99 objectStorageFiles
=$(findTestFiles ./dist/server/tests/api/object-storage)
100 activitypubFiles
=$(findTestFiles ./dist/server/tests/api/activitypub)
102 MOCHA_PARALLEL
=true runTest
"$1" $((2*$speedFactor)) $moderationFiles $redundancyFiles $activitypubFiles $objectStorageFiles
103 elif [ "$1" = "api-5" ]; then
106 transcodingFiles
=$(findTestFiles ./dist/server/tests/api/transcoding)
107 runnersFiles
=$(findTestFiles ./dist/server/tests/api/runners)
109 MOCHA_PARALLEL
=true runTest
"$1" $((2*$speedFactor)) $transcodingFiles $runnersFiles
110 elif [ "$1" = "external-plugins" ]; then
112 npm run build
:peertube
-runner
114 externalPluginsFiles
=$(findTestFiles ./dist/server/tests/external-plugins)
115 peertubeRunnerFiles
=$(findTestFiles ./dist/server/tests/peertube-runner)
117 runTest
"$1" 1 $externalPluginsFiles $peertubeRunnerFiles
118 elif [ "$1" = "lint" ]; then
119 npm run eslint
-- --ext .ts
"./server/**/*.ts" "shared/**/*.ts" "scripts/**/*.ts"
120 npm run swagger
-cli -- validate support
/doc
/api
/openapi.yaml