Closed yarikoptic closed 1 month ago
reproduction is easy - just unset USER
:
❯ (unset USER; python3.12 -m pytest -k test_system_info_sanity test )
=============================================================================== test session starts ================================================================================
platform linux -- Python 3.12.5, pytest-8.3.2, pluggy-1.5.0
rootdir: /home/yoh/proj/CON/duct
configfile: tox.ini
plugins: mock-3.14.0, cov-5.0.0, xdist-3.6.1
collected 162 items / 161 deselected / 1 selected
test/test_report.py F [100%]
===================================================================================== FAILURES =====================================================================================
_____________________________________________________________________________ test_system_info_sanity ______________________________________________________________________________
mock_log_paths = <MagicMock name='LogPaths' id='140496362021872'>
@mock.patch("con_duct.__main__.LogPaths")
def test_system_info_sanity(mock_log_paths: mock.MagicMock) -> None:
mock_log_paths.prefix = "mock_prefix"
report = Report("_cmd", [], mock_log_paths, EXECUTION_SUMMARY_FORMAT, clobber=False)
report.get_system_info()
assert report.system_info is not None
assert report.system_info.hostname
assert report.system_info.cpu_total
assert report.system_info.memory_total > 10
> assert report.system_info.uid
E AssertionError: assert None
E + where None = SystemInfo(uid=None, memory_total=67080265728, cpu_total=20, hostname='bilena').uid
E + where SystemInfo(uid=None, memory_total=67080265728, cpu_total=20, hostname='bilena') = <con_duct.__main__.Report object at 0x7fc7dbc034a0>.system_info
test/test_report.py:196: AssertionError
============================================================================= short test summary info ==============================================================================
FAILED test/test_report.py::test_system_info_sanity - AssertionError: assert None
======================================================================== 1 failed, 161 deselected in 2.08s
I will submit a quick fix
may be some sanitization is done by debian tools to make build independent of user, but yet to check
meanwhile here is how it looks: