From e63bc433f766d36d56f1b38787c7575d9ae9aad7 Mon Sep 17 00:00:00 2001 From: mmusich Date: Wed, 7 Jul 2021 14:04:19 +0200 Subject: [PATCH] introduce uploadConditions unit test --- CondCore/Utilities/test/BuildFile.xml | 4 +++ .../Utilities/test/test_uploadConditions.sh | 35 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100755 CondCore/Utilities/test/test_uploadConditions.sh diff --git a/CondCore/Utilities/test/BuildFile.xml b/CondCore/Utilities/test/BuildFile.xml index 965967fb933c2..865923f343976 100644 --- a/CondCore/Utilities/test/BuildFile.xml +++ b/CondCore/Utilities/test/BuildFile.xml @@ -13,3 +13,7 @@ + + + + diff --git a/CondCore/Utilities/test/test_uploadConditions.sh b/CondCore/Utilities/test/test_uploadConditions.sh new file mode 100755 index 0000000000000..81349b58f6c64 --- /dev/null +++ b/CondCore/Utilities/test/test_uploadConditions.sh @@ -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 <> 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