From 7c5c83fedfa9f9cb49fadd409c028aba63a5f393 Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Tue, 17 Oct 2023 15:20:10 +0200 Subject: [PATCH 1/2] Use script_test_many_writeTotemDAQMapping.py from release if missing locally --- CondTools/CTPPS/test/test_XML_to_SQLite_mapping.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CondTools/CTPPS/test/test_XML_to_SQLite_mapping.sh b/CondTools/CTPPS/test/test_XML_to_SQLite_mapping.sh index 961f93e663d76..30389bbe794d8 100755 --- a/CondTools/CTPPS/test/test_XML_to_SQLite_mapping.sh +++ b/CondTools/CTPPS/test/test_XML_to_SQLite_mapping.sh @@ -6,6 +6,7 @@ DET_TO_CHECK=("TotemTiming" "TimingDiamond" "TrackingStrip" "TotemT2") MASK_DATA="AnalysisMask" TEST_DIR=$CMSSW_BASE/src/CondTools/CTPPS/test PRINTER_SCRIPT=$CMSSW_BASE/src/CalibPPS/ESProducers/test/script_test_many_writeTotemDAQMapping.py +[ -e ${PRINTER_SCRIPT} ] || PRINTER_SCRIPT=$CMSSW_RELEASE_BASE/src/CalibPPS/ESProducers/test/script_test_many_writeTotemDAQMapping.py # --------------- python3 ${TEST_DIR}/script-ctpps-write-many-XML-to-SQLite.py False "${DET_TO_CHECK[@]}" || die 'Failed in script-ctpps-write-many-XML-to-SQLite.py' $? @@ -38,4 +39,4 @@ done rm all__db.txt all__xml.txt rm CTPPS_AnalysisMask.db -echo "Cleaned after tests" \ No newline at end of file +echo "Cleaned after tests" From a1ea96ac9b4e004fc5d6d0a6eb9f5185d0d1926c Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Thu, 19 Oct 2023 14:34:38 +0200 Subject: [PATCH 2/2] use script directory to read test_writeTotemDAQMapping.py --- .../ESProducers/test/script_test_many_writeTotemDAQMapping.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CalibPPS/ESProducers/test/script_test_many_writeTotemDAQMapping.py b/CalibPPS/ESProducers/test/script_test_many_writeTotemDAQMapping.py index 23008c3633dcb..c96ed34bf1107 100644 --- a/CalibPPS/ESProducers/test/script_test_many_writeTotemDAQMapping.py +++ b/CalibPPS/ESProducers/test/script_test_many_writeTotemDAQMapping.py @@ -26,9 +26,10 @@ # For each file change the variable values in the config so that they match the selected XML file and then run the config +test_script = os.path.join(os.path.dirname(os.path.realpath(__file__)),'test_writeTotemDAQMapping.py') for fileContent in filesToRead: for fileInfo in fileContent["configuration"]: - with open(f'{os.environ["CMSSW_BASE"]}/src/CalibPPS/ESProducers/test/test_writeTotemDAQMapping.py', 'r+') as f: + with open(test_script, 'r+') as f: content = f.read() # replace values specific for selected detector content = re.sub(r'subSystemName =.*', f'subSystemName = "{fileContent["subSystemName"]}"', content)