Make one ctest per one py file with pytests
Merge request reports
Activity
@clemenci I cannot add any labels, is it possible to test this already with lhcb-gaussino? Thanks!
I've already observed that LHCb is going to fail because for
LHCbAlgs.test_DQFilter
we have a test with the same name as an executable-- ( 62%) Kernel/LHCbAlgs CMake Error at /home/mimazure/stacks/gong/Gaudi/InstallArea/x86_64_v2-centos7-gcc11-dbg/lib/cmake/Gaudi/GaudiToolbox.cmake:596 (add_test): add_test given test NAME "LHCbAlgs.test_DQFilter" which already exists in this directory. Call Stack (most recent call first): Kernel/LHCbAlgs/CMakeLists.txt:143 (gaudi_add_executable)
- Resolved by Michal Mazurek
726 726 if(NOT test_directory) 727 727 set(test_directory "${CMAKE_CURRENT_SOURCE_DIR}/tests/pytest") 728 728 endif() 729 get_filename_component(name "${test_directory}" NAME) 730 add_test(NAME ${package_name}.${name} 731 COMMAND run $<TARGET_FILE:pytest> -v --doctest-modules ${test_directory}) 732 set_tests_properties(${package_name}.${name} PROPERTIES LABELS "${PROJECT_NAME};${package_name}") 729 file(GLOB_RECURSE pytest_files RELATIVE "${test_directory}" "${test_directory}/*.py") # ordered lexicographically pytest
is a bit more clever than that: it only takes tests from files calledtest_*.py
or*_test.py
(see the doc).With this approach you may try to run non-test files as test (not really a problem, but a waste of time and a bit confusing).
It might be better to use
pytest --collect-only
and parse the output.
changed milestone to %v36r12
added lhcb-gaudi-head label
assigned to @clemenci
- [2023-03-17 15:39] Validation started with lhcb-gaudi-head#3503
- [2023-03-18 00:04] Validation started with lhcb-gaudi-head#3504
- [2023-03-18 00:14] Validation started with lhcb-run2-gaudi-head#480
Edited by Software for LHCbremoved lhcb-gaudi-head label
changed milestone to %v36r13
mentioned in merge request !1440 (merged)
I think this can be closed in favour of !1440 (merged)