run-tests.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/usr/bin/env bash
  2. set -e
  3. SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
  4. cd $SCRIPT_PATH
  5. set -a
  6. . ../.env
  7. set +a
  8. export JOYSTREAM_NODE_TAG=${JOYSTREAM_NODE_TAG:=$(../scripts/runtime-code-shasum.sh)}
  9. function cleanup() {
  10. # Show tail end of logs for the processor and indexer containers to
  11. # see any possible errors
  12. (echo "\n\n## Processor Logs ##" && docker logs processor --tail 50) || :
  13. (echo "\n\n## Indexer Logs ##" && docker logs indexer --tail 50) || :
  14. (echo "\n\n## Indexer API Gateway Logs ##" && docker logs hydra-indexer-gateway --tail 50) || :
  15. (echo "\n\n## Graphql Server Logs ##" && docker logs graphql-server --tail 50) || :
  16. docker-compose down -v
  17. }
  18. trap cleanup EXIT
  19. # Clean start
  20. docker-compose down -v
  21. docker-compose -f ../docker-compose.yml up -d joystream-node
  22. ./start.sh
  23. ../tests/network-tests/start-storage.sh
  24. export REUSE_KEYS=true
  25. # pass the scenario name without .ts extension
  26. SCENARIO=$1
  27. # fallback if scenario if not specified
  28. SCENARIO=${SCENARIO:="content-directory"}
  29. time yarn workspace network-tests run-test-scenario ${SCENARIO}