Fix usage of temp_dir fixture

Signed-off-by: Vladimir Domnich <v.domnich@yadro.com>
develop
Vladimir Domnich 2022-07-12 12:23:48 +04:00
parent 93a52b4a66
commit f60020f5aa
4 changed files with 27 additions and 23 deletions

10
.gitignore vendored
View File

@ -1,3 +1,6 @@
# ignore IDE files
.vscode
# ignore test results
**/log.html
**/output.xml
@ -6,8 +9,13 @@
allure_results/*
xunit_results.xml
# ignore pycache under any path
# ignore caches under any path
**/__pycache__
**/.pytest_cache
# ignore work directories and setup files
.setup
.env
TemporaryDir/*
artifacts/*
docs/*

View File

@ -8,12 +8,9 @@ OUTPUT_DIR = artifacts/
KEYWORDS_REPO = git@github.com:nspcc-dev/neofs-keywords.git
VENVS = $(shell ls -1d venv/*/ | sort -u | xargs basename -a)
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
DEV_IMAGE_PY ?= registry.spb.yadro.com/tools/pytest-neofs-x86_64:6
ifdef DEVENV_SERVICES_PATH
RUN_OPTIONS += -v $(DEVENV_SERVICES_PATH)/chain/node-wallet.json:/wallets/mainnet.json -e MAINNET_WALLET_PATH_HOST="/wallets/mainnet.json"
RUN_OPTIONS += -v $(DEVENV_SERVICES_PATH)/ir/wallet01.json:/wallets/ir.json -e IR_WALLET_PATH="/wallets/ir.json"
endif
DEV_IMAGE_PY ?= registry.spb.yadro.com/tools/pytest-neofs-x86_64:7
SETUP_DIR ?= $(CURDIR)/.setup
DEV_ENV_DEPLOY_DIR ?= /opt/dev-env
ifeq ($(shell uname -s),Darwin)
DOCKER_NETWORK = --network bridge -p 389:389 -p 636:636

View File

@ -38,23 +38,21 @@ def check_binary_versions(request):
@pytest.fixture(scope='session')
@allure.title('Init wallet with address')
def init_wallet_with_address():
full_path = f'{os.getcwd()}/{ASSETS_DIR}'
os.mkdir(full_path)
yield wallet.init_wallet(ASSETS_DIR)
@allure.title('Prepare tmp directory')
def prepare_tmp_dir():
full_path = f'{os.getcwd()}/{ASSETS_DIR}'
shutil.rmtree(full_path, ignore_errors=True)
os.mkdir(full_path)
yield
yield full_path
shutil.rmtree(full_path)
@pytest.fixture(scope='session')
@allure.title('Init wallet with address')
def init_wallet_with_address(prepare_tmp_dir):
yield wallet.init_wallet(ASSETS_DIR)
@pytest.fixture(scope='session')
@allure.title('Prepare wallet and deposit')
def prepare_wallet_and_deposit(init_wallet_with_address):

View File

@ -30,6 +30,7 @@ NEOFS_CONTRACT = os.getenv("NEOFS_IR_CONTRACTS_NEOFS")
ASSETS_DIR = os.getenv("ASSETS_DIR", "TemporaryDir/")
DEVENV_PATH = os.getenv("DEVENV_PATH", "../neofs-dev-env")
CLI_CONFIGS_PATH = os.getenv("CLI_CONFIGS_PATH", f"{os.getcwd()}/neofs_cli_configs")
MORPH_MAGIC = os.getenv("MORPH_MAGIC")
@ -79,16 +80,16 @@ NEOFS_NETMAP = [i['rpc'] for i in NEOFS_NETMAP_DICT.values()]
NEOGO_EXECUTABLE = os.getenv('NEOGO_EXECUTABLE', 'neo-go')
NEOFS_CLI_EXEC = os.getenv('NEOFS_CLI_EXEC', 'neofs-cli')
WALLET_CONFIG = f"{os.getcwd()}/neofs_cli_configs/empty_passwd.yml"
WALLET_CONFIG = f"{CLI_CONFIGS_PATH}/empty_passwd.yml"
MAINNET_WALLET_PATH = os.getenv("MAINNET_WALLET_PATH", f"{DEVENV_PATH}/services/chain/node-wallet.json")
MAINNET_WALLET_CONFIG = f"{os.getcwd()}/neofs_cli_configs/one_wallet_password.yml"
MAINNET_WALLET_CONFIG = f"{CLI_CONFIGS_PATH}/one_wallet_password.yml"
MAINNET_SINGLE_ADDR = 'NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP'
MAINNET_WALLET_PASS = 'one'
MAINNET_WALLET_PASS = os.getenv("MAINNET_WALLET_PASS", "one")
IR_WALLET_PATH = os.getenv("IR_WALLET_PATH", f"{DEVENV_PATH}/services/ir/wallet01.json")
IR_WALLET_CONFIG = f"{os.getcwd()}/neofs_cli_configs/one_wallet_password.yml"
IR_WALLET_PASS = 'one'
S3_GATE_WALLET_PATH = f"{DEVENV_PATH}/services/s3_gate/wallet.json"
S3_GATE_WALLET_PASS = 's3'
IR_WALLET_CONFIG = os.getenv("IR_WALLET_CONFIG", f"{CLI_CONFIGS_PATH}/one_wallet_password.yml")
IR_WALLET_PASS = os.getenv("IR_WALLET_PASS", "one")
S3_GATE_WALLET_PATH = os.getenv("S3_GATE_WALLET_PATH", f"{DEVENV_PATH}/services/s3_gate/wallet.json")
S3_GATE_WALLET_PASS = os.getenv("S3_GATE_WALLET_PASS", "s3")
STORAGE_NODE_USER = os.getenv('STORAGE_NODE_USER', 'root')
STORAGE_NODE_PWD = os.getenv('STORAGE_NODE_PWD')