Page MenuHomeFreeBSD

testing: provide meaningful error when pytest is not available
ClosedPublic

Authored by melifaro on Jul 6 2022, 7:36 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 16, 10:40 AM
Unknown Object (File)
Fri, Mar 14, 6:44 AM
Unknown Object (File)
Fri, Feb 21, 7:48 AM
Unknown Object (File)
Feb 16 2025, 7:50 AM
Unknown Object (File)
Feb 8 2025, 4:31 PM
Unknown Object (File)
Feb 8 2025, 8:58 AM
Unknown Object (File)
Jan 29 2025, 6:53 AM
Unknown Object (File)
Jan 28 2025, 2:32 AM
Subscribers

Details

Summary

Provide meaningful error for pytest-based test when pytest is not available on the system.

Unfortunately, atf format does not provide any way of signalling any error message back to the atf runner when listing tests.
Work this around by reporting "test_cases_list_pytest_binary_not_found" test instead.

Test Plan

OLD behaviour:

7:40 [0] m@devel0 s kyua list -k /usr/tests/sys/net/routing/Kyuafile test_rtsock_multipath.py
test_rtsock_multipath.py:__test_cases_list__
7:40 [0] m@devel0 s kyua test -k /usr/tests/sys/net/routing/Kyuafile test_rtsock_multipath.py
test_rtsock_multipath.py:__test_cases_list__  ->  broken: Test program did not exit cleanly  [0.001s]

NEW behaviour:

7:43 [1] m@devel2 s kyua list -k /usr/tests/sys/netinet6/Kyuafile test_ip6_output.py
test_ip6_output.py:__test_cases_list_pytest_binary_not_found__
7:44 [1] m@devel2 s kyua test -k /usr/tests/sys/netinet6/Kyuafile test_ip6_output.py
test_ip6_output.py:__test_cases_list_pytest_binary_not_found__  ->  skipped: Required program 'pytest' not found in PATH  [0.001s]

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable