run-tests.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/usr/bin/env bash
  2. set -e
  3. SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
  4. cd $SCRIPT_PATH
  5. # Only run codegen if no generated files found
  6. [ ! -d "generated/" ] && yarn build
  7. set -a
  8. . ../.env
  9. set +a
  10. # Clean start
  11. docker-compose down -v
  12. function cleanup() {
  13. # Show tail end of logs for the processor and indexer containers to
  14. # see any possible errors
  15. (echo "## Processor Logs ##" && docker logs joystream_processor_1 --tail 50) || :
  16. (echo "## Indexer Logs ##" && docker logs joystream_indexer_1 --tail 50) || :
  17. (echo "## Indexer API Gateway Logs ##" && docker logs joystream_hydra-indexer-gateway_1 --tail 50) || :
  18. (echo "## Graphql Server Logs ##" && docker logs joystream_graphql-server_1 --tail 50) || :
  19. docker-compose down -v
  20. }
  21. trap cleanup EXIT
  22. # Bring up db
  23. docker-compose up -d db
  24. # Migrate the databases
  25. yarn workspace query-node-root db:prepare
  26. yarn workspace query-node-root db:migrate
  27. docker-compose up -d graphql-server
  28. # Start the joystream-node before the indexer
  29. docker-compose up -d joystream-node
  30. # Starting up processor will bring up all services it depends on
  31. docker-compose up -d processor
  32. time yarn workspace network-tests run-test-scenario content-directory