Skip to content

Commit 829ccc4

Browse files
ChristianTackeGSIdennisklein
authored andcommitted
CI: Disable Geant3 Tests by Default
The Geant3 based tests are highly unstable. Rerunning tests like 10 times to get a stable result is no good. So introduce a new option to enable/disable these tests: ENABLE_GEANT3_TESTING The default is OFF. Only branch CI builds will run these tests.
1 parent 77521ed commit 829ccc4

11 files changed

Lines changed: 60 additions & 35 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
3636
* It will be disabled by default in FairRoot 19.
3737
* We plan to remove it completely in FairRoot 20.
3838
* If you need it, speak up NOW.
39+
40+
### Other Notable Changes
41+
* Tests using Geant3 have been disabled by default, because
42+
those tests have a probability > 0 for failing.
43+
If you want to run them anyways, pass
44+
`-DENABLE_GEANT3_TESTING=ON` to CMake.

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ endif()
125125

126126
# Set option(s)
127127
option(BUILD_UNITTESTS "Build all unittests and add them as new tests" OFF)
128+
option(ENABLE_GEANT3_TESTING "Enable tests utilizing Geant3" OFF)
128129

129130
# searches for needed packages
130131
# REQUIRED means that cmake will stop if this packages are not found

FairRoot_build_test.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ list(APPEND options
5454
"-DCMAKE_INSTALL_PREFIX:PATH=${test_install_prefix}"
5555
"-DBUILD_MBS=ON"
5656
)
57+
if ("$ENV{CHANGE_ID}" STREQUAL "")
58+
# Branch build
59+
list(APPEND options "-DENABLE_GEANT3_TESTING:BOOL=ON")
60+
endif()
5761
ctest_configure(OPTIONS "${options}")
5862

5963
ctest_build(FLAGS "-j${NCPUS}" TARGET install
@@ -62,7 +66,10 @@ ctest_build(FLAGS "-j${NCPUS}" TARGET install
6266

6367
unset(repeat)
6468
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.17)
65-
set(repeat REPEAT UNTIL_PASS:7)
69+
if ("$ENV{CHANGE_ID}" STREQUAL "")
70+
# Branch build
71+
set(repeat REPEAT UNTIL_PASS:7)
72+
endif()
6673
endif()
6774
if(_ctest_build_ret_val OR _ctest_build_num_errs)
6875
message(STATUS "Skipping tests, because build failed"

examples/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
# copied verbatim in the file "LICENSE" #
77
################################################################################
88

9+
set(mcEngine_list TGeant4)
10+
911
if(Geant3_FOUND)
12+
if(ENABLE_GEANT3_TESTING)
13+
list(APPEND mcEngine_list TGeant3)
14+
endif()
1015
add_subdirectory(common/passive)
1116
add_subdirectory(common/mcstack)
1217
if(TARGET FairRoot::EventDisplay)

examples/MQ/pixelAlternative/run/CMakeLists.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ install(TARGETS pixalt-sampler-bin pixalt-sink-bin pixalt-processor-bin
4141
RUNTIME DESTINATION ${PROJECT_INSTALL_DATADIR}/examples/MQ/pixelAlternative/bin
4242
)
4343

44-
set(maxTestTime 30)
45-
46-
add_test(NAME ex_MQ_pixel_alt_static
47-
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/startFairMQPixAlt.sh --work-dir ${CMAKE_BINARY_DIR}/examples/MQ/pixelDetector --max-index 10000 --aggregate 100 --processors 5 --command static --force-kill true)
48-
set_tests_properties(ex_MQ_pixel_alt_static PROPERTIES
49-
FIXTURES_REQUIRED fixtures.ex_MQ_pixel_static
50-
TIMEOUT ${maxTestTime}
51-
PASS_REGULAR_EXPRESSION "Shell script finished successfully"
52-
)
44+
if(ENABLE_GEANT3_TESTING)
45+
set(maxTestTime 30)
46+
47+
add_test(NAME ex_MQ_pixel_alt_static
48+
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/startFairMQPixAlt.sh --work-dir ${CMAKE_BINARY_DIR}/examples/MQ/pixelDetector --max-index 10000 --aggregate 100 --processors 5 --command static --force-kill true)
49+
set_tests_properties(ex_MQ_pixel_alt_static PROPERTIES
50+
FIXTURES_REQUIRED fixtures.ex_MQ_pixel_static
51+
TIMEOUT ${maxTestTime}
52+
PASS_REGULAR_EXPRESSION "Shell script finished successfully"
53+
)
54+
endif()

examples/MQ/pixelDetector/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
# copied verbatim in the file "LICENSE" #
77
################################################################################
88

9+
add_subdirectory(param)
910
add_subdirectory(src)
10-
add_subdirectory(macros)
11+
if(ENABLE_GEANT3_TESTING)
12+
add_subdirectory(macros)
13+
endif()
1114
add_subdirectory(run)
12-
add_subdirectory(param)

examples/MQ/pixelDetector/run/CMakeLists.txt

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -117,25 +117,27 @@ install(TARGETS pixel-sampler pixel-processor pixel-sink pixel-sampler-bin pixel
117117
RUNTIME DESTINATION ${PROJECT_INSTALL_DATADIR}/examples/MQ/pixelDetector/bin
118118
)
119119

120-
set(maxTestTime 100)
121-
122-
if(DDS_VERSION VERSION_GREATER_EQUAL 3.5
123-
AND FairMQ_VERSION VERSION_GREATER_EQUAL 1.4.23)
124-
add_test(NAME ex_MQ_pixel_simulation
125-
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test-pixelSim.sh)
126-
set_tests_properties(ex_MQ_pixel_simulation PROPERTIES
127-
FIXTURES_REQUIRED fixtures.ex_MQ_pixel_static
120+
if(ENABLE_GEANT3_TESTING)
121+
set(maxTestTime 100)
122+
123+
if(DDS_VERSION VERSION_GREATER_EQUAL 3.5
124+
AND FairMQ_VERSION VERSION_GREATER_EQUAL 1.4.23)
125+
add_test(NAME ex_MQ_pixel_simulation
126+
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test-pixelSim.sh)
127+
set_tests_properties(ex_MQ_pixel_simulation PROPERTIES
128+
FIXTURES_REQUIRED fixtures.ex_MQ_pixel_static
129+
TIMEOUT ${maxTestTime}
130+
PASS_REGULAR_EXPRESSION "Shell script finished successfully"
131+
)
132+
endif()
133+
134+
add_test(NAME ex_MQ_pixel_static
135+
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/startFairMQPixel.sh --work-dir ${CMAKE_CURRENT_BINARY_DIR}/../ -p 3 --command static --force-kill true)
136+
set_tests_properties(ex_MQ_pixel_static PROPERTIES
137+
FIXTURES_REQUIRED fixtures.ex_pixel_digi_to_bin_TGeant3
128138
TIMEOUT ${maxTestTime}
139+
RUN_SERIAL ON
129140
PASS_REGULAR_EXPRESSION "Shell script finished successfully"
130-
)
141+
FIXTURES_SETUP fixtures.ex_MQ_pixel_static
142+
)
131143
endif()
132-
133-
add_test(NAME ex_MQ_pixel_static
134-
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/startFairMQPixel.sh --work-dir ${CMAKE_CURRENT_BINARY_DIR}/../ -p 3 --command static --force-kill true)
135-
set_tests_properties(ex_MQ_pixel_static PROPERTIES
136-
FIXTURES_REQUIRED fixtures.ex_pixel_digi_to_bin_TGeant3
137-
TIMEOUT ${maxTestTime}
138-
RUN_SERIAL ON
139-
PASS_REGULAR_EXPRESSION "Shell script finished successfully"
140-
FIXTURES_SETUP fixtures.ex_MQ_pixel_static
141-
)

examples/advanced/Tutorial3/macro/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ GENERATE_ROOT_TEST_SCRIPT(${CMAKE_CURRENT_SOURCE_DIR}/run_digi_timebased.C)
1515
GENERATE_ROOT_TEST_SCRIPT(${CMAKE_CURRENT_SOURCE_DIR}/run_reco_timebased.C)
1616
GENERATE_ROOT_TEST_SCRIPT(${CMAKE_CURRENT_SOURCE_DIR}/run_digi_reco_proof.C)
1717

18-
foreach(mcEngine IN ITEMS TGeant3 TGeant4)
18+
foreach(mcEngine IN LISTS mcEngine_list)
1919
add_test(NAME ex_tutorial3_sim_${mcEngine}
2020
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/run_sim.sh 100 \"${mcEngine}\")
2121
math(EXPR testTime 3*${maxTestTime})

examples/simulation/Tutorial1/macros/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ GENERATE_ROOT_TEST_SCRIPT(${CMAKE_CURRENT_SOURCE_DIR}/run_tutorial1.C)
1414

1515
set(maxTestTime 60)
1616

17-
foreach(mcEngine IN ITEMS TGeant3 TGeant4)
17+
foreach(mcEngine IN LISTS mcEngine_list)
1818
add_test(NAME ex_sim_tutorial1_mesh_${mcEngine}
1919
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/run_tutorial1_mesh.sh 10 \"${mcEngine}\")
2020
set_tests_properties(ex_sim_tutorial1_mesh_${mcEngine} PROPERTIES

examples/simulation/Tutorial4/macros/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ GENERATE_ROOT_TEST_SCRIPT(${CMAKE_CURRENT_SOURCE_DIR}/run_reco.C)
1414

1515
set(maxTestTime 60)
1616

17-
foreach(mcEngine IN ITEMS TGeant3 TGeant4)
17+
foreach(mcEngine IN LISTS mcEngine_list)
1818
add_test(NAME ex_sim_tutorial4_${mcEngine}
1919
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/run_tutorial4.sh 10 \"${mcEngine}\")
2020
set_tests_properties(ex_sim_tutorial4_${mcEngine} PROPERTIES

0 commit comments

Comments
 (0)