From 9ef24c4d570899cb0b566aebbbb92fc35442685a Mon Sep 17 00:00:00 2001 From: Thomas Madlener Date: Thu, 12 Jan 2023 16:31:25 +0100 Subject: [PATCH] Make it possible to run clic reco tests concurrently --- test/CMakeLists.txt | 10 ++++++++++ test/scripts/clicRec.sh | 4 +--- test/scripts/clicRec_e4h_input.sh | 4 +--- test/scripts/clicRec_lcio_mt.sh | 6 ++---- test/scripts/setup_clic_performance.sh | 5 +++++ 5 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 test/scripts/setup_clic_performance.sh diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e5b4ad02..6acbcd60 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -30,6 +30,11 @@ if (BASH_PROGRAM) # Test simple_processors2 add_test( simple_processors2 ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/simple_processors2.sh ) + # CLICPerformance setup is added as a simple test that will always succeed, on + # which other tests that need it can depend, in order to make concurrent + # running of those more easily possible + add_test( CLICPerformance_setup ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/setup_clic_performance.sh ) + # Test clicReconstruction add_test( clicRec ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/clicRec.sh ) @@ -78,5 +83,10 @@ if (BASH_PROGRAM) ENVIRONMENT "TEST_DIR=${CMAKE_CURRENT_SOURCE_DIR};LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib64:$ENV{LD_LIBRARY_PATH};PYTHONPATH=${CMAKE_INSTALL_PREFIX}/python:$ENV{PYTHONPATH}" ) + set_tests_properties( + clicRec clicRec_lcio_mt clicRec_edm4hep_input + PROPERTIES + DEPENDS CLICPerformance_setup + ) endif(BASH_PROGRAM) diff --git a/test/scripts/clicRec.sh b/test/scripts/clicRec.sh index 0ae4b6bd..656caae9 100644 --- a/test/scripts/clicRec.sh +++ b/test/scripts/clicRec.sh @@ -3,9 +3,7 @@ set -eu # Clone CLICPerformance for input files -if [ ! -d CLICPerformance ]; then - git clone https://github.com/iLCSoft/CLICPerformance -fi +bash $TEST_DIR/scripts/setup_clic_performance.sh cd CLICPerformance/clicConfig diff --git a/test/scripts/clicRec_e4h_input.sh b/test/scripts/clicRec_e4h_input.sh index 81dd2432..4cdda2a7 100644 --- a/test/scripts/clicRec_e4h_input.sh +++ b/test/scripts/clicRec_e4h_input.sh @@ -3,9 +3,7 @@ set -eu # Clone CLICPerformance for input files -if [ ! -d CLICPerformance ]; then - git clone https://github.com/iLCSoft/CLICPerformance -fi +bash $TEST_DIR/scripts/setup_clic_performance.sh cd CLICPerformance/clicConfig diff --git a/test/scripts/clicRec_lcio_mt.sh b/test/scripts/clicRec_lcio_mt.sh index 67eb6b68..b5a81b5b 100644 --- a/test/scripts/clicRec_lcio_mt.sh +++ b/test/scripts/clicRec_lcio_mt.sh @@ -3,9 +3,7 @@ set -eu # Clone CLICPerformance for input files -if [ ! -d CLICPerformance ]; then - git clone https://github.com/iLCSoft/CLICPerformance -fi +bash $TEST_DIR/scripts/setup_clic_performance.sh cd CLICPerformance/clicConfig @@ -31,4 +29,4 @@ if [ "$input_num_events" == "$output_num_events" ]; then echo "Input and output have same number of events" else echo "ERROR: different number of events for input and output" -fi \ No newline at end of file +fi diff --git a/test/scripts/setup_clic_performance.sh b/test/scripts/setup_clic_performance.sh new file mode 100644 index 00000000..3e40972e --- /dev/null +++ b/test/scripts/setup_clic_performance.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +if [ ! -d CLICPerformance ]; then + git clone --depth=1 https://github.com/iLCSoft/CLICPerformance +fi