]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
pytest: include curl version string and python platform in log
authorViktor Szakats <commit@vsz.me>
Fri, 1 Nov 2024 12:18:40 +0000 (13:18 +0100)
committerViktor Szakats <commit@vsz.me>
Sat, 2 Nov 2024 00:56:55 +0000 (01:56 +0100)
For the Test Clutch matrix.

https://testclutch.curl.se/static/reports/feature-matrix.html

Assisted-by: Dan Fandrich
Closes #15470

tests/http/conftest.py
tests/http/testenv/env.py

index a4a4a172c85f1e946bc836479b8ffa80e8c51a33..b29cf38bb7513e6159348b6f3eec9b136569d5b9 100644 (file)
@@ -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}',
index 0bf39ed04c0623cb4a6ffbbf9e5ff098a2c1edaf..4eb0eb7653c8179dba8915b87a648695e1798f82 100644 (file)
@@ -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<version>\S+) (?P<os>\S+) (?P<libs>.*)$', 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']