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)
Tue, Jul 2, 7:25 PM
Unknown Object (File)
Tue, Jul 2, 7:25 PM
Unknown Object (File)
Tue, Jul 2, 11:58 AM
Unknown Object (File)
Tue, Jul 2, 11:46 AM
Unknown Object (File)
Tue, Jul 2, 4:55 AM
Unknown Object (File)
Sat, Jun 29, 1:05 AM
Unknown Object (File)
Thu, Jun 27, 4:35 PM
Unknown Object (File)
May 20 2024, 1:34 PM
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