From d40e8750912aa78fea256471bed173553d4d8c7a Mon Sep 17 00:00:00 2001 From: Ekaterina Chernitsyna Date: Thu, 3 Aug 2023 12:41:03 +0300 Subject: [PATCH] regex for versions ready --- pytest_tests/resources/common.py | 1 - .../testsuites/services/test_binaries.py | 26 +++++++------------ 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/pytest_tests/resources/common.py b/pytest_tests/resources/common.py index 6d93bc9..40fe682 100644 --- a/pytest_tests/resources/common.py +++ b/pytest_tests/resources/common.py @@ -2,6 +2,5 @@ import os TEST_CYCLES_COUNT = int(os.getenv("TEST_CYCLES_COUNT", "1")) -BIN_VERSIONS_FILE = os.getenv("BIN_VERSIONS_FILE") DEVENV_PATH = os.getenv("DEVENV_PATH", os.path.join("..", "frostfs-dev-env")) HOSTING_CONFIG_FILE = os.getenv("HOSTING_CONFIG_FILE", ".devenv.hosting.yaml") diff --git a/pytest_tests/testsuites/services/test_binaries.py b/pytest_tests/testsuites/services/test_binaries.py index 47a9545..c7dc036 100644 --- a/pytest_tests/testsuites/services/test_binaries.py +++ b/pytest_tests/testsuites/services/test_binaries.py @@ -1,7 +1,7 @@ import logging import os from http import HTTPStatus -from re import match +from re import match, fullmatch import allure import pytest @@ -12,23 +12,15 @@ from frostfs_testlib.utils.env_utils import read_env_properties, save_env_proper from frostfs_testlib.utils.version_utils import get_remote_binaries_versions from pytest import FixtureRequest -from pytest_tests.resources.common import BIN_VERSIONS_FILE - logger = logging.getLogger("NeoLogger") - @allure.title("Check binaries versions") @pytest.mark.sanity @pytest.mark.check_binaries -@pytest.mark.skip("Skipped due to https://j.yadro.com/browse/OBJECT-628") def test_binaries_versions(request: FixtureRequest, hosting: Hosting): """ Compare binaries versions from external source (url) and deployed on servers. """ - if not BIN_VERSIONS_FILE: - pytest.skip("File with binaries and versions was not provided") - - binaries_to_check = download_versions_info(BIN_VERSIONS_FILE) with allure.step("Get binaries versions from servers"): got_versions = get_remote_binaries_versions(hosting) @@ -37,24 +29,24 @@ def test_binaries_versions(request: FixtureRequest, hosting: Hosting): env_properties = read_env_properties(env_file) # compare versions from servers and file - failed_versions = {} + exeptions = [] additional_env_properties = {} - for binary, version in binaries_to_check.items(): - actual_version = got_versions.get(binary) - if actual_version != version: - failed_versions[binary] = f"Expected version {version}, found version {actual_version}" + + for binary, version in got_versions.items(): + if not fullmatch(r"^\d+\.\d+\.\d+(-.*)?(?