X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Ftravis.sh;h=ae4a9f9260e0bbf4e7f11565d8bf2764d9107ceb;hb=e280dd0681440d05269d9aa54904d62064f2fa39;hp=a3e065d4746f5a42bc2dbfdbf574a843e4fcf6c5;hpb=c710f90a36f09cdaed1728e12b9ee455e9c850e7;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/travis.sh b/scripts/travis.sh index a3e065d47..ae4a9f926 100755 --- a/scripts/travis.sh +++ b/scripts/travis.sh @@ -1,29 +1,47 @@ -#!/bin/bash +#!/bin/sh + +set -eu if [ $# -eq 0 ]; then echo "Need test suite argument." exit -1 fi +killall -q peertube || true + if [ "$1" = "misc" ]; then - npm run build - mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/client.ts server/tests/activitypub.ts + npm run build -- --light-fr + mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/client.ts \ + server/tests/activitypub.ts \ + server/tests/feeds/index.ts \ + server/tests/misc-endpoints.ts \ + server/tests/helpers/index.ts elif [ "$1" = "api" ]; then npm run build:server mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/api/index.ts elif [ "$1" = "cli" ]; then npm run build:server mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/cli/index.ts -elif [ "$1" = "api-fast" ]; then +elif [ "$1" = "api-1" ]; then + npm run build:server + mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/api/index-1.ts +elif [ "$1" = "api-2" ]; then + npm run build:server + mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/api/index-2.ts +elif [ "$1" = "api-3" ]; then npm run build:server - mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/api/index-fast.ts -elif [ "$1" = "api-slow" ]; then + mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/api/index-3.ts +elif [ "$1" = "api-3" ]; then npm run build:server - mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/api/index-slow.ts + mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/api/index-4.ts elif [ "$1" = "lint" ]; then - cd client || exit -1 - npm run lint || exit -1 + npm run tslint -- --project ./tsconfig.json -c ./tslint.json server.ts "server/**/*.ts" "shared/**/*.ts" - cd .. || exit -1 - npm run tslint -- --project ./tsconfig.json -c ./tslint.json server.ts "server/**/*.ts" || exit -1 + ( cd client + npm run lint + ) +elif [ "$1" = "jest" ]; then + ( cd client + npm run test + ) fi