Display job log in ci

pull/3467/head
Chocobozzz 2020-12-10 16:06:09 +01:00 committed by Chocobozzz
parent e078371807
commit 17ae86e912
1 changed files with 18 additions and 8 deletions

View File

@ -14,15 +14,25 @@ jobs=2
runTest () { runTest () {
retries=3 retries=3
jobname=$1
shift
jobs=$1 jobs=$1
shift shift
files=$@ files=$@
echo $files echo $files
parallel -t -j $jobs --retries $retries \ joblog="$jobname-ci.log"
parallel -t -j $jobs --retries $retries --joblog "$joblog" \
npm run mocha -- -c --timeout 30000 --exit --require ts-node/register --require tsconfig-paths/register --bail \ npm run mocha -- -c --timeout 30000 --exit --require ts-node/register --require tsconfig-paths/register --bail \
::: $files ::: $files
cat "$joblog"
rm "$joblog"
} }
findTestFiles () { findTestFiles () {
@ -37,14 +47,14 @@ if [ "$1" = "misc" ]; then
pluginsFiles=$(findTestFiles server/tests/plugins) pluginsFiles=$(findTestFiles server/tests/plugins)
miscFiles="server/tests/client.ts server/tests/misc-endpoints.ts" miscFiles="server/tests/client.ts server/tests/misc-endpoints.ts"
TS_NODE_FILES=true runTest 1 $feedsFiles $helperFiles $pluginsFiles $miscFiles TS_NODE_FILES=true runTest "$1" 1 $feedsFiles $helperFiles $pluginsFiles $miscFiles
elif [ "$1" = "cli" ]; then elif [ "$1" = "cli" ]; then
npm run build:server npm run build:server
npm run setup:cli npm run setup:cli
cliFiles=$(findTestFiles server/tests/cli) cliFiles=$(findTestFiles server/tests/cli)
runTest 1 $cliFiles runTest "$1" 1 $cliFiles
elif [ "$1" = "api-1" ]; then elif [ "$1" = "api-1" ]; then
npm run build:server npm run build:server
@ -52,7 +62,7 @@ elif [ "$1" = "api-1" ]; then
notificationsFiles=$(findTestFiles server/tests/api/notifications) notificationsFiles=$(findTestFiles server/tests/api/notifications)
searchFiles=$(findTestFiles server/tests/api/search) searchFiles=$(findTestFiles server/tests/api/search)
MOCHA_PARALLEL=true runTest 3 $notificationsFiles $searchFiles $checkParamFiles MOCHA_PARALLEL=true runTest "$1" 3 $notificationsFiles $searchFiles $checkParamFiles
elif [ "$1" = "api-2" ]; then elif [ "$1" = "api-2" ]; then
npm run build:server npm run build:server
@ -60,13 +70,13 @@ elif [ "$1" = "api-2" ]; then
usersFiles=$(findTestFiles server/tests/api/users) usersFiles=$(findTestFiles server/tests/api/users)
liveFiles=$(findTestFiles server/tests/api/live) liveFiles=$(findTestFiles server/tests/api/live)
MOCHA_PARALLEL=true runTest 3 $serverFiles $usersFiles $liveFiles MOCHA_PARALLEL=true runTest "$1" 3 $serverFiles $usersFiles $liveFiles
elif [ "$1" = "api-3" ]; then elif [ "$1" = "api-3" ]; then
npm run build:server npm run build:server
videosFiles=$(findTestFiles server/tests/api/videos) videosFiles=$(findTestFiles server/tests/api/videos)
MOCHA_PARALLEL=true runTest 3 $videosFiles MOCHA_PARALLEL=true runTest "$1" 3 $videosFiles
elif [ "$1" = "api-4" ]; then elif [ "$1" = "api-4" ]; then
npm run build:server npm run build:server
@ -74,13 +84,13 @@ elif [ "$1" = "api-4" ]; then
redundancyFiles=$(findTestFiles server/tests/api/redundancy) redundancyFiles=$(findTestFiles server/tests/api/redundancy)
activitypubFiles=$(findTestFiles server/tests/api/activitypub) activitypubFiles=$(findTestFiles server/tests/api/activitypub)
MOCHA_PARALLEL=true TS_NODE_FILES=true runTest 2 $activitypubFiles $redundancyFiles $activitypubFiles MOCHA_PARALLEL=true TS_NODE_FILES=true runTest "$1" 2 $activitypubFiles $redundancyFiles $activitypubFiles
elif [ "$1" = "external-plugins" ]; then elif [ "$1" = "external-plugins" ]; then
npm run build:server npm run build:server
externalPluginsFiles=$(findTestFiles server/tests/external-plugins) externalPluginsFiles=$(findTestFiles server/tests/external-plugins)
runTest 1 $externalPluginsFiles runTest "$1" 1 $externalPluginsFiles
elif [ "$1" = "lint" ]; then elif [ "$1" = "lint" ]; then
npm run eslint -- --ext .ts "server/**/*.ts" "shared/**/*.ts" "scripts/**/*.ts" npm run eslint -- --ext .ts "server/**/*.ts" "shared/**/*.ts" "scripts/**/*.ts"
npm run swagger-cli -- validate support/doc/api/openapi.yaml npm run swagger-cli -- validate support/doc/api/openapi.yaml