ci.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/sh
  2. set -eu
  3. if [ $# -eq 0 ]; then
  4. echo "Need test suite argument."
  5. exit -1
  6. fi
  7. killall -q peertube || true
  8. perl -0777 -i -pe 's#proxy:(\n\s+)enabled: false\n\s+url: ""#proxy:$1enabled: true$1url: "http://188.165.225.149:7899"#' config/test.yaml
  9. if [ "$1" = "misc" ]; then
  10. npm run build -- --light
  11. mocha --timeout 5000 --exit --require ts-node/register --require tsconfig-paths/register --bail server/tests/client.ts \
  12. server/tests/feeds/index.ts \
  13. server/tests/misc-endpoints.ts \
  14. server/tests/helpers/index.ts \
  15. server/tests/plugins/index.ts
  16. elif [ "$1" = "cli" ]; then
  17. npm run build:server
  18. CC=gcc-4.9 CXX=g++-4.9 npm run setup:cli
  19. mocha --timeout 5000 --exit --require ts-node/register --require tsconfig-paths/register --bail server/tests/cli/index.ts
  20. elif [ "$1" = "api-1" ]; then
  21. npm run build:server
  22. sh ./server/tests/api/ci-1.sh 2
  23. elif [ "$1" = "api-2" ]; then
  24. npm run build:server
  25. sh ./server/tests/api/ci-2.sh 2
  26. elif [ "$1" = "api-3" ]; then
  27. npm run build:server
  28. sh ./server/tests/api/ci-3.sh 2
  29. elif [ "$1" = "api-4" ]; then
  30. npm run build:server
  31. sh ./server/tests/api/ci-4.sh 2
  32. elif [ "$1" = "lint" ]; then
  33. npm run tslint -- --project ./tsconfig.json -c ./tslint.json server.ts "server/**/*.ts" "shared/**/*.ts"
  34. npm run swagger-cli -- validate support/doc/api/openapi.yaml
  35. ( cd client
  36. npm run lint
  37. )
  38. fi
  39. git checkout -- config/test.yaml