Skip to content

Commit

Permalink
[ALCA-DB] Various fixes/improvements for unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed Mar 23, 2023
1 parent 7530dfd commit dbfda5e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 23 deletions.
5 changes: 1 addition & 4 deletions CondFormats/PCLConfig/test/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@
<use name="CondFormats/PCLConfig"/>
</bin>

<bin name="testReadWriteAlignPCLThresholds" file="testDriver.cpp">
<flags TEST_RUNNER_ARGS="/bin/bash CondFormats/PCLConfig/test testReadWriteAlignPCLThresholds.sh"/>
<use name="FWCore/Utilities"/>
</bin>
<test name="testReadWriteAlignPCLThresholds" command="testReadWriteAlignPCLThresholds.sh"/>
2 changes: 0 additions & 2 deletions CondFormats/PCLConfig/test/testDriver.cpp

This file was deleted.

8 changes: 4 additions & 4 deletions CondFormats/PCLConfig/test/testReadWriteAlignPCLThresholds.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
function die { echo $1: status $2; exit $2; }
# test High Granularity
cmsRun ${LOCAL_TEST_DIR}/AlignPCLThresholdsWriter_cfg.py || die 'failed running AlignPCLThresholdsWriter_cfg.py' $?
cmsRun ${LOCAL_TEST_DIR}/AlignPCLThresholdsReader_cfg.py || die 'failed running AlignPCLThresholdsReader_cfg.py' $?
cmsRun ${SCRAM_TEST_PATH}/AlignPCLThresholdsWriter_cfg.py || die 'failed running AlignPCLThresholdsWriter_cfg.py' $?
cmsRun ${SCRAM_TEST_PATH}/AlignPCLThresholdsReader_cfg.py || die 'failed running AlignPCLThresholdsReader_cfg.py' $?

# test Low Granularity
(cmsRun ${LOCAL_TEST_DIR}/AlignPCLThresholdsWriter_cfg.py writeLGpayload=True) || die 'failed running AlignPCLThresholdsWriter_cfg.py writeLGpayload=True' $?
(cmsRun ${LOCAL_TEST_DIR}/AlignPCLThresholdsReader_cfg.py readLGpayload=True) || die 'failed running AlignPCLThresholdsReader_cfg.py readLGpayload=True' $?
(cmsRun ${SCRAM_TEST_PATH}/AlignPCLThresholdsWriter_cfg.py writeLGpayload=True) || die 'failed running AlignPCLThresholdsWriter_cfg.py writeLGpayload=True' $?
(cmsRun ${SCRAM_TEST_PATH}/AlignPCLThresholdsReader_cfg.py readLGpayload=True) || die 'failed running AlignPCLThresholdsReader_cfg.py readLGpayload=True' $?
7 changes: 1 addition & 6 deletions CondTools/BeamSpot/test/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
<environment>
<bin file="testReadWriteOnlineBSFromDB.cpp">
<flags TEST_RUNNER_ARGS="/bin/bash CondTools/BeamSpot/test testReadWriteOnlineBSFromDB.sh"/>
<use name="FWCore/Utilities"/>
</bin>
</environment>
<test name="testReadWriteOnlineBSFromDB" command="testReadWriteOnlineBSFromDB.sh"/>
2 changes: 0 additions & 2 deletions CondTools/BeamSpot/test/testReadWriteOnlineBSFromDB.cpp

This file was deleted.

10 changes: 5 additions & 5 deletions CondTools/BeamSpot/test/testReadWriteOnlineBSFromDB.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ cp -pr $CMSSW_BASE/src/CondTools/BeamSpot/data/BeamFitResults_Run306171.txt .

# test write
printf "TESTING Writing BeamSpotOnlineLegacyObjectsRcd DB object ...\n\n"
cmsRun ${LOCAL_TEST_DIR}/BeamSpotOnlineRecordsWriter_cfg.py unitTest=True inputRecord=BeamSpotOnlineLegacyObjectsRcd || die "Failure writing payload for BeamSpotOnlineLegacyObjectsRcd" $?
cmsRun ${SCRAM_TEST_PATH}/BeamSpotOnlineRecordsWriter_cfg.py unitTest=True inputRecord=BeamSpotOnlineLegacyObjectsRcd || die "Failure writing payload for BeamSpotOnlineLegacyObjectsRcd" $?

printf "TESTING Writing BeamSpotOnlineHLTObjectsRcd DB object ...\n\n"
cmsRun ${LOCAL_TEST_DIR}/BeamSpotOnlineRecordsWriter_cfg.py unitTest=True inputRecord=BeamSpotOnlineHLTObjectsRcd || die "Failure writing payload for BeamSpotOnlineHLTObjectsRcd" $?
cmsRun ${SCRAM_TEST_PATH}/BeamSpotOnlineRecordsWriter_cfg.py unitTest=True inputRecord=BeamSpotOnlineHLTObjectsRcd || die "Failure writing payload for BeamSpotOnlineHLTObjectsRcd" $?
# test read

printf "TESTING Reading BeamSpotOnlineLegacyObjectsRcd DB object ...\n\n"
cmsRun ${LOCAL_TEST_DIR}/BeamSpotOnlineRecordsReader_cfg.py unitTest=True inputRecord=BeamSpotOnlineLegacyObjectsRcd || die "Failure reading payload for BeamSpotOnlineLegacyObjectsRcd" $?
cmsRun ${SCRAM_TEST_PATH}/BeamSpotOnlineRecordsReader_cfg.py unitTest=True inputRecord=BeamSpotOnlineLegacyObjectsRcd || die "Failure reading payload for BeamSpotOnlineLegacyObjectsRcd" $?

printf "TESTING Reading BeamSpotOnlineHLTObjectsRcd DB object ...\n\n"
cmsRun ${LOCAL_TEST_DIR}/BeamSpotOnlineRecordsReader_cfg.py unitTest=True inputRecord=BeamSpotOnlineHLTObjectsRcd || die "Failure reading payload for BeamSpotOnlineHLTObjectsRcd" $?
cmsRun ${SCRAM_TEST_PATH}/BeamSpotOnlineRecordsReader_cfg.py unitTest=True inputRecord=BeamSpotOnlineHLTObjectsRcd || die "Failure reading payload for BeamSpotOnlineHLTObjectsRcd" $?

echo "TESTING reading BeamSpotObjectRcd DB object ...\n\n"
cmsRun ${LOCAL_TEST_DIR}/BeamSpotRcdPrinter_cfg.py || die "Failure running BeamSpotRcdPrinter" $?
cmsRun ${SCRAM_TEST_PATH}/BeamSpotRcdPrinter_cfg.py || die "Failure running BeamSpotRcdPrinter" $?

0 comments on commit dbfda5e

Please sign in to comment.