run-full-tests.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/usr/bin/env bash
  2. set -e
  3. SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
  4. cd $SCRIPT_PATH
  5. CONTAINER_ID=$(./run-test-node-docker.sh)
  6. function cleanup() {
  7. docker logs ${CONTAINER_ID} --tail 15
  8. docker-compose -f ../../docker-compose.yml down -v
  9. }
  10. trap cleanup EXIT
  11. sleep 3
  12. # Display runtime version
  13. yarn workspace api-scripts tsnode-strict src/status.ts | grep Runtime
  14. # Start any other services we want
  15. # docker-compose -f ../../docker-compose.yml up -d colossus-1
  16. # Start a query-node
  17. ../../query-node/start.sh
  18. # Run proposals tests first, since they require no leads hired
  19. ./run-test-scenario.sh proposals
  20. # Setup storage & distribution
  21. HOST_IP=$(./get-host-ip.sh)
  22. # Because proposals tests hire and then fire each lead,
  23. # we need to override COLOSSUS_1_WORKER_ID (0 => 1) and DISTRIBUTOR_1_WORKER_ID (0 => 1)
  24. export COLOSSUS_1_URL="http://${HOST_IP}:3333"
  25. export COLOSSUS_1_WORKER_ID=1
  26. export COLOSSUS_1_WORKER_URI=//testing//worker//Storage//${COLOSSUS_1_WORKER_ID}
  27. export COLOSSUS_1_TRANSACTOR_KEY=$(docker run --rm --pull=always docker.io/parity/subkey:2.0.1 inspect ${COLOSSUS_1_TRANSACTOR_URI} --output-type json | jq .ss58Address -r)
  28. export DISTRIBUTOR_1_URL="http://${HOST_IP}:3334"
  29. export DISTRIBUTOR_1_WORKER_ID=1
  30. export DISTRIBUTOR_1_ACCOUNT_URI=//testing//worker//Distribution//${DISTRIBUTOR_1_WORKER_ID}
  31. REUSE_KEYS=true ./run-test-scenario.sh init-storage-and-distribution
  32. # Start colossus & argus
  33. docker-compose -f ../../docker-compose.yml up -d colossus-1
  34. docker-compose -f ../../docker-compose.yml up -d distributor-1
  35. # Run combined tests reusing the existing keys
  36. REUSE_KEYS=true ./run-test-scenario.sh combined