]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
pytest: include `buildinfo.txt` in the output
authorViktor Szakats <commit@vsz.me>
Sat, 12 Oct 2024 21:56:38 +0000 (23:56 +0200)
committerViktor Szakats <commit@vsz.me>
Sun, 13 Oct 2024 09:34:26 +0000 (11:34 +0200)
If present.

It aims to provide TextClutch the same build information that
`runtests.pl` already is providing.

Ref: https://testclutch.curl.se/static/reports/feature-matrix.html
Ref: #15256
Follow-up to 1fdea1684602a1ae2870c67b5f3e8fd34f63da95 #14802
Closes #15279

tests/http/conftest.py

index 948d4204df2f046bc1aaef2ac783bf43326e2039..d3f655263d3b345fce0b323ba5002c9375de4e9c 100644 (file)
@@ -53,6 +53,13 @@ def pytest_report_header(config):
         report.extend([
             f'  VsFTPD: {env.vsftpd_version()}, ftp:{env.ftp_port}, ftps:{env.ftps_port}'
         ])
+    buildinfo_fn = os.path.join(env.build_dir, 'buildinfo.txt')
+    if os.path.exists(buildinfo_fn):
+        with open(buildinfo_fn, 'r') as file_in:
+            for line in file_in:
+                line = line.strip()
+                if line and not line.startswith('#'):
+                    report.extend([line])
     return '\n'.join(report)
 
 # TODO: remove this and repeat argument everywhere, pytest-repeat can be used to repeat tests