Skip to content

Commit

Permalink
Merge branch 'master' of github.com:safe-global/safe-eth-py into fix/…
Browse files Browse the repository at this point in the history
…run-tests-script
  • Loading branch information
mmv08 committed Nov 24, 2023
2 parents 92d737d + 8e34000 commit ebe3a8e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 27 deletions.
4 changes: 0 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,3 @@ services:
ports:
- "8545:8545"
command: --defaultBalanceEther 10000 --gasLimit 10000000 -a 30 --chain.chainId 1337 --chain.networkId 1337 -d
networks:
default:
aliases:
- ganache
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-r requirements.txt
coverage==7.3.2
faker==20.0.0
faker==20.0.3
pytest==7.4.3
pytest-django==4.7.0
pytest-env==1.1.1
Expand Down
25 changes: 3 additions & 22 deletions run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
#!/bin/sh
# Postgresql and ganache-cli must be running for the tests

docker ps | grep '\->5432' > /dev/null
if [ $? -eq 1 ]; then
docker-compose up -d db
sleep 3
DATABASE_UP=1
else
DATABASE_UP=0
fi

docker ps | grep '\->8545' > /dev/null
if [ $? -eq 1 ]; then
docker-compose up -d ganache
sleep 3
GANACHE_UP=1
else
GANACHE_UP=0
fi

docker-compose up -d db ganache
sleep 3

# python manage.py test --settings=config.settings.test
DJANGO_SETTINGS_MODULE=config.settings.test pytest

if [ $DATABASE_UP -eq 1 ] || [ $GANACHE_UP -eq 1 ]; then
docker-compose down
fi
docker-compose down

0 comments on commit ebe3a8e

Please sign in to comment.