From 16f037f9e7d60f8685d28e1fa2c6673efd5e5456 Mon Sep 17 00:00:00 2001 From: Brice Rising Date: Thu, 20 Jan 2022 11:48:56 -0500 Subject: [PATCH 01/11] Add build and pycharm files to gitignore --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index b47c4650..45562453 100644 --- a/.gitignore +++ b/.gitignore @@ -113,3 +113,9 @@ venv.bak/ *.feature test/features test-harness + +# Build files +py-algorand-sdk-* + +# Pycharm +.idea From 7ba92efd000b4229ece7895753ddb05747513ed0 Mon Sep 17 00:00:00 2001 From: Brice Rising Date: Thu, 20 Jan 2022 11:49:28 -0500 Subject: [PATCH 02/11] Update circle job to use docker instead of vm --- .circleci/config.yml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ffbbfa07..db0b0fd1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,14 +1,17 @@ version: 2.1 jobs: - build: - machine: - image: "ubuntu-2004:202104-01" + integration-test: + docker: + - image: python:3 steps: - - checkout - - run: - command: | - pip3 install -r requirements.txt - black --check . - set -e - python3 test_unit.py - make docker-test + - pip install -r requirements.txt + - black --check . + - python3 test_unit.py + unit-test: + docker: + - image: docker:19 # the primary container, where your job's commands are run + steps: + - setup_remote_docker: + version: 19.03.13 + docker_layer_caching: true + - make docker-test \ No newline at end of file From 3d9f4ffa478c048d1f1195afd574be809ff24ba5 Mon Sep 17 00:00:00 2001 From: Brice Rising Date: Thu, 20 Jan 2022 11:53:44 -0500 Subject: [PATCH 03/11] Define workflow for test pipeline --- .circleci/config.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index db0b0fd1..06a3b7ea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,4 +14,9 @@ jobs: - setup_remote_docker: version: 19.03.13 docker_layer_caching: true - - make docker-test \ No newline at end of file + - make docker-test +workflows: + test: + jobs: + - unit-test + - integration-test From e30384c5b76f9ba360a4898f72ae6f776bc567a8 Mon Sep 17 00:00:00 2001 From: Brice Rising Date: Thu, 20 Jan 2022 11:56:04 -0500 Subject: [PATCH 04/11] Add version field to workflows --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 06a3b7ea..2ffa62ca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,6 +16,7 @@ jobs: docker_layer_caching: true - make docker-test workflows: + version: 2 test: jobs: - unit-test From 52c8f8a03c5c7b3019a176166dcdc92fa8eb24dc Mon Sep 17 00:00:00 2001 From: Brice Rising Date: Thu, 20 Jan 2022 12:00:43 -0500 Subject: [PATCH 05/11] Add run to shell commands --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2ffa62ca..b654987e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,9 +4,9 @@ jobs: docker: - image: python:3 steps: - - pip install -r requirements.txt - - black --check . - - python3 test_unit.py + - run: pip install -r requirements.txt + - run: black --check . + - run: python3 test_unit.py unit-test: docker: - image: docker:19 # the primary container, where your job's commands are run @@ -14,7 +14,7 @@ jobs: - setup_remote_docker: version: 19.03.13 docker_layer_caching: true - - make docker-test + - run: make docker-test workflows: version: 2 test: From 7d83af5c20c059e77c6bf612c210ff818e816485 Mon Sep 17 00:00:00 2001 From: Brice Rising Date: Thu, 20 Jan 2022 12:09:49 -0500 Subject: [PATCH 06/11] Fix name and add debug for unit test job --- .circleci/config.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b654987e..c6161a3f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,19 +1,21 @@ version: 2.1 jobs: - integration-test: + unit-test: docker: - - image: python:3 + - image: python:3.7.9 steps: + - run: ls - run: pip install -r requirements.txt - run: black --check . - run: python3 test_unit.py - unit-test: + integration-test: docker: - - image: docker:19 # the primary container, where your job's commands are run + - image: docker:19 steps: - setup_remote_docker: version: 19.03.13 docker_layer_caching: true + - run: apk add make bash git docker-compose - run: make docker-test workflows: version: 2 From 159b5fe278a51a37b0deb0efa258589a3193f178 Mon Sep 17 00:00:00 2001 From: Brice Rising Date: Thu, 20 Jan 2022 12:11:24 -0500 Subject: [PATCH 07/11] Add checkout steps --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c6161a3f..f66a6b47 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ jobs: docker: - image: python:3.7.9 steps: - - run: ls + - checkout - run: pip install -r requirements.txt - run: black --check . - run: python3 test_unit.py @@ -16,6 +16,7 @@ jobs: version: 19.03.13 docker_layer_caching: true - run: apk add make bash git docker-compose + - checkout - run: make docker-test workflows: version: 2 From 0237e6a6b9782ea4b2d0425fac8fa16ca143f140 Mon Sep 17 00:00:00 2001 From: Brice Rising Date: Thu, 20 Jan 2022 12:18:37 -0500 Subject: [PATCH 08/11] Make unit tests exit with 1 when tests fail --- test_unit.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test_unit.py b/test_unit.py index 183f46ee..d1a3aa8d 100644 --- a/test_unit.py +++ b/test_unit.py @@ -3,6 +3,7 @@ import os import random import string +import sys import unittest import uuid from unittest.mock import Mock @@ -4317,3 +4318,5 @@ def test_contract(self): suite = unittest.TestSuite(suites) runner = unittest.TextTestRunner(verbosity=2) results = runner.run(suite) + ret = not results.wasSuccessful() + sys.exit(ret) From 1c13405e6d24bb3309dc6134eac488b8ef46d8bb Mon Sep 17 00:00:00 2001 From: Brice Rising Date: Thu, 20 Jan 2022 12:25:12 -0500 Subject: [PATCH 09/11] Fix verify for signatures with not enough chars --- algosdk/future/transaction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/algosdk/future/transaction.py b/algosdk/future/transaction.py index 512b0b17..ba61d7fa 100644 --- a/algosdk/future/transaction.py +++ b/algosdk/future/transaction.py @@ -2533,7 +2533,7 @@ def verify(self, public_key): try: verify_key.verify(to_sign, base64.b64decode(self.sig)) return True - except BadSignatureError: + except (BadSignatureError, ValueError): return False return self.msig.verify(to_sign) From 32deda34e7cb434104acc33adea22276e7a7ebac Mon Sep 17 00:00:00 2001 From: Brice Rising Date: Tue, 25 Jan 2022 13:27:48 -0500 Subject: [PATCH 10/11] Switch to using vm for integration tests --- .circleci/config.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f66a6b47..1b9bb065 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,13 +9,9 @@ jobs: - run: black --check . - run: python3 test_unit.py integration-test: - docker: - - image: docker:19 + machine: + image: "ubuntu-2004:202104-01" steps: - - setup_remote_docker: - version: 19.03.13 - docker_layer_caching: true - - run: apk add make bash git docker-compose - checkout - run: make docker-test workflows: From 8e9cb9a11589743f4216f26d464ea8026ab1bf90 Mon Sep 17 00:00:00 2001 From: Jack <87339414+algojack@users.noreply.github.com> Date: Wed, 26 Jan 2022 12:17:22 -0500 Subject: [PATCH 11/11] rearranged to keep logical order workflows > jobs > commands --- .circleci/config.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1b9bb065..01628de0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,12 @@ version: 2.1 + +workflows: + version: 2 + test: + jobs: + - unit-test + - integration-test + jobs: unit-test: docker: @@ -14,9 +22,3 @@ jobs: steps: - checkout - run: make docker-test -workflows: - version: 2 - test: - jobs: - - unit-test - - integration-test