Patch after Pytest migration: fixes and new fixture
Patch with miscellaneous fixes and additions mentioned in 02.04.25 Core Software meeting.
- Overridden
test_count_messagesinLHCbExeTestthat would pick upmessages_preprocessorif defined by the user (None by default), and use that to preprocess the stdout before counting the messages. This fixes an issue in downstream projects when having two different preprocessors in the same test Moore!4530 (comment 9218631). Additionally, the added test function allows to useexceptkey to ignore a set of expected messages explicitly. In this case, one should usemessageskey instead ofmessages_count. If the test defines both the reference file and a reference dictionary, the latter should go inside the reference file under the keymessages. - Fixed 3 deprecation warnings in
GaudiConf/QMTestof invalid escape sequence in regex, which I noticed showing up if the LHCb stack happens to fail to compile due to various unrelated reasons. - Replaced all
$\[A-Z\]+ROOTenv. variables to relative paths Rec!4283 (comment 9158223) - Test names that after migration got a duplicated prefix, e.g.
test_test_confutils, are changed to have one prefixtest_. -
test_countersnow allows to exclude counters by defining a list of explicit namesexclude_counters. - Added
test_fluctuating_countersas a default test that would run iffluctuating_counters: dictis not None. It can be defined by the user in a following manner:fluctuating_counters = {"CounterTable2": {"Fluctuating counter": 1}}, meaning the title of the counter block, the name of the counter, and the fluctuation tolerance, respectively. - Since points 5 and 6 are used only downstream,
test_lhcbexetest.pywas equipped with tests for all above features. -
LineSkipperis now consistently imported fromGaudiTesting.preprocessors(at places wasLHCbTesting.preprocessor).
CC for point 1 @sargueda @yitang @bmoraesv
CC for point 5, 6 @sargueda
Edited by Pawel Kopciewicz