Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Add functionality to deploy custom neofs environments #81

Merged
merged 2 commits into from
Dec 15, 2023

Conversation

evgeniiz321
Copy link
Contributor

Closes nspcc-dev/neofs-testcases#672

I've tried to remove as much code as possible to ease the review. In this PR:

  • single test to verify deployment of a 'simple' env with 1 IR 1 SN 1 S3GW and show how to use created classes
  • base class for NeoFSEnv and separate classes for IR, SN, S3GW

Everything should be self descriptive without additional comments, if not - leave a comment.

Evgeniy Zayats added 2 commits December 9, 2023 17:14


@pytest.fixture
def s3_creds(neofs_env: NeoFSEnv, zero_fee, wallet: NodeWallet) -> tuple:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

S3 as a part of base env?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this particular case - yes. But actually any kind of env is configured via this kind of classmethods or fixtures:

  @classmethod
    def simple(cls) -> "NeoFSEnv":
        neofs_env = NeoFSEnv()
        neofs_env.deploy_inner_ring_node()
        neofs_env.deploy_storage_node()
        neofs_env.deploy_s3_gw()
        return neofs_env

So we can have whatever we want. But for the purpose of this PR - to have a working example - I use s3 gate here.

self.neofs_s3_authmate_path = os.getenv("NEOFS_S3_AUTHMATE_BIN", "./neofs-s3-authmate")
self.neofs_s3_gw_path = os.getenv("NEOFS_S3_GW_BIN", "./neofs-s3-gw")
self.neofs_rest_gw_path = os.getenv("NEOFS_REST_GW_BIN", "./neofs-rest-gw")
self.neofs_http_gw_path = os.getenv("NEOFS_HTTP_GW_BIN", "./neofs-http-gw")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd better have gateways defined separately somewhere, many tests don't care about them at all. Those who care, should just run an instance as needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a definition of gateways, it is just the way to organize env vars in one place. If tests don't care - they won't use it, there is no requirement to specify any of these env vars. Gateways are indeed separate classes (you can see the class for s3 gateway in this PR). I can move related paths there, but it seems to be more convenient to have them in one place.

@roman-khimov roman-khimov merged commit 0d63888 into nspcc-dev:master Dec 15, 2023
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Network setup test
2 participants