diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 1210714858..3e22a5a21a 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -54,7 +54,7 @@ jobs: sudo apt-get install -y protobuf-compiler - name: Integrational tests and coverage run: | - tox -e py3.8 -- --aea-loop sync -m 'integration and not unstable and not ethereum' + tox -e py3.8 -- --aea-loop sync -m 'integration and not unstable and not ledger' common_checks: runs-on: ubuntu-latest @@ -128,9 +128,9 @@ jobs: pip install pipenv pip install tox - name: Integration tests - run: tox -e py3.7 -- -m 'integration and not unstable and not ethereum' + run: tox -e py3.7 -- -m 'integration and not unstable and not ledger' - integration_checks_eth: + integration_checks_ledger: continue-on-error: True runs-on: ubuntu-latest @@ -149,7 +149,7 @@ jobs: pip install pipenv pip install tox - name: Integration tests - run: tox -e py3.7 -- -m 'integration and not unstable and ethereum' + run: tox -e py3.7 -- -m 'integration and not unstable and ledger' continue-on-error: true - name: Force green exit run: exit 0 diff --git a/aea/test_tools/test_cases.py b/aea/test_tools/test_cases.py index 55394a3590..4372a8fd78 100644 --- a/aea/test_tools/test_cases.py +++ b/aea/test_tools/test_cases.py @@ -18,6 +18,7 @@ # ------------------------------------------------------------------------------ """This module contains test case classes based on pytest for AEA end-to-end testing.""" +import copy import os import random import shutil @@ -253,7 +254,7 @@ def difference_to_fetched_agent(cls, public_id: str, agent_name: str) -> List[st def is_allowed_diff_in_agent_config( path_to_fetched_aea, path_to_manually_created_aea - ) -> bool: + ) -> Tuple[bool, Dict[str, str], Dict[str, str]]: with open( os.path.join(path_to_fetched_aea, "aea-config.yaml"), "r" ) as file: @@ -262,12 +263,20 @@ def is_allowed_diff_in_agent_config( os.path.join(path_to_manually_created_aea, "aea-config.yaml"), "r" ) as file: content2 = yaml.full_load(file) - diff_count = 0 - for key, value in content1.items(): - if content2[key] != value: - diff_count += 1 - # allow diff in aea_version, author, description and version - return diff_count <= 4 + content1c = copy.deepcopy(content1) + for key, value in content1c.items(): + if content2[key] == value: + content1.pop(key) + content2.pop(key) + allowed_diff_keys = ["aea_version", "author", "description", "version"] + result = all([key in allowed_diff_keys for key in content1.keys()]) + result = result and all( + [key in allowed_diff_keys for key in content2.keys()] + ) + if result: + return result, {}, {} + else: + return result, content1, content2 path_to_manually_created_aea = os.path.join(cls.t, agent_name) new_cwd = os.path.join(cls.t, "fetch_dir") @@ -279,10 +288,15 @@ def is_allowed_diff_in_agent_config( cls.run_cli_command("fetch", "--local", public_id, "--alias", agent_name) comp = dircmp(path_to_manually_created_aea, path_to_fetched_aea) file_diff = comp.diff_files - if is_allowed_diff_in_agent_config( + result, diff1, diff2 = is_allowed_diff_in_agent_config( path_to_fetched_aea, path_to_manually_created_aea - ): + ) + if result: file_diff.remove("aea-config.yaml") # won't match! + else: + file_diff.append( + "Difference in aea-config.yaml: " + str(diff1) + " vs. " + str(diff2) + ) try: shutil.rmtree(new_cwd) except (OSError, IOError): diff --git a/docs/erc1155-skills.md b/docs/erc1155-skills.md index 1b4d548960..3c4ee34100 100644 --- a/docs/erc1155-skills.md +++ b/docs/erc1155-skills.md @@ -81,7 +81,7 @@ aea add-key ethereum eth_private_key.txt In another terminal, fetch the AEA that will get some tokens from the deployer. ``` bash -aea fetch fetchai/erc1155_client:0.7.0 +aea fetch fetchai/erc1155_client:0.8.0 cd erc1155_client aea install ``` @@ -96,7 +96,7 @@ aea create erc1155_client cd erc1155_client aea add connection fetchai/oef:0.5.0 aea add connection fetchai/ledger:0.1.0 -aea add skill fetchai/erc1155_client:0.6.0 +aea add skill fetchai/erc1155_client:0.7.0 aea install aea config set agent.default_connection fetchai/oef:0.5.0 ``` diff --git a/packages/fetchai/agents/erc1155_client/aea-config.yaml b/packages/fetchai/agents/erc1155_client/aea-config.yaml index fb6abdaaa4..fa88d4b448 100644 --- a/packages/fetchai/agents/erc1155_client/aea-config.yaml +++ b/packages/fetchai/agents/erc1155_client/aea-config.yaml @@ -1,6 +1,6 @@ agent_name: erc1155_client author: fetchai -version: 0.7.0 +version: 0.8.0 description: An AEA to interact with the ERC1155 deployer AEA license: Apache-2.0 aea_version: '>=0.5.0, <0.6.0' @@ -20,7 +20,7 @@ protocols: - fetchai/oef_search:0.3.0 - fetchai/signing:0.1.0 skills: -- fetchai/erc1155_client:0.6.0 +- fetchai/erc1155_client:0.7.0 - fetchai/error:0.3.0 default_connection: fetchai/oef:0.5.0 default_ledger: ethereum diff --git a/packages/fetchai/skills/erc1155_client/skill.yaml b/packages/fetchai/skills/erc1155_client/skill.yaml index e494d7375b..59faed7522 100644 --- a/packages/fetchai/skills/erc1155_client/skill.yaml +++ b/packages/fetchai/skills/erc1155_client/skill.yaml @@ -1,7 +1,8 @@ name: erc1155_client author: fetchai -version: 0.6.0 -description: The weather client skill implements the skill to purchase weather data. +version: 0.7.0 +description: The erc1155 client interacts with the erc1155 deployer to conduct an + atomic swap. license: Apache-2.0 aea_version: '>=0.5.0, <0.6.0' fingerprint: @@ -14,9 +15,12 @@ fingerprint_ignore_patterns: [] contracts: - fetchai/erc1155:0.6.0 protocols: +- fetchai/contract_api:0.1.0 - fetchai/default:0.3.0 - fetchai/fipa:0.4.0 +- fetchai/ledger_api:0.1.0 - fetchai/oef_search:0.3.0 +- fetchai/signing:0.1.0 skills: [] behaviours: search: diff --git a/packages/hashes.csv b/packages/hashes.csv index a4a8b19626..420724f8d8 100644 --- a/packages/hashes.csv +++ b/packages/hashes.csv @@ -2,7 +2,7 @@ fetchai/agents/aries_alice,Qma9e8EXGU3bKQMRxwJdNvUDdPCHEpDUUNYqGyT2KtrNpj fetchai/agents/aries_faber,QmPSsKEqfh26murXXdZ8kocuAJtNwNne6jjVVkDAQnSthb fetchai/agents/car_data_buyer,QmcBd8VLx11U2nDPBt4W4YyRToUJpEQytfFqHDTJDZA5AR fetchai/agents/car_detector,QmXMjcvVo8Qg7a8u3GadWWtPHnrzFKkxkTHap6JRjDHXm4 -fetchai/agents/erc1155_client,QmcNrPxgokFn2WUWed5vsnRxCgbLPKXsERbTs6hVE7NLcm +fetchai/agents/erc1155_client,QmYSpr6ZTEXWheNxUD5Z7dXUS1eZxbe498JuHqwwjKs888 fetchai/agents/erc1155_deployer,QmevosZhB78HTPQAb62v8hLCdtcSqdoSQnKWwKkbXT55L4 fetchai/agents/generic_buyer,QmPAdWvKuw3VFxxQi9NkMPAC4ymAwVSftaYbc5upBTtPtf fetchai/agents/generic_seller,QmUF18HoArCHf6mLdXjq1zXCuJKY7JwXXSYTdfsWCwPWKn @@ -52,7 +52,7 @@ fetchai/skills/aries_faber,QmcqRhcdZ3v42bd9gX2wMVB81Xq7tztumknxcWeKYJm6cB fetchai/skills/carpark_client,Qme1o7xwV9mRv9yBzTRxbEqxrz5J14nyu5MKYaMqJMb5nq fetchai/skills/carpark_detection,QmQByZH6G6b4PmU2REiny33GcRcpo9aYnZAhYcUiBff9ME fetchai/skills/echo,QmeSr4j8W9enijZvgeE3vXeWcEj9sS8fo6vNFRpyAMnZey -fetchai/skills/erc1155_client,Qmb2EiLT8ycav2fKsuZb2DhGiNzgoZym1LX8dYCSe7V9qQ +fetchai/skills/erc1155_client,QmRfnZPPh5a8Z7nPf4AcjA9VGei1yYLEqDCDnxgamu4mHz fetchai/skills/erc1155_deploy,QmRS56TANANu3yw8mk4cBf7iiA4SQ3d1ZPnSLFdo4XrcTE fetchai/skills/error,QmVirmcRGj6bc2i6iJZ2zoWGCfsCZMoGmZAXYq5aaYAqNb fetchai/skills/generic_buyer,QmabHUAbLja1hsHU8p7M6TSx9nNsNAE9rAj31nwV1LX1Sm diff --git a/pytest.ini b/pytest.ini index 4467b48b1e..12c0c377c3 100644 --- a/pytest.ini +++ b/pytest.ini @@ -5,8 +5,7 @@ log_cli_format = %(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno log_cli_date_format=%Y-%m-%d %H:%M:%S markers = - integration: marks end-to-end tests which require the oef - unstable: marks test as unstable - network: marks tests which require internet access - ethereum: marks tests which require ethereum test network + integration: marks end-to-end tests which require the oef, ledger or other network services + unstable: marks test as unstable (won't be run in CI) + ledger: marks tests which require ledger test networks (ethereum, cosmos, fetchai); these tests should also be marked 'integration' flaky: marks tests which are flaky and worth re-running \ No newline at end of file diff --git a/tests/test_cli/test_add/test_connection.py b/tests/test_cli/test_add/test_connection.py index 3cd72f33f9..aa2f8bc147 100644 --- a/tests/test_cli/test_add/test_connection.py +++ b/tests/test_cli/test_add/test_connection.py @@ -475,10 +475,10 @@ def teardown_class(cls): pass -@pytest.mark.integration class TestAddConnectionFromRemoteRegistry(AEATestCaseEmpty): """Test case for add connection from Registry command.""" + @pytest.mark.integration @pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS) def test_add_connection_from_remote_registry_positive(self): """Test add connection from Registry positive result.""" diff --git a/tests/test_cli/test_add/test_contract.py b/tests/test_cli/test_add/test_contract.py index e4f45d1fba..f50a4f6f2c 100644 --- a/tests/test_cli/test_add/test_contract.py +++ b/tests/test_cli/test_add/test_contract.py @@ -56,10 +56,10 @@ def test_add_contract_positive(self, *mocks): self.assertEqual(result.exit_code, 0) -@pytest.mark.integration class TestAddContractFromRemoteRegistry(AEATestCaseEmpty): """Test case for add contract from Registry command.""" + @pytest.mark.integration @pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS) def test_add_contract_from_remote_registry_positive(self): """Test add contract from Registry positive result.""" diff --git a/tests/test_cli/test_add/test_protocol.py b/tests/test_cli/test_add/test_protocol.py index a1a3407e2c..4300743b5f 100644 --- a/tests/test_cli/test_add/test_protocol.py +++ b/tests/test_cli/test_add/test_protocol.py @@ -471,10 +471,10 @@ def teardown_class(cls): pass -@pytest.mark.integration class TestAddProtocolFromRemoteRegistry(AEATestCaseEmpty): """Test case for add protocol from Registry command.""" + @pytest.mark.integration @pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS) def test_add_protocol_from_remote_registry_positive(self): """Test add protocol from Registry positive result.""" diff --git a/tests/test_cli/test_add/test_skill.py b/tests/test_cli/test_add/test_skill.py index 6122b104bb..77b72dd550 100644 --- a/tests/test_cli/test_add/test_skill.py +++ b/tests/test_cli/test_add/test_skill.py @@ -488,7 +488,7 @@ class TestAddSkillWithContractsDeps(AEATestCaseEmpty): def test_add_skill_with_contracts_positive(self): """Test add skill with contract dependencies positive result.""" - self.add_item("skill", "fetchai/erc1155_client:0.6.0") + self.add_item("skill", "fetchai/erc1155_client:0.7.0") contracts_path = os.path.join(self.agent_name, "vendor", "fetchai", "contracts") contracts_folders = os.listdir(contracts_path) @@ -496,10 +496,10 @@ def test_add_skill_with_contracts_positive(self): assert contract_dependency_name in contracts_folders -@pytest.mark.integration class TestAddSkillFromRemoteRegistry(AEATestCaseEmpty): """Test case for add skill from Registry command.""" + @pytest.mark.integration @pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS) def test_add_skill_from_remote_registry_positive(self): """Test add skill from Registry positive result.""" diff --git a/tests/test_cli/test_fetch.py b/tests/test_cli/test_fetch.py index 83cfb6206d..77e7b244d9 100644 --- a/tests/test_cli/test_fetch.py +++ b/tests/test_cli/test_fetch.py @@ -143,10 +143,10 @@ def test__is_version_correct_negative(self): self.assertFalse(result) -@pytest.mark.integration class TestFetchFromRemoteRegistry(AEATestCaseMany): """Test case for fetch agent command from Registry.""" + @pytest.mark.integration @pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS) def test_fetch_agent_from_remote_registry_positive(self): """Test fetch agent from Registry for positive result.""" diff --git a/tests/test_cli/test_launch.py b/tests/test_cli/test_launch.py index 79ba057019..84a3a25c62 100644 --- a/tests/test_cli/test_launch.py +++ b/tests/test_cli/test_launch.py @@ -40,7 +40,7 @@ from tests.common.pexpect_popen import PexpectWrapper -from ..conftest import AUTHOR, CLI_LOG_OPTION, CUR_PATH +from ..conftest import AUTHOR, CLI_LOG_OPTION, CUR_PATH, MAX_FLAKY_RERUNS logger = logging.getLogger(__name__) @@ -135,7 +135,7 @@ def test_exit_code_equal_to_zero(self): ) -@pytest.mark.unstable +@pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS) class TestLaunchWithOneFailingAgent(BaseLaunchTestCase): """Test aea launch when there is a failing agent..""" diff --git a/tests/test_cli_gui/test_run_agent.py b/tests/test_cli_gui/test_run_agent.py index 0d3b7a4591..7c4a142df7 100644 --- a/tests/test_cli_gui/test_run_agent.py +++ b/tests/test_cli_gui/test_run_agent.py @@ -34,10 +34,10 @@ from aea.test_tools.constants import DEFAULT_AUTHOR from .test_base import TempCWD, create_app -from ..conftest import CUR_PATH, skip_test_windows +from ..conftest import CUR_PATH, MAX_FLAKY_RERUNS, skip_test_windows -@pytest.mark.unstable +@pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS) @skip_test_windows def test_create_and_run_agent(): """Test for running and agent, reading TTY and errors.""" diff --git a/tests/test_crypto/test_cosmos.py b/tests/test_crypto/test_cosmos.py index 85cedddb97..2c2b783c3b 100644 --- a/tests/test_crypto/test_cosmos.py +++ b/tests/test_crypto/test_cosmos.py @@ -90,7 +90,8 @@ def test_generate_nonce(): @pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS) -@pytest.mark.network +@pytest.mark.integration +@pytest.mark.ledger def test_construct_sign_and_submit_transfer_transaction(): """Test the construction, signing and submitting of a transfer transaction.""" account = CosmosCrypto(COSMOS_PRIVATE_KEY_PATH) @@ -141,7 +142,8 @@ def test_construct_sign_and_submit_transfer_transaction(): @pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS) -@pytest.mark.network +@pytest.mark.integration +@pytest.mark.ledger def test_get_balance(): """Test the balance is zero for a new account.""" cosmos_api = CosmosApi(**COSMOS_TESTNET_CONFIG) @@ -154,7 +156,8 @@ def test_get_balance(): @pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS) -@pytest.mark.network +@pytest.mark.integration +@pytest.mark.ledger def test_get_wealth_positive(caplog): """Test the balance is zero for a new account.""" with caplog.at_level(logging.DEBUG, logger="aea.crypto.cosmos"): diff --git a/tests/test_crypto/test_ethereum.py b/tests/test_crypto/test_ethereum.py index 531cd33d76..dddf3fc029 100644 --- a/tests/test_crypto/test_ethereum.py +++ b/tests/test_crypto/test_ethereum.py @@ -113,7 +113,8 @@ def test_api_none(): @pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS) -@pytest.mark.network +@pytest.mark.integration +@pytest.mark.ledger def test_get_balance(): """Test the balance is zero for a new account.""" ethereum_api = EthereumApi(**ETHEREUM_TESTNET_CONFIG) @@ -125,9 +126,9 @@ def test_get_balance(): assert balance > 0, "Existing account has no balance." -@pytest.mark.unstable # TODO: fix @pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS) @pytest.mark.integration +@pytest.mark.ledger def test_construct_sign_and_submit_transfer_transaction(): """Test the construction, signing and submitting of a transfer transaction.""" account = EthereumCrypto(private_key_path=ETHEREUM_PRIVATE_KEY_PATH) @@ -179,7 +180,8 @@ def test_construct_sign_and_submit_transfer_transaction(): @pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS) -@pytest.mark.network +@pytest.mark.integration +@pytest.mark.ledger def test_get_wealth_positive(caplog): """Test the balance is zero for a new account.""" with caplog.at_level(logging.DEBUG, logger="aea.crypto.ethereum"): diff --git a/tests/test_crypto/test_fetchai.py b/tests/test_crypto/test_fetchai.py index 0dd17a9c5d..cda658102f 100644 --- a/tests/test_crypto/test_fetchai.py +++ b/tests/test_crypto/test_fetchai.py @@ -97,7 +97,8 @@ def test_generate_nonce(): @pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS) -@pytest.mark.network +@pytest.mark.integration +@pytest.mark.ledger def test_construct_sign_and_submit_transfer_transaction(): """Test the construction, signing and submitting of a transfer transaction.""" account = FetchAICrypto(FETCHAI_PRIVATE_KEY_PATH) @@ -149,7 +150,8 @@ def test_construct_sign_and_submit_transfer_transaction(): @pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS) -@pytest.mark.network +@pytest.mark.integration +@pytest.mark.ledger def test_get_balance(): """Test the balance is zero for a new account.""" fetchai_api = FetchAIApi(**FETCHAI_TESTNET_CONFIG) @@ -162,7 +164,8 @@ def test_get_balance(): @pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS) -@pytest.mark.network +@pytest.mark.integration +@pytest.mark.ledger def test_get_wealth_positive(caplog): """Test the balance is zero for a new account.""" with caplog.at_level(logging.DEBUG, logger="aea.crypto.fetchai"): diff --git a/tests/test_docs/test_bash_yaml/md_files/bash-erc1155-skills.md b/tests/test_docs/test_bash_yaml/md_files/bash-erc1155-skills.md index ea35ef7e35..5684441890 100644 --- a/tests/test_docs/test_bash_yaml/md_files/bash-erc1155-skills.md +++ b/tests/test_docs/test_bash_yaml/md_files/bash-erc1155-skills.md @@ -23,7 +23,7 @@ aea generate-key ethereum aea add-key ethereum eth_private_key.txt ``` ``` bash -aea fetch fetchai/erc1155_client:0.7.0 +aea fetch fetchai/erc1155_client:0.8.0 cd erc1155_client aea install ``` @@ -32,7 +32,7 @@ aea create erc1155_client cd erc1155_client aea add connection fetchai/oef:0.5.0 aea add connection fetchai/ledger:0.1.0 -aea add skill fetchai/erc1155_client:0.6.0 +aea add skill fetchai/erc1155_client:0.7.0 aea install aea config set agent.default_connection fetchai/oef:0.5.0 ``` diff --git a/tests/test_docs/test_orm_integration/test_orm_integration.py b/tests/test_docs/test_orm_integration/test_orm_integration.py index d29c525b39..09f0aba522 100644 --- a/tests/test_docs/test_orm_integration/test_orm_integration.py +++ b/tests/test_docs/test_orm_integration/test_orm_integration.py @@ -125,7 +125,6 @@ class TestOrmIntegrationDocs(AEATestCaseMany, UseOef): """This class contains the tests for the orm-integration.md guide.""" - @pytest.mark.unstable @pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS) def test_orm_integration_docs_example(self): """Run the weather skills sequence.""" @@ -207,7 +206,7 @@ def test_orm_integration_docs_example(self): "transaction confirmed, sending data=", ) missing_strings = self.missing_from_output( - seller_aea_process, check_strings, timeout=180, is_terminating=False + seller_aea_process, check_strings, timeout=240, is_terminating=False ) assert ( missing_strings == [] diff --git a/tests/test_packages/test_connections/test_ledger/test_contract_api.py b/tests/test_packages/test_connections/test_ledger/test_contract_api.py index 4e114b9230..93cbfbc3cc 100644 --- a/tests/test_packages/test_connections/test_ledger/test_contract_api.py +++ b/tests/test_packages/test_connections/test_ledger/test_contract_api.py @@ -52,7 +52,8 @@ async def ledger_apis_connection(request): await connection.disconnect() -@pytest.mark.network +@pytest.mark.integration +@pytest.mark.ledger @pytest.mark.asyncio async def test_erc1155_get_deploy_transaction(erc1155_contract, ledger_apis_connection): """Test get state with contract erc1155.""" @@ -94,7 +95,8 @@ async def test_erc1155_get_deploy_transaction(erc1155_contract, ledger_apis_conn assert len(response.message.raw_transaction.body["data"]) > 0 -@pytest.mark.network +@pytest.mark.integration +@pytest.mark.ledger @pytest.mark.asyncio async def test_erc1155_get_raw_transaction(erc1155_contract, ledger_apis_connection): """Test get state with contract erc1155.""" @@ -140,7 +142,8 @@ async def test_erc1155_get_raw_transaction(erc1155_contract, ledger_apis_connect assert len(response.message.raw_transaction.body["data"]) > 0 -@pytest.mark.network +@pytest.mark.integration +@pytest.mark.ledger @pytest.mark.asyncio async def test_erc1155_get_raw_message(erc1155_contract, ledger_apis_connection): """Test get state with contract erc1155.""" @@ -193,7 +196,8 @@ async def test_erc1155_get_raw_message(erc1155_contract, ledger_apis_connection) assert type(response.message.raw_message.body) == bytes -@pytest.mark.network +@pytest.mark.integration +@pytest.mark.ledger @pytest.mark.asyncio async def test_erc1155_get_state(erc1155_contract, ledger_apis_connection): """Test get state with contract erc1155.""" diff --git a/tests/test_packages/test_connections/test_ledger/test_ledger_api.py b/tests/test_packages/test_connections/test_ledger/test_ledger_api.py index 93e90b672e..fbdf5c623b 100644 --- a/tests/test_packages/test_connections/test_ledger/test_ledger_api.py +++ b/tests/test_packages/test_connections/test_ledger/test_ledger_api.py @@ -46,7 +46,7 @@ from tests.conftest import ( COSMOS_ADDRESS_ONE, COSMOS_TESTNET_CONFIG, - # ETHEREUM_ADDRESS_ONE, + ETHEREUM_ADDRESS_ONE, ETHEREUM_PRIVATE_KEY_PATH, ETHEREUM_TESTNET_CONFIG, FETCHAI_ADDRESS_ONE, @@ -61,7 +61,7 @@ "ledger_id,address,config", [ (FetchAICrypto.identifier, FETCHAI_ADDRESS_ONE, FETCHAI_TESTNET_CONFIG), - # (EthereumCrypto.identifier, ETHEREUM_ADDRESS_ONE, ETHEREUM_TESTNET_CONFIG), TODO: fix unstable + (EthereumCrypto.identifier, ETHEREUM_ADDRESS_ONE, ETHEREUM_TESTNET_CONFIG), (CosmosCrypto.identifier, COSMOS_ADDRESS_ONE, COSMOS_TESTNET_CONFIG), ], ) @@ -81,7 +81,8 @@ async def ledger_apis_connection(request): await connection.disconnect() -@pytest.mark.network +@pytest.mark.integration +@pytest.mark.ledger @pytest.mark.asyncio @ledger_ids async def test_get_balance( @@ -126,6 +127,7 @@ async def test_get_balance( @pytest.mark.integration +@pytest.mark.ledger @pytest.mark.asyncio async def test_send_signed_transaction_ethereum(ledger_apis_connection: Connection): """Test send signed transaction with Ethereum APIs.""" diff --git a/tests/test_packages/test_contracts/test_erc1155/test_contract.py b/tests/test_packages/test_contracts/test_erc1155/test_contract.py index 375217e249..f935bf2452 100644 --- a/tests/test_packages/test_contracts/test_erc1155/test_contract.py +++ b/tests/test_packages/test_contracts/test_erc1155/test_contract.py @@ -52,7 +52,8 @@ def crypto_api(request): yield api -@pytest.mark.network +@pytest.mark.integration +@pytest.mark.ledger def test_helper_methods_and_get_transactions(ledger_api, erc1155_contract): expected_a = [ 340282366920938463463374607431768211456, @@ -139,6 +140,8 @@ def test_helper_methods_and_get_transactions(ledger_api, erc1155_contract): ), "Error, found: {}".format(tx) +@pytest.mark.integration +@pytest.mark.ledger def test_get_single_atomic_swap(ledger_api, crypto_api, erc1155_contract): contract_address = "0x250A2aeb3eB84782e83365b4c42dbE3CDA9920e4" from_address = ETHEREUM_ADDRESS_ONE @@ -184,6 +187,8 @@ def test_get_single_atomic_swap(ledger_api, crypto_api, erc1155_contract): ), "Error, found: {}".format(tx) +@pytest.mark.integration +@pytest.mark.ledger def test_get_batch_atomic_swap(ledger_api, crypto_api, erc1155_contract): contract_address = "0x250A2aeb3eB84782e83365b4c42dbE3CDA9920e4" from_address = ETHEREUM_ADDRESS_ONE diff --git a/tests/test_packages/test_skills/test_carpark.py b/tests/test_packages/test_skills/test_carpark.py index ff767a2547..50e2010848 100644 --- a/tests/test_packages/test_skills/test_carpark.py +++ b/tests/test_packages/test_skills/test_carpark.py @@ -184,7 +184,7 @@ def test_carpark(self): "transaction confirmed, sending data=", ) missing_strings = self.missing_from_output( - carpark_aea_process, check_strings, timeout=180, is_terminating=False + carpark_aea_process, check_strings, timeout=240, is_terminating=False ) assert ( missing_strings == [] diff --git a/tests/test_packages/test_skills/test_erc1155.py b/tests/test_packages/test_skills/test_erc1155.py index 491c364ec2..5546b42ed8 100644 --- a/tests/test_packages/test_skills/test_erc1155.py +++ b/tests/test_packages/test_skills/test_erc1155.py @@ -29,10 +29,11 @@ ) -@pytest.mark.ethereum class TestERCSkillsEthereumLedger(AEATestCaseMany, UseOef): """Test that erc1155 skills work.""" + @pytest.mark.integration + @pytest.mark.ledger @pytest.mark.flaky(reruns=MAX_FLAKY_RERUNS_ETH) # cause possible network issues def test_generic(self): """Run the generic skills sequence.""" @@ -84,6 +85,7 @@ def test_generic(self): self.run_install() # add packages for agent two + setting_path = "agent.ledger_apis" self.set_agent_context(client_aea_name) self.force_set_config(setting_path, ledger_apis) self.add_item("connection", "fetchai/oef:0.5.0") @@ -92,10 +94,10 @@ def test_generic(self): self.set_config("agent.default_ledger", "ethereum") setting_path = "agent.default_routing" self.force_set_config(setting_path, default_routing) - self.add_item("skill", "fetchai/erc1155_client:0.6.0") + self.add_item("skill", "fetchai/erc1155_client:0.7.0") diff = self.difference_to_fetched_agent( - "fetchai/erc1155_client:0.7.0", client_aea_name + "fetchai/erc1155_client:0.8.0", client_aea_name ) assert ( diff == [] @@ -113,7 +115,7 @@ def test_generic(self): # run agents self.set_agent_context(deploy_aea_name) - deploy_aea_process = self.run_agent("--connections", "fetchai/oef:0.5.0") + deploy_aea_process = self.run_agent() check_strings = ( "starting balance on ethereum ledger=", @@ -123,7 +125,7 @@ def test_generic(self): "sending transaction to ledger.", "transaction was successfully submitted. Transaction digest=", "requesting transaction receipt.", - "transaction was successfully settled. Transaction receipt=" + "transaction was successfully settled. Transaction receipt=", "Requesting create batch transaction...", "Requesting mint batch transaction...", ) @@ -135,7 +137,7 @@ def test_generic(self): ), "Strings {} didn't appear in deploy_aea output.".format(missing_strings) self.set_agent_context(client_aea_name) - client_aea_process = self.run_agent("--connections", "fetchai/oef:0.5.0") + client_aea_process = self.run_agent() check_strings = ( "Sending PROPOSE to agent=", diff --git a/tests/test_packages/test_skills/test_generic.py b/tests/test_packages/test_skills/test_generic.py index daf8508b6a..82fc4ea764 100644 --- a/tests/test_packages/test_skills/test_generic.py +++ b/tests/test_packages/test_skills/test_generic.py @@ -204,7 +204,7 @@ def test_generic(self, pytestconfig): "transaction confirmed, sending data=", ) missing_strings = self.missing_from_output( - seller_aea_process, check_strings, timeout=180, is_terminating=False + seller_aea_process, check_strings, timeout=240, is_terminating=False ) assert ( missing_strings == [] diff --git a/tests/test_packages/test_skills/test_ml_skills.py b/tests/test_packages/test_skills/test_ml_skills.py index 7c12003604..815ec9b5c2 100644 --- a/tests/test_packages/test_skills/test_ml_skills.py +++ b/tests/test_packages/test_skills/test_ml_skills.py @@ -191,7 +191,7 @@ def test_ml_skills(self, pytestconfig): "a Data message:", ) missing_strings = self.missing_from_output( - data_provider_aea_process, check_strings, timeout=180, is_terminating=False + data_provider_aea_process, check_strings, timeout=240, is_terminating=False ) assert ( missing_strings == [] diff --git a/tests/test_packages/test_skills/test_tac.py b/tests/test_packages/test_skills/test_tac.py index b80d0f4ae8..ffd1bcf07f 100644 --- a/tests/test_packages/test_skills/test_tac.py +++ b/tests/test_packages/test_skills/test_tac.py @@ -124,7 +124,7 @@ def test_tac(self): "Current good & money allocation & score:", ) missing_strings = self.missing_from_output( - tac_controller_process, check_strings, timeout=180, is_terminating=False + tac_controller_process, check_strings, timeout=240, is_terminating=False ) assert ( missing_strings == [] @@ -148,7 +148,7 @@ def test_tac(self): "Declining propose", ) missing_strings = self.missing_from_output( - tac_aea_one_process, check_strings, timeout=180, is_terminating=False + tac_aea_one_process, check_strings, timeout=240, is_terminating=False ) assert ( missing_strings == [] @@ -268,7 +268,7 @@ def test_tac(self): "TAC open for registration until:", ) missing_strings = self.missing_from_output( - tac_controller_process, check_strings, timeout=180, is_terminating=False + tac_controller_process, check_strings, timeout=240, is_terminating=False ) assert ( missing_strings == [] diff --git a/tests/test_packages/test_skills/test_thermometer.py b/tests/test_packages/test_skills/test_thermometer.py index a095d18ee2..b8d2754408 100644 --- a/tests/test_packages/test_skills/test_thermometer.py +++ b/tests/test_packages/test_skills/test_thermometer.py @@ -190,7 +190,7 @@ def test_thermometer(self): "transaction confirmed, sending data=", ) missing_strings = self.missing_from_output( - thermometer_aea_process, check_strings, timeout=180, is_terminating=False + thermometer_aea_process, check_strings, timeout=240, is_terminating=False ) assert ( missing_strings == [] diff --git a/tests/test_packages/test_skills/test_weather.py b/tests/test_packages/test_skills/test_weather.py index d89ecfe3ec..5962efcfe0 100644 --- a/tests/test_packages/test_skills/test_weather.py +++ b/tests/test_packages/test_skills/test_weather.py @@ -186,7 +186,7 @@ def test_weather(self): "transaction confirmed, sending data=", ) missing_strings = self.missing_from_output( - weather_station_process, check_strings, timeout=180, is_terminating=False + weather_station_process, check_strings, timeout=240, is_terminating=False ) assert ( missing_strings == []