diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2bc926b38..d6d9726f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,16 +42,26 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: '1.17.5' + go-version: "1.17.5" - run: make node + algorand: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + with: + python-version: "3.10" + - run: pip install -r algorand/requirements.txt + - run: cd algorand && make test + ethereum: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: '16' + node-version: "16" - run: cd ethereum && make test terra: @@ -60,7 +70,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: '16' + node-version: "16" - run: cd terra && make test # Run linters, Go tests and other outside-of-Tilt things. @@ -74,7 +84,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: '1.17.5' + go-version: "1.17.5" - run: make generate && ./lint.sh # The go-ethereum and celo-blockchain packages both implement secp256k1 using the exact same header, but that causes duplicate symbols. - run: cd node && go test -v -ldflags '-extldflags "-Wl,--allow-multiple-definition" ' ./... diff --git a/algorand/Makefile b/algorand/Makefile new file mode 100644 index 000000000..b4895512b --- /dev/null +++ b/algorand/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + ./runPythonUnitTests.sh diff --git a/algorand/requirements.txt b/algorand/requirements.txt index 097672fa2..636e371cc 100644 --- a/algorand/requirements.txt +++ b/algorand/requirements.txt @@ -14,6 +14,7 @@ pydantic==1.9.0 PyNaCl==1.5.0 pyparsing==3.0.6 pyteal==v0.11.1 +#pyteal==v0.10.0 py-algorand-sdk==1.10.0b1 pytest==6.2.5 pytest-depends==1.0.1 diff --git a/algorand/runPythonUnitTests.sh b/algorand/runPythonUnitTests.sh new file mode 100755 index 000000000..3a616306b --- /dev/null +++ b/algorand/runPythonUnitTests.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +#python3 -m pip install -r requirements.txt +if [ ! -d _sandbox ]; then + echo We need to create it... + git clone https://github.com/algorand/sandbox.git _sandbox +fi +if [ "`grep enable-all-parameters _sandbox/images/indexer/start.sh | wc -l`" == "0" ]; then + echo the indexer is incorrectly configured + sed -i -e 's/dev-mode/dev-mode --enable-all-parameters/' _sandbox/images/indexer/start.sh + echo delete all the existing docker images +fi +./sandbox clean +./sandbox up -v dev +echo running the tests... +cd test +python3 test.py +rv=$? +echo rv = $rv +if [ $rv -ne 0 ]; then + echo tests in test.py failed + exit 1 +fi +echo bringing the sandbox down... +cd .. +./sandbox down diff --git a/algorand/test/test.py b/algorand/test/test.py index 2cf98c8b8..8caec4a68 100644 --- a/algorand/test/test.py +++ b/algorand/test/test.py @@ -533,7 +533,7 @@ class AlgoTest(PortalCore): if self.foundation == None: print("We dont have a account? ") - sys.exit(0) + sys.exit(1) foundation = self.foundation