Skip to content

Patch after Pytest migration: fixes and new fixture

Patch with miscellaneous fixes and additions mentioned in 02.04.25 Core Software meeting.

  1. Overridden test_count_messages in LHCbExeTest that would pick up messages_preprocessor if 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 use except key to ignore a set of expected messages explicitly. In this case, one should use messages key instead of messages_count. If the test defines both the reference file and a reference dictionary, the latter should go inside the reference file under the key messages.
  2. Fixed 3 deprecation warnings in GaudiConf/QMTest of invalid escape sequence in regex, which I noticed showing up if the LHCb stack happens to fail to compile due to various unrelated reasons.
  3. Replaced all $\[A-Z\]+ROOT env. variables to relative paths Rec!4283 (comment 9158223)
  4. Test names that after migration got a duplicated prefix, e.g. test_test_confutils, are changed to have one prefix test_.
  5. test_counters now allows to exclude counters by defining a list of explicit names exclude_counters.
  6. Added test_fluctuating_counters as a default test that would run if fluctuating_counters: dict is 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.
  7. Since points 5 and 6 are used only downstream, test_lhcbexetest.py was equipped with tests for all above features.
  8. LineSkipper is now consistently imported from GaudiTesting.preprocessors (at places was LHCbTesting.preprocessor).

CC for point 1 @sargueda @yitang @bmoraesv

CC for point 5, 6 @sargueda

Edited by Pawel Kopciewicz

Merge request reports

Loading