run-tests.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. # Make sure typeorm is available.. it get removed when yarn is run again
  8. # typeorm commandline is used by db:migrate step below.
  9. ln -s ../../../../../node_modules/typeorm/cli.js generated/graphql-server/node_modules/.bin/typeorm || :
  10. set -a
  11. . ../.env
  12. set +a
  13. # Clean start
  14. docker-compose down -v
  15. function cleanup() {
  16. # Show tail end of logs for the processor and indexer containers to
  17. # see any possible errors
  18. (echo "## Processor Logs ##" && docker logs joystream_processor_1 --tail 50) || :
  19. (echo "## Indexer Logs ##" && docker logs joystream_indexer_1 --tail 50) || :
  20. (echo "## Indexer API Gateway Logs ##" && docker logs joystream_indexer-api-gateway_1 --tail 50) || :
  21. docker-compose down -v
  22. }
  23. trap cleanup EXIT
  24. # Bring up db
  25. docker-compose up -d db
  26. # Migrate the databases
  27. yarn workspace query-node-root db:migrate
  28. docker-compose up -d graphql-server
  29. # Start the joystream-node before the indexer
  30. docker-compose up -d joystream-node
  31. # Starting up processor will bring up all services it depends on
  32. docker-compose up -d processor
  33. time yarn workspace network-tests run-test-scenario content-directory