forked from TrueCloudLab/frostfs-testcases
[#189] parallel get remote binaries versions
This commit is contained in:
parent
46e57870d0
commit
566f1a425f
2 changed files with 8 additions and 6 deletions
|
@ -326,7 +326,7 @@ def two_buckets(s3_client: S3ClientWrapper, request: pytest.FixtureRequest):
|
|||
@pytest.fixture(scope="session", autouse=True)
|
||||
def check_binary_versions(hosting: Hosting, client_shell: Shell, request: pytest.FixtureRequest):
|
||||
local_versions = version_utils.get_local_binaries_versions(client_shell)
|
||||
remote_versions = version_utils.get_remote_binaries_versions(hosting)
|
||||
remote_versions, exсeptions_remote_binaries_versions = version_utils.get_remote_binaries_versions(hosting)
|
||||
|
||||
all_versions = {
|
||||
**local_versions,
|
||||
|
|
|
@ -23,21 +23,21 @@ def test_binaries_versions(request: FixtureRequest, hosting: Hosting):
|
|||
Compare binaries versions from external source (url) and deployed on servers.
|
||||
"""
|
||||
with reporter.step("Get binaries versions from servers"):
|
||||
got_versions = get_remote_binaries_versions(hosting)
|
||||
got_versions, exсeptions_remote_binaries_versions = get_remote_binaries_versions(hosting)
|
||||
|
||||
environment_dir = request.config.getoption("--alluredir") or ASSETS_DIR
|
||||
env_file = os.path.join(environment_dir, "environment.properties")
|
||||
env_properties = read_env_properties(env_file)
|
||||
|
||||
# compare versions from servers and file
|
||||
exeptions = []
|
||||
exсeptions = []
|
||||
additional_env_properties = {}
|
||||
|
||||
for binary_name, binary in got_versions.items():
|
||||
version = binary["version"]
|
||||
requires_check = binary["check"]
|
||||
if requires_check and not fullmatch(r"^\d+\.\d+\.\d+(-.*)?(?<!dirty)", version):
|
||||
exeptions.append(f"{binary_name}: Actual version doesn't conform to format '0.0.0-000-aaaaaaa': {version}")
|
||||
exсeptions.append(f"{binary_name}: Actual version doesn't conform to format '0.0.0-000-aaaaaaa': {version}")
|
||||
|
||||
# If some binary was not listed in the env properties file, let's add it
|
||||
# so that we have full information about versions in allure report
|
||||
|
@ -47,9 +47,11 @@ def test_binaries_versions(request: FixtureRequest, hosting: Hosting):
|
|||
if env_properties and additional_env_properties:
|
||||
save_env_properties(env_file, additional_env_properties)
|
||||
|
||||
exсeptions.extend(exсeptions_remote_binaries_versions)
|
||||
|
||||
# create clear beautiful error with aggregation info
|
||||
if exeptions:
|
||||
msg = "\n".join(exeptions)
|
||||
if exсeptions:
|
||||
msg = "\n".join(exсeptions)
|
||||
raise AssertionError(f"Found binaries with unexpected versions:\n{msg}")
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue