X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=scripts%2Fci.sh;h=a45f91a6b3429d44ca8b4a693468851addb97ed3;hb=6afc0d374cbb7c87c095eaa3235e1e83134c0337;hp=71b1be53b78e39db3ee00f4879de3a51d5c94aef;hpb=421ff4618da64f0849353383f690a014024c40da;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/ci.sh b/scripts/ci.sh index 71b1be53b..a45f91a6b 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -7,9 +7,8 @@ if [ $# -eq 0 ]; then exit -1 fi -killall -q peertube || true - retries=3 +speedFactor="${2:-1}" runTest () { jobname=$1 @@ -25,7 +24,7 @@ runTest () { joblog="$jobname-ci.log" parallel -j $jobs --retries $retries \ - "echo Trying {} >> $joblog; npm run mocha -- -c --timeout 30000 --exit --require ./dist/server/tests/register.js --bail {}" \ + "echo Trying {} >> $joblog; npm run mocha -- -c --timeout 30000 --exit --bail {}" \ ::: $files cat "$joblog" | uniq -c @@ -42,17 +41,20 @@ findTestFiles () { find $1 -type f -name "*.js" $exception | xargs echo } -if [ "$1" = "client" ]; then +if [ "$1" = "types-package" ]; then + npm run generate-types-package 0.0.0 + npm run tsc -- --noEmit --esModuleInterop packages/types/tests/test.ts +elif [ "$1" = "client" ]; then npm run build feedsFiles=$(findTestFiles ./dist/server/tests/feeds) helperFiles=$(findTestFiles ./dist/server/tests/helpers) libFiles=$(findTestFiles ./dist/server/tests/lib) miscFiles="./dist/server/tests/client.js ./dist/server/tests/misc-endpoints.js" - # Not in plugin task, it needs an index.html - pluginFiles="./dist/server/tests/plugins/html-injection.js" + # Not in their own task, they need an index.html + pluginFiles="./dist/server/tests/plugins/html-injection.js ./dist/server/tests/api/server/plugins.js" - MOCHA_PARALLEL=true runTest "$1" 2 $feedsFiles $helperFiles $miscFiles $pluginFiles $libFiles + MOCHA_PARALLEL=true runTest "$1" $((2*$speedFactor)) $feedsFiles $helperFiles $miscFiles $pluginFiles $libFiles elif [ "$1" = "cli-plugin" ]; then npm run build:server npm run setup:cli @@ -60,7 +62,7 @@ elif [ "$1" = "cli-plugin" ]; then pluginsFiles=$(findTestFiles ./dist/server/tests/plugins html-injection.js) cliFiles=$(findTestFiles ./dist/server/tests/cli) - MOCHA_PARALLEL=true runTest "$1" 2 $pluginsFiles + MOCHA_PARALLEL=true runTest "$1" $((2*$speedFactor)) $pluginsFiles runTest "$1" 1 $cliFiles elif [ "$1" = "api-1" ]; then npm run build:server @@ -69,29 +71,36 @@ elif [ "$1" = "api-1" ]; then notificationsFiles=$(findTestFiles ./dist/server/tests/api/notifications) searchFiles=$(findTestFiles ./dist/server/tests/api/search) - MOCHA_PARALLEL=true runTest "$1" 3 $notificationsFiles $searchFiles $checkParamFiles + MOCHA_PARALLEL=true runTest "$1" $((3*$speedFactor)) $notificationsFiles $searchFiles $checkParamFiles elif [ "$1" = "api-2" ]; then npm run build:server liveFiles=$(findTestFiles ./dist/server/tests/api/live) - serverFiles=$(findTestFiles ./dist/server/tests/api/server) + serverFiles=$(findTestFiles ./dist/server/tests/api/server plugins.js) usersFiles=$(findTestFiles ./dist/server/tests/api/users) - MOCHA_PARALLEL=true runTest "$1" 3 $liveFiles $serverFiles $usersFiles + MOCHA_PARALLEL=true runTest "$1" $((3*$speedFactor)) $liveFiles $serverFiles $usersFiles elif [ "$1" = "api-3" ]; then npm run build:server videosFiles=$(findTestFiles ./dist/server/tests/api/videos) - MOCHA_PARALLEL=true runTest "$1" 3 $videosFiles + MOCHA_PARALLEL=true runTest "$1" $((3*$speedFactor)) $videosFiles elif [ "$1" = "api-4" ]; then npm run build:server moderationFiles=$(findTestFiles ./dist/server/tests/api/moderation) redundancyFiles=$(findTestFiles ./dist/server/tests/api/redundancy) + objectStorageFiles=$(findTestFiles ./dist/server/tests/api/object-storage) activitypubFiles=$(findTestFiles ./dist/server/tests/api/activitypub) - MOCHA_PARALLEL=true TS_NODE_FILES=true runTest "$1" 2 $moderationFiles $redundancyFiles $activitypubFiles + MOCHA_PARALLEL=true runTest "$1" $((2*$speedFactor)) $moderationFiles $redundancyFiles $activitypubFiles $objectStorageFiles +elif [ "$1" = "api-5" ]; then + npm run build:server + + transcodingFiles=$(findTestFiles ./dist/server/tests/api/transcoding) + + MOCHA_PARALLEL=true runTest "$1" $((2*$speedFactor)) $transcodingFiles elif [ "$1" = "external-plugins" ]; then npm run build:server