runPythonUnitTests.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/usr/bin/env bash
  2. #python3 -m pip install -r requirements.txt
  3. if [ ! -d _sandbox ]; then
  4. echo We need to create it...
  5. git clone https://github.com/algorand/sandbox.git _sandbox
  6. cd _sandbox
  7. git checkout 4e613dcff61523693c18584894ee6de9bd469ec1
  8. cd ..
  9. fi
  10. sed -i -e 's@export ALGOD_URL=""@export ALGOD_URL="https://github.com/algorand/go-algorand"@' \
  11. -e 's/export ALGOD_CHANNEL="stable"/export ALGOD_CHANNEL=""/' \
  12. -e 's/export ALGOD_BRANCH=""/export ALGOD_BRANCH="v3.16.2-stable"/' \
  13. -e 's/export INDEXER_BRANCH="master"/export INDEXER_BRANCH="2.15.4"/' \
  14. -e 's/export INDEXER_ENABLE_ALL_PARAMETERS="false"/export INDEXER_ENABLE_ALL_PARAMETERS="true"/' _sandbox/config.dev
  15. cd _sandbox
  16. # NOTE: This is a workaround for a bug. It's already fixed in `d8e60ed1a6203f02d3b4702e2e2eefdb7f246f92` in the sandbox
  17. # repository, but we're not ready to upgrade. This allows docker to work in the meantime.
  18. # These lines can be removed when we update the commit hash.
  19. sed -i -e 's/docker compose help/docker compose --help/' ./sandbox
  20. sed -i -e 's/-eq 16/-eq 0/' ./sandbox
  21. ./sandbox clean
  22. ./sandbox up -v dev
  23. cd ..
  24. echo running the tests...
  25. cd test
  26. python3 test.py
  27. rv=$?
  28. echo rv = $rv
  29. if [ $rv -ne 0 ]; then
  30. echo tests in test.py failed
  31. exit 1
  32. fi
  33. echo bringing the sandbox down...
  34. cd ../_sandbox
  35. ./sandbox down