From 83db0a3f60512ebd69510cab99e7ef96cd858770 Mon Sep 17 00:00:00 2001 From: Ry Jones Date: Thu, 17 Aug 2023 11:34:38 -0700 Subject: [PATCH 1/3] Don't run Snyk on forks Signed-off-by: Ry Jones --- .github/workflows/snyk.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/snyk.yml b/.github/workflows/snyk.yml index 8baabb6b31..f85ed872a6 100644 --- a/.github/workflows/snyk.yml +++ b/.github/workflows/snyk.yml @@ -3,6 +3,7 @@ on: push jobs: snyk: runs-on: ubuntu-latest + if: ${{ github.repository_owner == 'hyperledger' }} steps: - uses: actions/checkout@v3 - name: Build a Docker image From e5f7e4d1284092b771eb7fae0db9d37e3685e09f Mon Sep 17 00:00:00 2001 From: Gavin Date: Fri, 18 Aug 2023 12:54:06 -0700 Subject: [PATCH 2/3] Temporary fix for nightly builds on Python 3.10 Signed-off-by: Gavin --- .github/workflows/nigthly.yml | 2 +- aries_cloudagent/admin/tests/test_admin_server.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nigthly.yml b/.github/workflows/nigthly.yml index 418a28b58f..7af06f95a4 100644 --- a/.github/workflows/nigthly.yml +++ b/.github/workflows/nigthly.yml @@ -38,7 +38,7 @@ jobs: publish: name: Publish - needs: [setup_and_check_pub] + needs: [tests, setup_and_check_pub] if: needs.setup_and_check_pub.outputs.commits_today > 0 uses: ./.github/workflows/publish.yml strategy: diff --git a/aries_cloudagent/admin/tests/test_admin_server.py b/aries_cloudagent/admin/tests/test_admin_server.py index 049d70c42d..3f42d561e8 100644 --- a/aries_cloudagent/admin/tests/test_admin_server.py +++ b/aries_cloudagent/admin/tests/test_admin_server.py @@ -303,6 +303,7 @@ async def test_register_external_plugin_x(self): logs.output ) + @pytest.mark.skip(reason="async_case library not compatible with python 3.10") async def test_visit_insecure_mode(self): settings = {"admin.admin_insecure_mode": True, "task_queue": True} server = self.get_admin_server(settings) From b10c922d38cad5cb3147219072887b1cf5fa5810 Mon Sep 17 00:00:00 2001 From: Gavin Date: Fri, 18 Aug 2023 13:53:59 -0700 Subject: [PATCH 3/3] Switch from async_case to unittest to support python 3.10 Signed-off-by: Gavin --- aries_cloudagent/admin/tests/test_admin_server.py | 6 +----- aries_cloudagent/core/tests/test_conductor.py | 2 +- aries_cloudagent/core/tests/test_dispatcher.py | 2 +- aries_cloudagent/core/tests/test_util.py | 2 +- aries_cloudagent/ledger/tests/test_routes.py | 2 +- aries_cloudagent/wallet/tests/test_routes.py | 2 +- requirements.dev.txt | 1 - 7 files changed, 6 insertions(+), 11 deletions(-) diff --git a/aries_cloudagent/admin/tests/test_admin_server.py b/aries_cloudagent/admin/tests/test_admin_server.py index 3f42d561e8..c3887ad61c 100644 --- a/aries_cloudagent/admin/tests/test_admin_server.py +++ b/aries_cloudagent/admin/tests/test_admin_server.py @@ -2,8 +2,7 @@ import pytest import mock as async_mock -from async_case import IsolatedAsyncioTestCase - +from unittest import IsolatedAsyncioTestCase from aiohttp import ClientSession, DummyCookieJar, TCPConnector, web from aiohttp.test_utils import unused_port @@ -303,7 +302,6 @@ async def test_register_external_plugin_x(self): logs.output ) - @pytest.mark.skip(reason="async_case library not compatible with python 3.10") async def test_visit_insecure_mode(self): settings = {"admin.admin_insecure_mode": True, "task_queue": True} server = self.get_admin_server(settings) @@ -335,7 +333,6 @@ async def test_visit_insecure_mode(self): await server.stop() - @pytest.mark.skip(reason="async_case library not compatible with python 3.10") async def test_visit_secure_mode(self): settings = { "admin.admin_insecure_mode": False, @@ -388,7 +385,6 @@ async def test_visit_secure_mode(self): await server.stop() - @pytest.mark.skip(reason="async_case library not compatible with python 3.10") async def test_query_config(self): settings = { "admin.admin_insecure_mode": False, diff --git a/aries_cloudagent/core/tests/test_conductor.py b/aries_cloudagent/core/tests/test_conductor.py index 0ed44f8b53..7da2c37c34 100644 --- a/aries_cloudagent/core/tests/test_conductor.py +++ b/aries_cloudagent/core/tests/test_conductor.py @@ -1,7 +1,7 @@ from io import StringIO import mock as async_mock -from async_case import IsolatedAsyncioTestCase +from unittest import IsolatedAsyncioTestCase from ...admin.base_server import BaseAdminServer from ...config.base_context import ContextBuilder diff --git a/aries_cloudagent/core/tests/test_dispatcher.py b/aries_cloudagent/core/tests/test_dispatcher.py index 450bfb4767..c76415133a 100644 --- a/aries_cloudagent/core/tests/test_dispatcher.py +++ b/aries_cloudagent/core/tests/test_dispatcher.py @@ -1,6 +1,6 @@ import json -from async_case import IsolatedAsyncioTestCase +from unittest import IsolatedAsyncioTestCase import mock as async_mock import pytest diff --git a/aries_cloudagent/core/tests/test_util.py b/aries_cloudagent/core/tests/test_util.py index c25f944d74..5c28b6baa8 100644 --- a/aries_cloudagent/core/tests/test_util.py +++ b/aries_cloudagent/core/tests/test_util.py @@ -1,4 +1,4 @@ -from async_case import IsolatedAsyncioTestCase +from unittest import IsolatedAsyncioTestCase from ...cache.base import BaseCache from ...cache.in_memory import InMemoryCache diff --git a/aries_cloudagent/ledger/tests/test_routes.py b/aries_cloudagent/ledger/tests/test_routes.py index 0cf7b164a9..a04add9e3a 100644 --- a/aries_cloudagent/ledger/tests/test_routes.py +++ b/aries_cloudagent/ledger/tests/test_routes.py @@ -1,6 +1,6 @@ from typing import Tuple -from async_case import IsolatedAsyncioTestCase +from unittest import IsolatedAsyncioTestCase import mock as async_mock from ...core.in_memory import InMemoryProfile diff --git a/aries_cloudagent/wallet/tests/test_routes.py b/aries_cloudagent/wallet/tests/test_routes.py index c8e18a47cb..74a755cc09 100644 --- a/aries_cloudagent/wallet/tests/test_routes.py +++ b/aries_cloudagent/wallet/tests/test_routes.py @@ -1,7 +1,7 @@ import mock as async_mock import pytest from aiohttp.web import HTTPForbidden -from async_case import IsolatedAsyncioTestCase +from unittest import IsolatedAsyncioTestCase from ...admin.request_context import AdminRequestContext from ...core.in_memory import InMemoryProfile diff --git a/requirements.dev.txt b/requirements.dev.txt index f43dda84f1..5cb2883300 100644 --- a/requirements.dev.txt +++ b/requirements.dev.txt @@ -1,5 +1,4 @@ asynctest==0.13.0 -async-case~=10.1 pytest~=7.4.0 pytest-asyncio==0.14.0 pytest-cov==2.10.1