Skip to content

Commit

Permalink
introduce uploadConditions unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusich committed Jul 7, 2021
1 parent 0fe0540 commit e63bc43
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CondCore/Utilities/test/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
</bin>

<test name="testGetPayloadData" command="test_getPayloadData.sh"/>

<test name="test_uploadConditions" command="test_uploadConditions.sh">
<flags PRE_TEST="testBasicPayload"/>
</test>
35 changes: 35 additions & 0 deletions CondCore/Utilities/test/test_uploadConditions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

check_for_success() {
"${@}" && echo -e "\n ---> Passed test of '${@}'\n\n" || exit 1
}

check_for_failure() {
"${@}" && exit 1 || echo -e "\n ---> Passed test of '${@}'\n\n"
}

########################################
# Test help function
########################################
check_for_success uploadConditions.py --help

########################################
# Test wizard
########################################
if test -f "BasicPayload_v0.txt"; then
rm -f BasicPayload_v0.txt
fi
cat <<EOF >> BasicPayload_v0.txt
{
"destinationDatabase": "ANYTHIGHEREWILLDO",
"destinationTags": {
"BasicPayload_v0": {}
},
"inputTag": "BasicPayload_v0",
"since": null,
"userText": "test wizard"
}
EOF

echo "content of the directory is:" `ls -lh . | grep db`
check_for_failure uploadConditions.py BasicPayload_v0.db

0 comments on commit e63bc43

Please sign in to comment.