All checks were successful
DCO action / DCO (pull_request) Successful in 23s
Signed-off-by: a.berezin <a.berezin@yadro.com>
52 lines
1.5 KiB
Python
52 lines
1.5 KiB
Python
import logging
|
|
import os
|
|
from datetime import datetime
|
|
from importlib.metadata import entry_points
|
|
|
|
import pytest
|
|
import yaml
|
|
|
|
from frostfs_testlib import reporter
|
|
from frostfs_testlib.hosting.hosting import Hosting
|
|
from frostfs_testlib.resources.common import ASSETS_DIR, HOSTING_CONFIG_FILE
|
|
from frostfs_testlib.storage import get_service_registry
|
|
|
|
|
|
@pytest.fixture(scope="session", autouse=True)
|
|
def session_start_time():
|
|
start_time = datetime.utcnow()
|
|
return start_time
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def configure_testlib():
|
|
reporter.get_reporter().register_handler(reporter.AllureHandler())
|
|
reporter.get_reporter().register_handler(reporter.StepsLogger())
|
|
logging.getLogger("paramiko").setLevel(logging.INFO)
|
|
|
|
# Register Services for cluster
|
|
registry = get_service_registry()
|
|
services = entry_points(group="frostfs.testlib.services")
|
|
for svc in services:
|
|
registry.register_service(svc.name, svc.load())
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def temp_directory(configure_testlib):
|
|
with reporter.step("Prepare tmp directory"):
|
|
full_path = ASSETS_DIR
|
|
if not os.path.exists(full_path):
|
|
os.mkdir(full_path)
|
|
|
|
return full_path
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def hosting(configure_testlib) -> Hosting:
|
|
with open(HOSTING_CONFIG_FILE, "r") as file:
|
|
hosting_config = yaml.full_load(file)
|
|
|
|
hosting_instance = Hosting()
|
|
hosting_instance.configure(hosting_config)
|
|
|
|
return hosting_instance
|