aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/ci.sh40
1 files changed, 20 insertions, 20 deletions
diff --git a/scripts/ci.sh b/scripts/ci.sh
index f4a200a00..7360a03ce 100755
--- a/scripts/ci.sh
+++ b/scripts/ci.sh
@@ -25,7 +25,7 @@ runTest () {
25 joblog="$jobname-ci.log" 25 joblog="$jobname-ci.log"
26 26
27 parallel -j $jobs --retries $retries \ 27 parallel -j $jobs --retries $retries \
28 "echo Trying {} >> $joblog; npm run mocha -- -c --timeout 30000 --exit --require ts-node/register --require tsconfig-paths/register --bail {}" \ 28 "echo Trying {} >> $joblog; npm run mocha -- -c --timeout 30000 --exit --require ./dist/server/tests/register.js --bail {}" \
29 ::: $files 29 ::: $files
30 30
31 cat "$joblog" | uniq -c 31 cat "$joblog" | uniq -c
@@ -33,63 +33,63 @@ runTest () {
33} 33}
34 34
35findTestFiles () { 35findTestFiles () {
36 find $1 -type f -name "*.ts" | grep -v "/index.ts" | xargs echo 36 find $1 -type f -name "*.js" | grep -v "/index.js" | xargs echo
37} 37}
38 38
39if [ "$1" = "misc" ]; then 39if [ "$1" = "misc" ]; then
40 npm run build 40 npm run build
41 41
42 feedsFiles=$(findTestFiles server/tests/feeds) 42 feedsFiles=$(findTestFiles ./dist/server/tests/feeds)
43 helperFiles=$(findTestFiles server/tests/helpers) 43 helperFiles=$(findTestFiles ./dist/server/tests/helpers)
44 pluginsFiles=$(findTestFiles server/tests/plugins) 44 pluginsFiles=$(findTestFiles ./dist/server/tests/plugins)
45 miscFiles="server/tests/client.ts server/tests/misc-endpoints.ts" 45 miscFiles="./dist/server/tests/client.js ./dist/server/tests/misc-endpoints.js"
46 46
47 MOCHA_PARALLEL=true TS_NODE_FILES=true runTest "$1" 2 $feedsFiles $helperFiles $pluginsFiles $miscFiles 47 MOCHA_PARALLEL=true runTest "$1" 2 $feedsFiles $helperFiles $pluginsFiles $miscFiles
48elif [ "$1" = "cli" ]; then 48elif [ "$1" = "cli" ]; then
49 npm run build:server 49 npm run build:server
50 npm run setup:cli 50 npm run setup:cli
51 51
52 cliFiles=$(findTestFiles server/tests/cli) 52 cliFiles=$(findTestFiles ./dist/server/tests/cli)
53 53
54 runTest "$1" 1 $cliFiles 54 runTest "$1" 1 $cliFiles
55elif [ "$1" = "api-1" ]; then 55elif [ "$1" = "api-1" ]; then
56 npm run build:server 56 npm run build:server
57 57
58 checkParamFiles=$(findTestFiles server/tests/api/check-params) 58 checkParamFiles=$(findTestFiles ./dist/server/tests/api/check-params)
59 notificationsFiles=$(findTestFiles server/tests/api/notifications) 59 notificationsFiles=$(findTestFiles ./dist/server/tests/api/notifications)
60 searchFiles=$(findTestFiles server/tests/api/search) 60 searchFiles=$(findTestFiles ./dist/server/tests/api/search)
61 61
62 MOCHA_PARALLEL=true runTest "$1" 3 $notificationsFiles $searchFiles $checkParamFiles 62 MOCHA_PARALLEL=true runTest "$1" 3 $notificationsFiles $searchFiles $checkParamFiles
63elif [ "$1" = "api-2" ]; then 63elif [ "$1" = "api-2" ]; then
64 npm run build:server 64 npm run build:server
65 65
66 serverFiles=$(findTestFiles server/tests/api/server) 66 serverFiles=$(findTestFiles ./dist/server/tests/api/server)
67 usersFiles=$(findTestFiles server/tests/api/users) 67 usersFiles=$(findTestFiles ./dist/server/tests/api/users)
68 liveFiles=$(findTestFiles server/tests/api/live) 68 liveFiles=$(findTestFiles ./dist/server/tests/api/live)
69 69
70 MOCHA_PARALLEL=true runTest "$1" 3 $serverFiles $usersFiles $liveFiles 70 MOCHA_PARALLEL=true runTest "$1" 3 $serverFiles $usersFiles $liveFiles
71elif [ "$1" = "api-3" ]; then 71elif [ "$1" = "api-3" ]; then
72 npm run build:server 72 npm run build:server
73 73
74 videosFiles=$(findTestFiles server/tests/api/videos) 74 videosFiles=$(findTestFiles ./dist/server/tests/api/videos)
75 75
76 MOCHA_PARALLEL=true runTest "$1" 3 $videosFiles 76 MOCHA_PARALLEL=true runTest "$1" 3 $videosFiles
77elif [ "$1" = "api-4" ]; then 77elif [ "$1" = "api-4" ]; then
78 npm run build:server 78 npm run build:server
79 79
80 moderationFiles=$(findTestFiles server/tests/api/moderation) 80 moderationFiles=$(findTestFiles ./dist/server/tests/api/moderation)
81 redundancyFiles=$(findTestFiles server/tests/api/redundancy) 81 redundancyFiles=$(findTestFiles ./dist/server/tests/api/redundancy)
82 activitypubFiles=$(findTestFiles server/tests/api/activitypub) 82 activitypubFiles=$(findTestFiles ./dist/server/tests/api/activitypub)
83 83
84 MOCHA_PARALLEL=true TS_NODE_FILES=true runTest "$1" 2 $moderationFiles $redundancyFiles $activitypubFiles 84 MOCHA_PARALLEL=true TS_NODE_FILES=true runTest "$1" 2 $moderationFiles $redundancyFiles $activitypubFiles
85elif [ "$1" = "external-plugins" ]; then 85elif [ "$1" = "external-plugins" ]; then
86 npm run build:server 86 npm run build:server
87 87
88 externalPluginsFiles=$(findTestFiles server/tests/external-plugins) 88 externalPluginsFiles=$(findTestFiles ./dist/server/tests/external-plugins)
89 89
90 runTest "$1" 1 $externalPluginsFiles 90 runTest "$1" 1 $externalPluginsFiles
91elif [ "$1" = "lint" ]; then 91elif [ "$1" = "lint" ]; then
92 npm run eslint -- --ext .ts "server/**/*.ts" "shared/**/*.ts" "scripts/**/*.ts" 92 npm run eslint -- --ext .ts "./server/**/*.ts" "shared/**/*.ts" "scripts/**/*.ts"
93 npm run swagger-cli -- validate support/doc/api/openapi.yaml 93 npm run swagger-cli -- validate support/doc/api/openapi.yaml
94 94
95 ( cd client 95 ( cd client