From: Viktor Szakats Date: Fri, 1 Nov 2024 12:18:40 +0000 (+0100) Subject: pytest: include curl version string and python platform in log X-Git-Tag: curl-8_11_0~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=25025419c9c32bb5c59b97b7381678917a590d20;p=thirdparty%2Fcurl.git pytest: include curl version string and python platform in log For the Test Clutch matrix. https://testclutch.curl.se/static/reports/feature-matrix.html Assisted-by: Dan Fandrich Closes #15470 --- diff --git a/tests/http/conftest.py b/tests/http/conftest.py index a4a4a172c8..b29cf38bb7 100644 --- a/tests/http/conftest.py +++ b/tests/http/conftest.py @@ -25,6 +25,7 @@ import logging import os import sys +import platform from typing import Generator import pytest @@ -38,6 +39,8 @@ def pytest_report_header(config): env = Env() report = [ f'Testing curl {env.curl_version()}', + f' platform: {platform.platform()}', + f' curl: Version: {env.curl_version_string()}', f' curl: Features: {env.curl_features_string()}', f' curl: Protocols: {env.curl_protocols_string()}', f' httpd: {env.httpd_version()}, http:{env.http_port} https:{env.https_port}', diff --git a/tests/http/testenv/env.py b/tests/http/testenv/env.py index 0bf39ed04c..4eb0eb7653 100644 --- a/tests/http/testenv/env.py +++ b/tests/http/testenv/env.py @@ -68,6 +68,7 @@ class EnvConfig: if 'CURL' in os.environ: self.curl = os.environ['CURL'] self.curl_props = { + 'version_string': '', 'version': '', 'os': '', 'fullname': '', @@ -88,6 +89,7 @@ class EnvConfig: self.curl_is_debug = True for line in p.stdout.splitlines(keepends=False): if line.startswith('curl '): + self.curl_props['version_string'] = line m = re.match(r'^curl (?P\S+) (?P\S+) (?P.*)$', line) if m: self.curl_props['fullname'] = m.group(0) @@ -327,6 +329,10 @@ class Env: return not Env.curl_uses_lib('ngtcp2') and Env.curl_uses_lib('nghttp3') return False + @staticmethod + def curl_version_string() -> str: + return Env.CONFIG.curl_props['version_string'] + @staticmethod def curl_features_string() -> str: return Env.CONFIG.curl_props['features_string']