run-storage-node-tests.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/usr/bin/env bash
  2. set -e
  3. # SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
  4. # cd $SCRIPT_PATH
  5. function cleanup() {
  6. # Show tail end of logs for the processor and indexer containers to
  7. # see any possible errors
  8. (echo "## Processor Logs ##" && docker logs joystream_processor_1 --tail 50) || :
  9. (echo "## Indexer Logs ##" && docker logs joystream_indexer_1 --tail 50) || :
  10. docker-compose down -v
  11. }
  12. trap cleanup EXIT
  13. export WS_PROVIDER_ENDPOINT_URI=ws://joystream-node:9944/
  14. # Only run codegen if no generated files found
  15. [ ! -d "query-node/generated/" ] && yarn workspace query-node-root build
  16. # Make sure typeorm is available.. it get removed again when yarn is run again
  17. # typeorm commandline is used by db:migrate step below.
  18. ln -s ../../../../../node_modules/typeorm/cli.js query-node/generated/graphql-server/node_modules/.bin/typeorm || :
  19. # clean start
  20. docker-compose down -v
  21. docker-compose up -d joystream-node
  22. # Storage node
  23. DEBUG=joystream:storage-cli:dev yarn storage-cli dev-init
  24. docker-compose up -d colossus
  25. docker-compose up -d db
  26. yarn workspace query-node-root db:migrate
  27. docker-compose up -d graphql-server
  28. # Starting up processor will bring up all services it depends on
  29. docker-compose up -d processor
  30. yarn workspace @joystream/cd-schemas initialize:dev
  31. # Fixes Error: No active storage providers available
  32. sleep 1m
  33. echo "Creating channel..."
  34. yarn joystream-cli media:createChannel \
  35. --input ./tests/network-tests/assets/TestChannel.json --confirm
  36. echo "Uploading video..."
  37. yes | yarn joystream-cli media:uploadVideo ./tests/network-tests/assets/joystream.MOV \
  38. --input ./tests/network-tests/assets/TestVideo.json \
  39. --confirm
  40. time DEBUG=* yarn workspace network-tests test-run src/scenarios/storage-node.ts