diff options
Diffstat (limited to 'scripts/ci.sh')
-rwxr-xr-x | scripts/ci.sh | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/scripts/ci.sh b/scripts/ci.sh index b068deeb4..07e37e0ee 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh | |||
@@ -33,24 +33,33 @@ runTest () { | |||
33 | } | 33 | } |
34 | 34 | ||
35 | findTestFiles () { | 35 | findTestFiles () { |
36 | find $1 -type f -name "*.js" | grep -v "/index.js" | xargs echo | 36 | exception="-not -name index.js" |
37 | |||
38 | if [ ! -z ${2+x} ]; then | ||
39 | exception="$exception -not -name $2" | ||
40 | fi | ||
41 | |||
42 | find $1 -type f -name "*.js" $exception | xargs echo | ||
37 | } | 43 | } |
38 | 44 | ||
39 | if [ "$1" = "misc" ]; then | 45 | if [ "$1" = "client" ]; then |
40 | npm run build | 46 | npm run build |
41 | 47 | ||
42 | feedsFiles=$(findTestFiles ./dist/server/tests/feeds) | 48 | feedsFiles=$(findTestFiles ./dist/server/tests/feeds) |
43 | helperFiles=$(findTestFiles ./dist/server/tests/helpers) | 49 | helperFiles=$(findTestFiles ./dist/server/tests/helpers) |
44 | pluginsFiles=$(findTestFiles ./dist/server/tests/plugins) | ||
45 | miscFiles="./dist/server/tests/client.js ./dist/server/tests/misc-endpoints.js" | 50 | miscFiles="./dist/server/tests/client.js ./dist/server/tests/misc-endpoints.js" |
51 | # Not in plugin task, it needs an index.html | ||
52 | pluginFiles="./dist/server/tests/plugins/html-injection.js" | ||
46 | 53 | ||
47 | MOCHA_PARALLEL=true runTest "$1" 2 $feedsFiles $helperFiles $pluginsFiles $miscFiles | 54 | MOCHA_PARALLEL=true runTest "$1" 2 $feedsFiles $helperFiles $miscFiles $pluginFiles |
48 | elif [ "$1" = "cli" ]; then | 55 | elif [ "$1" = "cli-plugin" ]; then |
49 | npm run build:server | 56 | npm run build:server |
50 | npm run setup:cli | 57 | npm run setup:cli |
51 | 58 | ||
59 | pluginsFiles=$(findTestFiles ./dist/server/tests/plugins html-injection.js) | ||
52 | cliFiles=$(findTestFiles ./dist/server/tests/cli) | 60 | cliFiles=$(findTestFiles ./dist/server/tests/cli) |
53 | 61 | ||
62 | MOCHA_PARALLEL=true runTest "$1" 2 $pluginsFiles | ||
54 | runTest "$1" 1 $cliFiles | 63 | runTest "$1" 1 $cliFiles |
55 | elif [ "$1" = "api-1" ]; then | 64 | elif [ "$1" = "api-1" ]; then |
56 | npm run build:server | 65 | npm run build:server |