Repository navigation
Conversation
Use the pytest-astropy-header package to log information about the running platform in pytest invocations so Test Clutch can include it in the test run metadata. This also logs some things less relevant to curl, but it's small and simple and provides the information we want and since it's only running in the CI build it won't generally be seen by humans. Closes #15256
|
Would it make sense to dump the same |
|
That would be better, but it means writing our own pytest plug-in somehow. This solution uses existing tools, but doesn't give as much information. |
|
I tried doing this a little while ago, but did not look trivial indeed for some reason. But, since then, pytests got hooked up into the build systems and started from |
|
That would work, but the result would be outside what pytest logs so Test Clutch would currently ignore it. Since pytest is a standard log format that's widely used, I'm trying to avoid adding curl-specific code in there, so doing it within pytest would be much better from that perspective. |
|
Since this improves the metadata situation today, I'll submit it. If someone figures out a clean way to get more environment info into the logs, we can always switch later. |
|
Is there any reason why a It would add the same metadata in the logs as TestClutch is already parsing for runtests. (If it works, it can be moved inside the build scripts.) |
|
See my "That would work" comment. |
Am I understanding correctly that TestClutch is looking for the pytest log output headers to recognize where the step begins? Would TestClutch find the buildinfo if the |
|
It ignores everything outside the pytest log, so once the log ends, it
considers its job done and stops looking for more. It could be changed, of
course, but when parsing arbitrary logs I want it to be conservative to avoid
false triggering, especially since these log formats aren't designed to be
machine readable.
|
Got it. Pytest already puts out there some custom output |
|
Something like?: --- a/tests/http/conftest.py
+++ b/tests/http/conftest.py
@@ -53,7 +53,10 @@ def pytest_report_header(config):
report.extend([
f' VsFTPD: {env.vsftpd_version()}, ftp:{env.ftp_port}, ftps:{env.ftps_port}'
])
- return '\n'.join(report)
+ out = '\n'.join(report)
+ with open(os.path.join(env.build_dir, 'buildinfo.txt'), 'r') as file_in:
+ out += '\n' + file_in.read()
+ return out
# TODO: remove this and repeat argument everywhere, pytest-repeat can be used to repeat tests
def pytest_generate_tests(metafunc):Needs #15257, and untested. |
|
Can confirm that after PR #15257, and this patch: --- a/tests/http/conftest.py
+++ b/tests/http/conftest.py
@@ -53,7 +53,10 @@ def pytest_report_header(config):
report.extend([
f' VsFTPD: {env.vsftpd_version()}, ftp:{env.ftp_port}, ftps:{env.ftps_port}'
])
- return '\n'.join(report)
+ out = '\n'.join(report)
+ with open(os.path.join(env.build_dir, 'buildinfo.txt'), 'r') as file_in:
+ out += '\n' + file_in.read()
+ return out
# TODO: remove this and repeat argument everywhere, pytest-repeat can be used to repeat tests
def pytest_generate_tests(metafunc):
Would this be a solution? |
|
Made a PR with the above → #15279. |
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 1fdea16 #14802 Closes #15279
|
This is now obsolete since the information is now available from our pytest harness directly: #15470 |
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: curl#15256 Follow-up to 1fdea16 curl#14802 Closes curl#15279
Use the pytest-astropy-header package to log information about the
running platform in pytest invocations so Test Clutch can include it in
the test run metadata. This also logs some things less relevant to
curl, but it's small and simple and provides the information we want and
since it's only running in the CI build it won't generally be seen by
humans.
Closes #15256