Skip to content

Commit

Permalink
Merge pull request #43664 from mmusich/unitest-dqm-config_13_3_X
Browse files Browse the repository at this point in the history
[13.3.X] Fix DQMOfflineConfiguration unit tests
  • Loading branch information
cmsbuild authored Jan 16, 2024
2 parents 19d9edb + 095f214 commit 26a57e1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DQMOffline/Configuration/test/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<test name="GetTestDQMOfflineConfigurationFile" command="edmCopyUtil ${INFILE} $(LOCALTOP)/tmp/"/>

<!-- To make the tests run in parallel, we chunk up the work into arbitrary sets of 10 sequences. -->
<test name="TestDQMOfflineConfiguration" command="runtests.sh ${step_value} ${value} file://${LOCALTOP}/tmp/${INFILE_NAME}" for="0,290,10">
<test name="TestDQMOfflineConfiguration" command="runtests.sh ${step_value} ${value} file://${LOCALTOP}/tmp/${INFILE_NAME}" for="0,300,10">
<flags PRE_TEST="GetTestDQMOfflineConfigurationFile"/>
</test>

<!-- To make sure we actually got all sequences, the last check checks that there are no sequences beyond the last test -->
<!-- This might need to updated when the number of distinct sequences grows, add more rows above and change the number here. -->
<test name="TestDQMOfflineConfigurationGotAll" command="cmsswSequenceInfo.py --runTheMatrix --steps DQM,VALIDATION --infile file://${LOCALTOP}/tmp/${INFILE_NAME} --limit 50 --offset 300 --threads 1 | grep 'Analyzing 0 seqs'">
<test name="TestDQMOfflineConfigurationGotAll" command="runrest.sh file://${LOCALTOP}/tmp/${INFILE_NAME} 310">
<flags PRE_TEST="GetTestDQMOfflineConfigurationFile"/>
</test>
12 changes: 12 additions & 0 deletions DQMOffline/Configuration/test/runrest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash -ex
ERR=0
PYTHONUNBUFFERED=1 cmsswSequenceInfo.py --runTheMatrix --steps DQM,VALIDATION --infile $1 --offset $2 --dbfile sequences$2.db --threads 1 >run.log 2>&1 || ERR=1
cat run.log
seqs=$(grep 'Analyzing [0-9][0-9]* seqs' run.log | sed 's|.*Analyzing *||;s| .*||')
echo "Sequences run by final DQMOfflineConfiguration: $seqs"
if [ "$seqs" -gt 0 ] ; then
echo "Final DQMOfflineConfiguration should not run any sequences."
echo "Please update parameters for TestDQMOfflineConfiguration unittest to run the extra sequences."
exit 1
fi
exit $ERR

0 comments on commit 26a57e1

Please sign in to comment.