From f14e3846a93c69882d8d0f0def4a0616b7ce1304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83lina=20Cenan?= Date: Thu, 7 Sep 2023 21:55:15 +0300 Subject: [PATCH] Unskip c2d tests and apply disk optimisation like in Provider. (#1471) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Unskip c2d tests and apply disk optimisation like in Provider. * Update provider version. * Remove veDelegationProxy and prepare libcheck. * Remove custom barge provider version. * Bump version: 3.0.1 → 3.0.2 --- .bumpversion.cfg | 2 +- .github/workflows/libcheck.yml | 17 +++++++++++++++-- .github/workflows/pytest.yml | 17 +++++++++++++++-- READMEs/df.md | 1 - ocean_lib/__init__.py | 2 +- .../test/test_data_service_provider.py | 3 --- .../models/ve/test/test_ve_delegation_proxy.py | 11 ----------- ocean_lib/models/ve/ve_delegation_proxy.py | 9 --------- ocean_lib/ocean/ocean.py | 6 ------ ocean_lib/ocean/test/test_ocean.py | 2 -- setup.py | 2 +- tests/integration/ganache/test_compute_flow.py | 7 ------- tests/readmes/test_readmes.py | 2 +- 13 files changed, 34 insertions(+), 47 deletions(-) delete mode 100644 ocean_lib/models/ve/test/test_ve_delegation_proxy.py delete mode 100644 ocean_lib/models/ve/ve_delegation_proxy.py diff --git a/.bumpversion.cfg b/.bumpversion.cfg index e98c19e7b..37370cd6a 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.0.1 +current_version = 3.0.2 commit = True tag = True diff --git a/.github/workflows/libcheck.yml b/.github/workflows/libcheck.yml index 7da51147a..f73510a88 100644 --- a/.github/workflows/libcheck.yml +++ b/.github/workflows/libcheck.yml @@ -30,10 +30,10 @@ jobs: env: GANACHE_HARDFORK: london run: | - bash -x start_ocean.sh --no-dashboard 2>&1 --with-provider2 > start_ocean.log & + bash -x start_ocean.sh --no-dashboard 2>&1 --with-provider2 --with-c2d > start_ocean.log & for i in $(seq 1 108); do sleep 5 - [ -f "$HOME/.ocean/ocean-contracts/artifacts/ready" ] && break + [ -f "$HOME/.ocean/ocean-contracts/artifacts/ready" -a -f "$HOME/.ocean/ocean-c2d/ready" ] && break done ls -la "$HOME/.ocean/ocean-contracts/artifacts/" - name: Install dependencies @@ -42,6 +42,19 @@ jobs: python -m pip install --upgrade pip pip install ocean-lib pip install mkcodes pytest matplotlib + - name: Delete default runner images + run: | + docker image rm node:14 + docker image rm node:14-alpine + docker image rm node:16 + docker image rm node:16-alpine + docker image rm node:18 + docker image rm node:18-alpine + docker image rm buildpack-deps:buster + docker image rm buildpack-deps:bullseye + docker image rm debian:10 + docker image rm debian:11 + docker image rm moby/buildkit:latest - name: Generate and test readmes working-directory: ${{ github.workspace }} env: diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index cbc6194c9..81afa3823 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -32,18 +32,31 @@ jobs: env: GANACHE_HARDFORK: london run: | - bash -x start_ocean.sh --no-dashboard 2>&1 --with-provider2 --with-thegraph --skip-subgraph-deploy > start_ocean.log & + bash -x start_ocean.sh --no-dashboard 2>&1 --with-provider2 --with-thegraph --with-c2d --skip-subgraph-deploy > start_ocean.log & - name: Install dependencies working-directory: ${{ github.workspace }} run: | python -m pip install --upgrade pip pip install -r requirements_dev.txt + - name: Delete default runner images + run: | + docker image rm node:14 + docker image rm node:14-alpine + docker image rm node:16 + docker image rm node:16-alpine + docker image rm node:18 + docker image rm node:18-alpine + docker image rm buildpack-deps:buster + docker image rm buildpack-deps:bullseye + docker image rm debian:10 + docker image rm debian:11 + docker image rm moby/buildkit:latest - name: Wait for contracts deployment working-directory: ${{ github.workspace }}/barge run: | for i in $(seq 1 250); do sleep 5 - [ -f "$HOME/.ocean/ocean-contracts/artifacts/ready" ] && break + [ -f "$HOME/.ocean/ocean-contracts/artifacts/ready" -a -f "$HOME/.ocean/ocean-c2d/ready" ] && break done - name: "Read address.json contents" working-directory: ${{ github.workspace }} diff --git a/READMEs/df.md b/READMEs/df.md index 3ff7836ed..ac2ba56f8 100644 --- a/READMEs/df.md +++ b/READMEs/df.md @@ -176,7 +176,6 @@ It provides convenient access to [DF](https://github.com/oceanprotocol/ocean.py/ - `ocean.smart_wallet_checker -> SmartWalletChecker` - `ocean.ve_allocate -> VeAllocate` - `ocean.ve_delegation -> VeDelegation` -- `ocean.ve_delegation_proxy -> VeDelegationProxy` - `ocean.ve_fee_distributor -> VeFeeDistributor` - `ocean.ve_fee_estimate(self) -> VeFeeEstimate` diff --git a/ocean_lib/__init__.py b/ocean_lib/__init__.py index 8c9f81d01..db21ae46c 100644 --- a/ocean_lib/__init__.py +++ b/ocean_lib/__init__.py @@ -7,5 +7,5 @@ __author__ = """OceanProtocol""" # fmt: off -__version__ = '3.0.1' +__version__ = '3.0.2' # fmt: on diff --git a/ocean_lib/data_provider/test/test_data_service_provider.py b/ocean_lib/data_provider/test/test_data_service_provider.py index e31567a0d..92a37ca18 100644 --- a/ocean_lib/data_provider/test/test_data_service_provider.py +++ b/ocean_lib/data_provider/test/test_data_service_provider.py @@ -144,7 +144,6 @@ def test_send_compute_request_failure(with_evil_client, provider_wallet): ) -@pytest.mark.skip(reason="Need to fix c2d CI containers in #1449") @pytest.mark.unit def test_compute_job_result_fails(provider_wallet): """Tests failure of compute job starting.""" @@ -164,7 +163,6 @@ def test_compute_job_result_fails(provider_wallet): DataSP.compute_job_result("some_job_id", 0, mock_service, provider_wallet) -@pytest.mark.skip(reason="Need to fix c2d CI containers in #1449") @pytest.mark.unit def test_delete_job_result(provider_wallet): """Tests a failure & a success of compute job deletion.""" @@ -278,7 +276,6 @@ def test_expose_endpoints(): ] -@pytest.mark.skip(reason="Need to fix c2d CI containers in #1449") @pytest.mark.integration def test_c2d_environments(): """Tests that the test ocean-compute env exists on the DataServiceProvider.""" diff --git a/ocean_lib/models/ve/test/test_ve_delegation_proxy.py b/ocean_lib/models/ve/test/test_ve_delegation_proxy.py deleted file mode 100644 index 5380a380b..000000000 --- a/ocean_lib/models/ve/test/test_ve_delegation_proxy.py +++ /dev/null @@ -1,11 +0,0 @@ -# -# Copyright 2023 Ocean Protocol Foundation -# SPDX-License-Identifier: Apache-2.0 -# -import pytest - - -@pytest.mark.unit -def test1(ocean): - # df-py/util/test has thorough tests, so keep it super-simple here - assert ocean.ve_delegation_proxy.address is not None diff --git a/ocean_lib/models/ve/ve_delegation_proxy.py b/ocean_lib/models/ve/ve_delegation_proxy.py deleted file mode 100644 index 15430e7f6..000000000 --- a/ocean_lib/models/ve/ve_delegation_proxy.py +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright 2023 Ocean Protocol Foundation -# SPDX-License-Identifier: Apache-2.0 -# -from ocean_lib.web3_internal.contract_base import ContractBase - - -class VeDelegationProxy(ContractBase): - CONTRACT_NAME = "veDelegationProxy" diff --git a/ocean_lib/ocean/ocean.py b/ocean_lib/ocean/ocean.py index de558a243..28962f5a3 100644 --- a/ocean_lib/ocean/ocean.py +++ b/ocean_lib/ocean/ocean.py @@ -26,7 +26,6 @@ from ocean_lib.models.ve.smart_wallet_checker import SmartWalletChecker from ocean_lib.models.ve.ve_allocate import VeAllocate from ocean_lib.models.ve.ve_delegation import VeDelegation -from ocean_lib.models.ve.ve_delegation_proxy import VeDelegationProxy from ocean_lib.models.ve.ve_fee_distributor import VeFeeDistributor from ocean_lib.models.ve.ve_fee_estimate import VeFeeEstimate from ocean_lib.models.ve.ve_ocean import VeOcean @@ -235,11 +234,6 @@ def ve_allocate(self) -> VeAllocate: def ve_delegation(self) -> VeDelegation: return VeDelegation(self.config, self._addr("veDelegation")) - @property - @enforce_types - def ve_delegation_proxy(self) -> VeDelegationProxy: - return VeDelegationProxy(self.config, self._addr("veDelegationProxy")) - @property @enforce_types def ve_fee_distributor(self) -> VeFeeDistributor: diff --git a/ocean_lib/ocean/test/test_ocean.py b/ocean_lib/ocean/test/test_ocean.py index 996a198e4..624075e8f 100644 --- a/ocean_lib/ocean/test/test_ocean.py +++ b/ocean_lib/ocean/test/test_ocean.py @@ -14,7 +14,6 @@ from ocean_lib.models.ve.smart_wallet_checker import SmartWalletChecker from ocean_lib.models.ve.ve_allocate import VeAllocate from ocean_lib.models.ve.ve_delegation import VeDelegation -from ocean_lib.models.ve.ve_delegation_proxy import VeDelegationProxy from ocean_lib.models.ve.ve_fee_distributor import VeFeeDistributor from ocean_lib.models.ve.ve_fee_estimate import VeFeeEstimate from ocean_lib.models.ve.ve_ocean import VeOcean @@ -53,7 +52,6 @@ def test_contract_objects(publisher_ocean): assert isinstance(ocean.smart_wallet_checker, SmartWalletChecker) assert isinstance(ocean.ve_allocate, VeAllocate) assert isinstance(ocean.ve_delegation, VeDelegation) - assert isinstance(ocean.ve_delegation_proxy, VeDelegationProxy) assert isinstance(ocean.ve_fee_distributor, VeFeeDistributor) assert isinstance(ocean.ve_fee_estimate, VeFeeEstimate) assert isinstance(ocean.ve_ocean, VeOcean) diff --git a/setup.py b/setup.py index 221325beb..a6abc074d 100644 --- a/setup.py +++ b/setup.py @@ -89,7 +89,7 @@ url="https://github.com/oceanprotocol/ocean.py", # fmt: off # bumpversion.sh needs single-quotes - version='3.0.1', + version='3.0.2', # fmt: on zip_safe=False, ) diff --git a/tests/integration/ganache/test_compute_flow.py b/tests/integration/ganache/test_compute_flow.py index 74e4b13c2..0f1124071 100644 --- a/tests/integration/ganache/test_compute_flow.py +++ b/tests/integration/ganache/test_compute_flow.py @@ -80,7 +80,6 @@ def wait_for_ddo(self, ddo): return self.published_ddos[ddo.did] - @pytest.mark.skip(reason="Need to fix c2d CI containers in #1449") @pytest.mark.integration def test_compute_raw_algo( self, @@ -114,7 +113,6 @@ def test_compute_raw_algo( algorithm_meta=raw_algorithm, ) - @pytest.mark.skip(reason="Need to fix c2d CI containers in #1449") @pytest.mark.integration def test_compute_registered_algo( self, @@ -136,7 +134,6 @@ def test_compute_registered_algo( algorithm_and_userdata=AssetAndUserdata(self.algorithm, None), ) - @pytest.mark.skip(reason="Need to fix c2d CI containers in #1449") @pytest.mark.integration def test_compute_reuse_order( self, @@ -159,7 +156,6 @@ def test_compute_reuse_order( scenarios=["reuse_order"], ) - @pytest.mark.skip(reason="Need to fix c2d CI containers in #1449") @pytest.mark.integration def test_compute_multi_inputs( self, @@ -193,7 +189,6 @@ def test_compute_trusted_algorithm(self): # functionality covered in test_compute_update_trusted_algorithm assert True - @pytest.mark.skip(reason="Need to fix c2d CI containers in #1449") @pytest.mark.integration def test_compute_update_trusted_algorithm( self, @@ -245,7 +240,6 @@ def test_compute_update_trusted_algorithm( scenarios=["with_result"], ) - @pytest.mark.skip(reason="Need to fix c2d CI containers in #1449") @pytest.mark.integration def test_compute_trusted_publisher( self, @@ -283,7 +277,6 @@ def test_compute_trusted_publisher( ), ) - @pytest.mark.skip(reason="Need to fix c2d CI containers in #1449") @pytest.mark.integration def test_compute_just_provider_fees( self, diff --git a/tests/readmes/test_readmes.py b/tests/readmes/test_readmes.py index 26350e153..386a1c0b1 100644 --- a/tests/readmes/test_readmes.py +++ b/tests/readmes/test_readmes.py @@ -49,7 +49,7 @@ def test_script_execution(self, script_name): "publish-flow-restapi", # TODO: fix and restore "gas-strategy-remote", # "using-clef", # TODO: removed original clef readme, to reinstate in #1461 - "c2d-flow", # TODO: fix c2d CI containers in #1449 and restore afterwards + "c2d-flow", ] if script_name.replace("test_", "").replace(".py", "") in skippable: