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 7, 2023
1 parent c388b01 commit cdce093
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
7 changes: 1 addition & 6 deletions CondFormats/Common/test/BuildFile.xml
Expand Up @@ -15,9 +15,4 @@
<bin file="testSerializationCommon.cpp">
</bin>

<environment>
<bin file="testDropboxMetadataDB.cpp">
<flags TEST_RUNNER_ARGS=" /bin/bash CondFormats/Common/test createTestDBObjects.sh"/>
<use name="FWCore/Utilities"/>
</bin>
</environment>
<test name="testDropboxMetadataDB" command="createTestDBObjects.sh"/>
4 changes: 2 additions & 2 deletions CondFormats/Common/test/ProduceDropBoxMetadata.py
Expand Up @@ -17,11 +17,11 @@
)

# process.PoolDBOutputService.DBParameters.messageLevel = 3
import json
import json, os

def encodeJsonInString(filename):
"""This function open the json file and encodes it in a string replacing probelamtic characters"""
thefile = open("../data/"+filename)
thefile = open(os.path.join(os.path.dirname(__file__), "..", "data", filename))
thejson = json.load(thefile)
thefile.close()
return json.JSONEncoder().encode(thejson).replace('"',"&quot;")
Expand Down
5 changes: 2 additions & 3 deletions CondFormats/Common/test/createTestDBObjects.sh
Expand Up @@ -3,9 +3,8 @@
function die { echo $1: status $2 ; exit $2; }

echo -e "TESTING Dropbox Metadata DB codes ...\n\n"
cd ${LOCAL_TEST_DIR}/
cmsRun ProduceDropBoxMetadata.py || die "Failure running ProduceDropBoxMetadata.py" $?
cmsRun ${CMSSW_BASE}/src/CondFormats/Common/test/ProduceDropBoxMetadata.py || die "Failure running ProduceDropBoxMetadata.py" $?

echo -e "TESTING Dropbox Metadata DB Reader code ...\n Reading local sqlite DropBoxMetadata.db \n\n "
cmsRun DropBoxMetadataReader.py || die "Failure running DropBoxMetadataReader.py" $?
cmsRun ${CMSSW_BASE}/src/CondFormats/Common/test/DropBoxMetadataReader.py || die "Failure running DropBoxMetadataReader.py" $?

2 changes: 0 additions & 2 deletions CondFormats/Common/test/testDropboxMetadataDB.cpp

This file was deleted.

0 comments on commit cdce093

Please sign in to comment.